summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@koziol.gov>2020-06-26 23:57:38 (GMT)
committerQuincey Koziol <koziol@koziol.gov>2020-06-26 23:57:38 (GMT)
commite767f44e953047297fece364218147c908e8b585 (patch)
treed4b6909f14b78bb732b6947adc46ac3cd3ca54f6 /test
parent949649a2b6e00297cbdc49437e70a27e455e92d2 (diff)
parenta08ab621febde7b09e4d86eab80cb029c123e9f6 (diff)
downloadhdf5-e767f44e953047297fece364218147c908e8b585.zip
hdf5-e767f44e953047297fece364218147c908e8b585.tar.gz
hdf5-e767f44e953047297fece364218147c908e8b585.tar.bz2
Merge remote-tracking branch 'origin/develop' into monotonic_timer
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt642
-rw-r--r--test/CMakePassthroughVOLTests.cmake214
-rw-r--r--test/CMakeTests.cmake1418
-rw-r--r--test/CMakeVFDTests.cmake210
-rw-r--r--test/H5srcdir.h49
-rw-r--r--test/Makefile.am153
-rw-r--r--test/SWMR_UseCase_UG.txt2
-rw-r--r--test/ShellTests.cmake217
-rw-r--r--test/accum.c536
-rw-r--r--test/accum_swmr_reader.c62
-rw-r--r--test/app_ref.c6
-rw-r--r--test/atomic_reader.c30
-rw-r--r--test/atomic_writer.c10
-rw-r--r--test/big.c16
-rw-r--r--test/bittests.c188
-rw-r--r--test/btree2.c3086
-rw-r--r--test/cache.c15561
-rw-r--r--test/cache_api.c107
-rw-r--r--test/cache_common.c2292
-rw-r--r--test/cache_common.h526
-rw-r--r--test/cache_image.c3350
-rw-r--r--test/cache_logging.c27
-rw-r--r--test/cache_tagging.c653
-rw-r--r--test/chunk_info.c2025
-rw-r--r--test/cmpd_dset.c980
-rw-r--r--test/cork.c428
-rw-r--r--test/cross_read.c36
-rw-r--r--test/dangle.c106
-rw-r--r--test/del_many_dense_attrs.c203
-rw-r--r--test/direct_chunk.c2248
-rw-r--r--test/dsets.c5578
-rw-r--r--test/dt_arith.c1557
-rw-r--r--test/dtransform.c422
-rw-r--r--test/dtypes.c2597
-rw-r--r--test/dynlib1.c95
-rw-r--r--test/dynlib2.c92
-rw-r--r--test/dynlib3.c103
-rw-r--r--test/dynlib4.c102
-rw-r--r--test/earray.c719
-rw-r--r--test/efc.c1640
-rw-r--r--test/enc_dec_plist.c859
-rw-r--r--test/enc_dec_plist_cross_platform.c6
-rw-r--r--test/enum.c30
-rw-r--r--test/err_compat.c259
-rw-r--r--test/error_test.c503
-rw-r--r--test/evict_on_close.c67
-rw-r--r--test/extend.c209
-rw-r--r--test/external.c676
-rw-r--r--test/external_common.c127
-rw-r--r--test/external_common.h45
-rw-r--r--test/external_env.c218
-rw-r--r--test/external_fname.h37
-rw-r--r--test/farray.c533
-rw-r--r--test/fheap.c3124
-rw-r--r--test/file_image.c149
-rw-r--r--test/filenotclosed.c8
-rw-r--r--test/fill18.h5bin0 -> 3479 bytes
-rw-r--r--test/fillval.c983
-rw-r--r--test/filter_fail.c72
-rw-r--r--test/filter_plugin.c1559
-rw-r--r--test/filter_plugin1_dsets.c93
-rw-r--r--test/filter_plugin2_dsets.c88
-rw-r--r--test/filter_plugin3_dsets.c119
-rw-r--r--test/filter_plugin4_groups.c106
-rw-r--r--test/flush1.c8
-rw-r--r--test/flush2.c28
-rw-r--r--test/flushrefresh.c280
-rw-r--r--test/flushrefreshTest.cmake172
-rw-r--r--test/freespace.c515
-rw-r--r--test/gen_bad_compound.c2
-rw-r--r--test/gen_bad_offset.c8
-rw-r--r--test/gen_bogus.c12
-rw-r--r--test/gen_bounds.c1172
-rw-r--r--test/gen_cross.c104
-rw-r--r--test/gen_filespace.c5
-rw-r--r--test/gen_filters.c8
-rw-r--r--test/gen_new_super.c4
-rw-r--r--test/gen_nullspace.c4
-rw-r--r--test/gen_plist.c40
-rw-r--r--test/gen_specmetaread.c5
-rw-r--r--test/genall5.c3377
-rw-r--r--test/genall5.h2
-rw-r--r--test/getname.c54
-rw-r--r--test/gheap.c535
-rw-r--r--test/h5test.c945
-rw-r--r--test/h5test.h102
-rw-r--r--test/hdfs.c1767
-rw-r--r--test/hyperslab.c564
-rw-r--r--test/istore.c539
-rw-r--r--test/lheap.c41
-rw-r--r--test/links.c10328
-rw-r--r--test/links_env.c89
-rw-r--r--test/memleak_H5O_dtype_decode_helper_H5Odtype.h5bin0 -> 82816 bytes
-rw-r--r--test/mf.c4061
-rw-r--r--test/mirror_vfd.c2761
-rw-r--r--test/mount.c191
-rw-r--r--test/mtime.c78
-rw-r--r--test/ntypes.c94
-rw-r--r--test/null_vol_connector.c143
-rw-r--r--test/null_vol_connector.h25
-rw-r--r--test/objcopy.c3138
-rw-r--r--test/objcopy_ref.c1698
-rw-r--r--test/ohdr.c1217
-rw-r--r--test/page_buffer.c464
-rw-r--r--test/plugin.c1217
-rw-r--r--test/reserved.c86
-rw-r--r--test/ros3.c1937
-rw-r--r--test/s3comms.c2730
-rw-r--r--test/set_extent.c1479
-rw-r--r--test/stab.c262
-rw-r--r--test/swmr.c186
-rw-r--r--test/swmr_addrem_writer.c40
-rw-r--r--test/swmr_check_compat_vfd.c4
-rw-r--r--test/swmr_common.c42
-rw-r--r--test/swmr_common.h2
-rw-r--r--test/swmr_generator.c44
-rw-r--r--test/swmr_reader.c40
-rw-r--r--test/swmr_remove_reader.c34
-rw-r--r--test/swmr_remove_writer.c36
-rw-r--r--test/swmr_sparse_reader.c42
-rw-r--r--test/swmr_sparse_writer.c42
-rw-r--r--test/swmr_start_write.c233
-rw-r--r--test/swmr_writer.c42
-rw-r--r--test/tarray.c92
-rw-r--r--test/tattr.c3653
-rw-r--r--test/tbogus.h5bin4512 -> 5056 bytes
-rw-r--r--test/tcheck_version.c82
-rw-r--r--test/tchecksum.c4
-rw-r--r--test/tconfig.c63
-rw-r--r--test/tcoords.c10
-rw-r--r--test/test_filter_plugin.sh.in (renamed from test/test_plugin.sh.in)56
-rw-r--r--test/test_mirror.sh.in100
-rw-r--r--test/test_usecases.sh.in31
-rw-r--r--test/test_vol_plugin.sh.in84
-rw-r--r--test/testabort_fail.sh.in66
-rw-r--r--test/testcheck_version.sh.in18
-rw-r--r--test/testerror.sh.in12
-rw-r--r--test/testexternal_env.sh.in (renamed from test/test_filenotclosed.sh.in)23
-rw-r--r--test/testfiles/err_compat_124
-rw-r--r--test/testfiles/err_compat_22
-rw-r--r--test/testfiles/error_test_125
-rw-r--r--test/testfiles/error_test_22
-rw-r--r--test/testfiles/plist_files/dapl_32bebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/dapl_32lebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/dapl_64bebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/dapl_64lebin186 -> 199 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_32bebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_32lebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_64bebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dapl_64lebin181 -> 194 bytes
-rw-r--r--test/testfiles/plist_files/def_dxpl_32bebin245 -> 225 bytes
-rw-r--r--test/testfiles/plist_files/def_dxpl_32lebin245 -> 225 bytes
-rw-r--r--test/testfiles/plist_files/def_dxpl_64bebin245 -> 225 bytes
-rw-r--r--test/testfiles/plist_files/def_dxpl_64lebin245 -> 225 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_32bebin1520 -> 1651 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_32lebin1520 -> 1651 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_64bebin1520 -> 1651 bytes
-rw-r--r--test/testfiles/plist_files/def_fapl_64lebin1520 -> 1651 bytes
-rw-r--r--test/testfiles/plist_files/dxpl_32bebin249 -> 229 bytes
-rw-r--r--test/testfiles/plist_files/dxpl_32lebin249 -> 229 bytes
-rw-r--r--test/testfiles/plist_files/dxpl_64bebin249 -> 229 bytes
-rw-r--r--test/testfiles/plist_files/dxpl_64lebin249 -> 229 bytes
-rw-r--r--test/testfiles/plist_files/fapl_32bebin1522 -> 1653 bytes
-rw-r--r--test/testfiles/plist_files/fapl_32lebin1522 -> 1653 bytes
-rw-r--r--test/testfiles/plist_files/fapl_64bebin1522 -> 1653 bytes
-rw-r--r--test/testfiles/plist_files/fapl_64lebin1522 -> 1653 bytes
-rw-r--r--test/testfiles/plist_files/lapl_32bebin1625 -> 1756 bytes
-rw-r--r--test/testfiles/plist_files/lapl_32lebin1625 -> 1756 bytes
-rw-r--r--test/testfiles/plist_files/lapl_64bebin1625 -> 1756 bytes
-rw-r--r--test/testfiles/plist_files/lapl_64lebin1625 -> 1756 bytes
-rw-r--r--test/testflushrefresh.sh.in25
-rw-r--r--test/testframe.c388
-rw-r--r--test/testhdf5.c7
-rw-r--r--test/testhdf5.h308
-rw-r--r--test/testlibinfo.sh.in6
-rw-r--r--test/testlinks_env.sh.in12
-rw-r--r--test/testmeta.c110
-rw-r--r--test/testswmr.sh.in11
-rw-r--r--test/testvds_env.sh.in44
-rw-r--r--test/testvdsswmr.sh.in13
-rw-r--r--test/tfile.c3466
-rw-r--r--test/tgenprop.c166
-rw-r--r--test/th5o.c817
-rw-r--r--test/th5s.c1423
-rw-r--r--test/theap.c42
-rw-r--r--test/thread_id.c330
-rw-r--r--test/tid.c718
-rw-r--r--test/titerate.c353
-rw-r--r--test/tmeta.c2
-rw-r--r--test/tmisc.c558
-rw-r--r--test/trefer.c3045
-rw-r--r--test/trefer_deprec.c1827
-rw-r--r--test/trefer_shutdown.c83
-rw-r--r--test/trefstr.c32
-rw-r--r--test/tselect.c6120
-rw-r--r--test/tskiplist.c156
-rw-r--r--test/tsohm.c1945
-rw-r--r--test/ttime.c20
-rw-r--r--test/ttsafe.c10
-rw-r--r--test/ttsafe.h3
-rw-r--r--test/ttsafe_acreate.c104
-rw-r--r--test/ttsafe_cancel.c132
-rw-r--r--test/ttsafe_dcreate.c77
-rw-r--r--test/ttsafe_error.c238
-rw-r--r--test/ttst.c18
-rw-r--r--test/tunicode.c22
-rw-r--r--test/tvlstr.c198
-rw-r--r--test/tvltypes.c347
-rw-r--r--test/twriteorder.c390
-rw-r--r--test/unlink.c401
-rw-r--r--test/unregister.c270
-rw-r--r--test/use.h52
-rw-r--r--test/use_append_chunk.c280
-rw-r--r--test/use_append_chunk_mirror.c403
-rw-r--r--test/use_append_mchunks.c228
-rw-r--r--test/use_common.c841
-rw-r--r--test/use_disable_mdc_flushes.c387
-rw-r--r--test/vds.c2307
-rw-r--r--test/vds_env.c365
-rw-r--r--test/vds_swmr.h72
-rw-r--r--test/vds_swmr_gen.c54
-rw-r--r--test/vds_swmr_reader.c20
-rw-r--r--test/vds_swmr_writer.c4
-rw-r--r--test/vfd.c1552
-rw-r--r--test/vol.c1172
-rw-r--r--test/vol_plugin.c352
226 files changed, 88368 insertions, 49539 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8522c1d..e3bfeb3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,145 +1,182 @@
-cmake_minimum_required (VERSION 3.2.2)
-PROJECT (HDF5_TEST)
-
-#-----------------------------------------------------------------------------
-# Apply Definitions to compiler in this directory and below
-#-----------------------------------------------------------------------------
-add_definitions (${HDF_EXTRA_C_FLAGS})
+cmake_minimum_required (VERSION 3.12)
+project (HDF5_TEST C)
#-----------------------------------------------------------------------------
# Generate the H5srcdir_str.h file containing user settings needed by compilation
#-----------------------------------------------------------------------------
-set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+set (srcdir ${HDF5_TEST_SOURCE_DIR})
configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
-INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
-#-----------------------------------------------------------------------------
+#################################################################################
# Define Test Library Sources
-#-----------------------------------------------------------------------------
+#################################################################################
set (TEST_LIB_SOURCES
${HDF5_TEST_SOURCE_DIR}/h5test.c
${HDF5_TEST_SOURCE_DIR}/testframe.c
${HDF5_TEST_SOURCE_DIR}/cache_common.c
+ ${HDF5_TEST_SOURCE_DIR}/external_common.c
${HDF5_TEST_SOURCE_DIR}/swmr_common.c
)
set (TEST_LIB_HEADERS
${HDF5_TEST_SOURCE_DIR}/h5test.h
${HDF5_TEST_SOURCE_DIR}/cache_common.h
+ ${HDF5_TEST_SOURCE_DIR}/external_common.h
+ ${HDF5_TEST_SOURCE_DIR}/external_fname.h
${HDF5_TEST_SOURCE_DIR}/swmr_common.h
)
-add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
-TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ")
-if (MSVC)
- target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib")
-endif ()
-if (MINGW)
- target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib")
+if (NOT ONLY_SHARED_LIBS)
+ add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
+ target_include_directories (${HDF5_TEST_LIB_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ )
+ target_compile_options(${HDF5_TEST_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
+ target_link_libraries (${HDF5_TEST_LIB_TARGET}
+ PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
+ PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ )
+ if (MINGW)
+ target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
+ endif ()
+ H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0)
+ set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test)
endif ()
-target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC)
-set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES
- FOLDER libraries/test
- INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
-)
if (BUILD_SHARED_LIBS)
add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
- TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ")
- if (MSVC)
- target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib")
- endif ()
- if (MINGW)
- target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib")
- endif ()
- target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
- set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES
- FOLDER libraries/test
- COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB"
- INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
- INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1
+ target_include_directories (${HDF5_TEST_LIBSH_TARGET}
+ PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
+ INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
- if (HDF5_ENABLE_THREADSAFE)
- set_property (TARGET ${HDF5_TEST_LIBSH_TARGET}
- APPEND PROPERTY COMPILE_DEFINITIONS
- "H5_HAVE_THREADSAFE"
- )
+ target_compile_options(${HDF5_TEST_LIBSH_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ target_compile_definitions(${HDF5_TEST_LIBSH_TARGET} PUBLIC "H5_BUILT_AS_DYNAMIC_LIB")
+ TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
+ target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
+ PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
+ PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
+ )
+ if (MINGW)
+ target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")
endif ()
+ H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED "LIB")
+ set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test)
endif ()
-#-----------------------------------------------------------------------------
-# If plugin library tests can be tested
-#-----------------------------------------------------------------------------
+#################################################################################
+# If filter and vol plugin tests can be tested
+#################################################################################
+if (BUILD_SHARED_LIBS)
# make plugins dir
- file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1")
- file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2")
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir1")
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir2")
#-----------------------------------------------------------------------------
- # Define Plugin Test Sources
+ # Define Filter Plugin Test Sources
#-----------------------------------------------------------------------------
- set (TEST_PLUGIN_LIBS
- dynlib1
- dynlib3
+ set (FILTER_PLUGINS_FOR_DIR1
+ filter_plugin1_dsets
+ filter_plugin3_dsets
)
- set (TEST2_PLUGIN_LIBS
- dynlib2
- dynlib4
+ set (FILTER_PLUGINS_FOR_DIR2
+ filter_plugin2_dsets
+ filter_plugin4_groups
)
- foreach (test_lib ${TEST_PLUGIN_LIBS})
- set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}")
- set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}")
- set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME})
- add_definitions (${HDF_EXTRA_C_FLAGS})
- INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
+ foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR1})
+ set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}")
+ set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}")
+ set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
- add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c)
- TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
- set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
+ add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
+ target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
+ target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
+ set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
#-----------------------------------------------------------------------------
- # Copy plugin library to a plugins folder
+ # Copy the filter plugin to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET}
+ TARGET ${HDF5_TEST_PLUGIN_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${HDF5_TEST_PLUGIN_TARGET}>"
+ "${CMAKE_BINARY_DIR}/filter_plugin_dir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_TARGET}>"
)
endforeach ()
- foreach (test_lib ${TEST2_PLUGIN_LIBS})
- set (HDF5_TEST_PLUGIN_LIB_CORENAME "${test_lib}")
- set (HDF5_TEST_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_LIB_CORENAME}")
- set (HDF5_TEST_PLUGIN_LIB_TARGET ${HDF5_TEST_PLUGIN_LIB_CORENAME})
- add_definitions (${HDF_EXTRA_C_FLAGS})
- INCLUDE_DIRECTORIES (${HDF5_SRC_DIR})
+ foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR2})
+ set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}")
+ set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}")
+ set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
- add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c)
- TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ")
- target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} SHARED ${HDF5_PACKAGE_SOVERSION})
- set_target_properties (${HDF5_TEST_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
+ add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
+ target_include_directories (${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
+ target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
+ set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
#-----------------------------------------------------------------------------
- # Copy plugin library to a plugins folder
+ # Copy the filter plugin to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET}
+ TARGET ${HDF5_TEST_PLUGIN_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${HDF5_TEST_PLUGIN_TARGET}>"
+ "${CMAKE_BINARY_DIR}/filter_plugin_dir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_TARGET}>"
)
endforeach ()
+ #################################################################################
+ # make vol plugins dir
+ #################################################################################
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/null_vol_plugin_dir")
+
+ #-----------------------------------------------------------------------------
+ # Define VOL Plugin Test Sources
+ #-----------------------------------------------------------------------------
+ set (VOL_PLUGIN_LIBS
+ null_vol_connector
+ )
+
+ foreach (vol_lib ${VOL_PLUGIN_LIBS})
+ set (HDF5_VOL_PLUGIN_LIB_CORENAME "${vol_lib}")
+ set (HDF5_VOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_VOL_PLUGIN_LIB_CORENAME}")
+ set (HDF5_VOL_PLUGIN_LIB_TARGET ${HDF5_VOL_PLUGIN_LIB_CORENAME})
+
+ add_library (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${vol_lib}.c)
+ target_include_directories (${HDF5_VOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${HDF5_VOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${HDF5_VOL_PLUGIN_LIB_TARGET} PUBLIC ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${HDF5_VOL_PLUGIN_LIB_TARGET} ${HDF5_VOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ set_target_properties (${HDF5_VOL_PLUGIN_LIB_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
+
+ #-----------------------------------------------------------------------------
+ # Copy VOL plugin to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${HDF5_VOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${HDF5_VOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/null_vol_plugin_dir/$<TARGET_FILE_NAME:${HDF5_VOL_PLUGIN_LIB_TARGET}>"
+ )
+ endforeach ()
+endif ()
+
+#################################################################################
+# Test program sources
+#################################################################################
+
set (testhdf5_SOURCES
${HDF5_TEST_SOURCE_DIR}/testhdf5.c
${HDF5_TEST_SOURCE_DIR}/tarray.c
@@ -157,6 +194,7 @@ set (testhdf5_SOURCES
${HDF5_TEST_SOURCE_DIR}/tmeta.c
${HDF5_TEST_SOURCE_DIR}/tmisc.c
${HDF5_TEST_SOURCE_DIR}/trefer.c
+ ${HDF5_TEST_SOURCE_DIR}/trefer_deprec.c
${HDF5_TEST_SOURCE_DIR}/trefstr.c
${HDF5_TEST_SOURCE_DIR}/tselect.c
${HDF5_TEST_SOURCE_DIR}/tskiplist.c
@@ -168,38 +206,29 @@ set (testhdf5_SOURCES
${HDF5_TEST_SOURCE_DIR}/tvlstr.c
)
-#-- Adding test for testhdf5
-add_executable (testhdf5 ${testhdf5_SOURCES})
-TARGET_NAMING (testhdf5 STATIC)
-TARGET_C_PROPERTIES (testhdf5 STATIC " " " ")
-target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
-set_target_properties (testhdf5 PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (testhdf5-shared ${testhdf5_SOURCES})
- TARGET_NAMING (testhdf5-shared SHARED)
- TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ")
- target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (testhdf5-shared PROPERTIES FOLDER test)
-endif ()
+set (cache_image_SOURCES
+ ${HDF5_TEST_SOURCE_DIR}/cache_image.c
+ ${HDF5_TEST_SOURCE_DIR}/genall5.c
+)
-MACRO (ADD_H5_EXE file)
- add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
- TARGET_NAMING (${file} STATIC)
- TARGET_C_PROPERTIES (${file} STATIC " " " ")
- target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
- set_target_properties (${file} PROPERTIES FOLDER test)
- if (BUILD_SHARED_LIBS)
- add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c)
- TARGET_NAMING (${file}-shared SHARED)
- TARGET_C_PROPERTIES (${file}-shared SHARED " " " ")
- target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (${file}-shared PROPERTIES FOLDER test)
- endif ()
-ENDMACRO ()
+set(mirror_vfd_SOURCES
+ ${HDF5_TEST_SOURCE_DIR}/mirror_vfd.c
+ ${HDF5_TEST_SOURCE_DIR}/genall5.c
+)
+
+set (ttsafe_SOURCES
+ ${HDF5_TEST_SOURCE_DIR}/ttsafe.c
+ ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c
+ ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c
+ ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c
+ ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c
+)
set (H5_TESTS
+ testhdf5 # multiple source
cache
cache_api
+ cache_image # multiple source
cache_tagging
lheap
ohdr
@@ -212,16 +241,22 @@ set (H5_TESTS
fheap
pool
accum
+ hyperslab
istore
bittests
dt_arith
+ page_buffer
dtypes
dsets
+ chunk_info # compression lib link
cmpd_dset
filter_fail
extend
+ direct_chunk # compression lib link
external
+ external_env
efc
+ objcopy_ref
objcopy
links
unlink
@@ -235,134 +270,173 @@ set (H5_TESTS
app_ref
enum
set_extent
+ ttsafe # multiple source
enc_dec_plist
enc_dec_plist_cross_platform
getname
vfd
+ ros3
+ s3comms
+ hdfs
+ mirror_vfd
ntypes
dangle
dtransform
- reserved
+ # reserved disabled
cross_read
freespace
mf
- page_buffer
vds
+ vds_env
file_image
unregister
cache_logging
cork
swmr
+ thread_id # special link
+ vol
)
-foreach (test ${H5_TESTS})
- ADD_H5_EXE(${test})
-endforeach ()
-
-set (H5_SWMR_TESTS
- swmr_addrem_writer
- swmr_check_compat_vfd
- swmr_generator
- swmr_reader
- swmr_remove_reader
- swmr_remove_writer
- swmr_sparse_reader
- swmr_sparse_writer
- swmr_start_write
- swmr_writer
-)
-
-foreach (test ${H5_SWMR_TESTS})
- ADD_H5_EXE(${test})
-endforeach ()
-
-set (H5_VDS_SWMR_TESTS
- vds_swmr_gen
- vds_swmr_reader
- vds_swmr_writer
+macro (ADD_H5_EXE file)
+ add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
+ target_include_directories (${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_compile_options(${file} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${file} STATIC)
+ target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (${file} SHARED)
+ target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ endif ()
+ set_target_properties (${file} PROPERTIES FOLDER test)
+endmacro ()
+
+set (H5_TESTS_MULTIPLE
+ chunk_info
+ direct_chunk
+ testhdf5
+ cache_image
+ ttsafe
+ thread_id # special link
+ mirror_vfd
)
-
-foreach (test ${H5_VDS_SWMR_TESTS})
- ADD_H5_EXE(${test})
+# Only build single source tests here
+foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_TESTS_MULTIPLE)
+ ADD_H5_EXE(${h5_test})
+ endif ()
endforeach ()
##############################################################################
+### M U L T I P L E S O U R C E T E S T S ###
##############################################################################
-### A D D I T I O N A L 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_compile_options(chunk_info PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+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_compile_options(direct_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (direct_chunk 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 (direct_chunk STATIC)
+ target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIB_TARGET} ${LINK_COMP_LIBS})
+else ()
+ TARGET_C_PROPERTIES (direct_chunk SHARED)
+ target_link_libraries (direct_chunk PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${LINK_COMP_LIBS})
+endif ()
+set_target_properties (direct_chunk PROPERTIES FOLDER test)
+
+
+######### Special handling for multiple sources #############
+#-- Adding test for testhdf5
+add_executable (testhdf5 ${testhdf5_SOURCES})
+target_compile_options(testhdf5 PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (testhdf5 STATIC)
+ target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (testhdf5 SHARED)
+ target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+endif ()
+set_target_properties (testhdf5 PROPERTIES FOLDER test)
#-- Adding test for cache_image
-add_executable (cache_image
- ${HDF5_TEST_SOURCE_DIR}/cache_image.c
- ${HDF5_TEST_SOURCE_DIR}/genall5.c
-)
-TARGET_NAMING (cache_image STATIC)
-TARGET_C_PROPERTIES (cache_image STATIC " " " ")
-target_link_libraries (cache_image ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (cache_image PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (cache_image-shared
- ${HDF5_TEST_SOURCE_DIR}/cache_image.c
- ${HDF5_TEST_SOURCE_DIR}/genall5.c
- )
- TARGET_NAMING (cache_image-shared SHARED)
- TARGET_C_PROPERTIES (cache_image-shared SHARED " " " ")
- target_link_libraries (cache_image-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (cache_image-shared PROPERTIES FOLDER test)
+add_executable (cache_image ${cache_image_SOURCES})
+target_compile_options(cache_image PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (cache_image STATIC)
+ target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (cache_image SHARED)
+ target_link_libraries (cache_image PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (cache_image PROPERTIES FOLDER test)
-#-- Adding test for hyperslab
-add_executable (hyperslab ${HDF5_TEST_SOURCE_DIR}/hyperslab.c)
-TARGET_NAMING (hyperslab STATIC)
-TARGET_C_PROPERTIES (hyperslab STATIC " " " ")
-target_link_libraries (hyperslab ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (hyperslab PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (hyperslab-shared ${HDF5_TEST_SOURCE_DIR}/hyperslab.c)
- TARGET_NAMING (hyperslab-shared SHARED)
- TARGET_C_PROPERTIES (hyperslab-shared SHARED " " " ")
- target_link_libraries (hyperslab-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (hyperslab-shared PROPERTIES FOLDER test)
- if (HDF5_ENABLE_THREADSAFE)
- set_property (TARGET hyperslab-shared
- APPEND PROPERTY COMPILE_DEFINITIONS
- "H5_HAVE_THREADSAFE"
+#-- Adding test for ttsafe
+add_executable (ttsafe ${ttsafe_SOURCES})
+target_compile_options(ttsafe PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (ttsafe STATIC)
+ target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET})
+ if (NOT WIN32)
+ target_link_libraries (ttsafe
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
)
endif ()
+else ()
+ TARGET_C_PROPERTIES (ttsafe SHARED)
+ target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
endif ()
-
-#-- Adding test for ttsafe
-add_executable (ttsafe
- ${HDF5_TEST_SOURCE_DIR}/ttsafe.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c
-)
-TARGET_NAMING (ttsafe STATIC)
-TARGET_C_PROPERTIES (ttsafe STATIC " " " ")
-target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
set_target_properties (ttsafe PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (ttsafe-shared
- ${HDF5_TEST_SOURCE_DIR}/ttsafe.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c
- ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c
- )
- TARGET_NAMING (ttsafe-shared SHARED)
- TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ")
- target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (ttsafe-shared PROPERTIES FOLDER test)
- if (HDF5_ENABLE_THREADSAFE)
- set_property (TARGET ttsafe-shared
- APPEND PROPERTY COMPILE_DEFINITIONS
- "H5_HAVE_THREADSAFE"
+
+######### Special handling for extra link lib of threads #############
+#-- Adding test for thread_id
+add_executable (thread_id ${HDF5_TEST_SOURCE_DIR}/thread_id.c)
+target_compile_options(thread_id PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (thread_id PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (thread_id STATIC)
+ target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIB_TARGET})
+ if (NOT WIN32)
+ target_link_libraries (thread_id
+ PRIVATE $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>
)
endif ()
+else ()
+ TARGET_C_PROPERTIES (thread_id SHARED)
+ target_link_libraries (thread_id PRIVATE ${HDF5_TEST_LIBSH_TARGET} $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:Threads::Threads>)
+endif ()
+set_target_properties (thread_id PROPERTIES FOLDER test)
+
+#-- Adding test for mirror_vfd
+add_executable (mirror_vfd ${mirror_vfd_SOURCES})
+target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (mirror_vfd STATIC)
+ target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (mirror_vfd SHARED)
+ target_link_libraries (mirror_vfd PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (mirror_vfd PROPERTIES FOLDER test)
+
+##############################################################################
+### A D D I T I O N A L T E S T S ###
+##############################################################################
set (H5_CHECK_TESTS
error_test
@@ -372,34 +446,20 @@ set (H5_CHECK_TESTS
atomic_writer
atomic_reader
links_env
- flushrefresh
filenotclosed
+ del_many_dense_attrs
+ flushrefresh
)
-foreach (test ${H5_CHECK_TESTS})
- ADD_H5_EXE(${test})
+foreach (h5_test ${H5_CHECK_TESTS})
+ ADD_H5_EXE(${h5_test})
endforeach ()
-#-- Adding test for accum_swmr_reader
-# This has to be copied to the test directory for execve() to find it
-# and it can't be renamed (i.e., no <foo>-shared).
-add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
-TARGET_NAMING (accum_swmr_reader STATIC)
-TARGET_C_PROPERTIES (accum_swmr_reader STATIC " " " ")
-target_link_libraries (accum_swmr_reader ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (accum_swmr_reader PROPERTIES FOLDER test)
-
-#-- Set accum dependencies
-set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader)
-if (BUILD_SHARED_LIBS)
- set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader)
-endif ()
-
#-- Adding test for libinfo
set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake)
file (WRITE ${GREP_RUNNER}
"file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\")
-if (\${TEST_RESULT} STREQUAL \"0\")
+if (NOT TEST_RESULT)
message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\")
else ()
message (STATUS \"COMMAND Result: \${TEST_RESULT}\")
@@ -408,20 +468,69 @@ endif ()
)
##############################################################################
+### S W I M M E R T E S T S ###
+##############################################################################
+
+set (H5_SWMR_TESTS
+ swmr_addrem_writer
+ swmr_check_compat_vfd
+ swmr_generator
+ swmr_reader
+ swmr_remove_reader
+ swmr_remove_writer
+ swmr_sparse_reader
+ swmr_sparse_writer
+ swmr_start_write
+ swmr_writer
+)
+
+foreach (h5_test ${H5_SWMR_TESTS})
+ ADD_H5_EXE(${h5_test})
+endforeach ()
+
+set (H5_VDS_SWMR_TESTS
+ vds_swmr_gen
+ vds_swmr_reader
+ vds_swmr_writer
+)
+
+foreach (h5_test ${H5_VDS_SWMR_TESTS})
+ ADD_H5_EXE(${h5_test})
+endforeach ()
+
+#-- Adding test for accum_swmr_reader
+# This has to be copied to the test directory for execve() to find it
+# and it can't be renamed (i.e., no <foo>-shared).
+add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
+target_compile_options(accum_swmr_reader PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
+ target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (accum_swmr_reader SHARED)
+ target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
+set_target_properties (accum_swmr_reader PROPERTIES FOLDER test)
+
+#-- Set accum dependencies
+set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader)
+
+##############################################################################
### P L U G I N T E S T S
##############################################################################
if (BUILD_SHARED_LIBS)
- add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c)
- TARGET_NAMING (plugin SHARED)
- TARGET_C_PROPERTIES (plugin SHARED " " " ")
- target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET})
- set_target_properties (plugin PROPERTIES FOLDER test)
-else ()
- add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c)
- TARGET_NAMING (plugin STATIC)
- TARGET_C_PROPERTIES (plugin STATIC " " " ")
- target_link_libraries (plugin ${HDF5_TEST_LIB_TARGET})
- set_target_properties (plugin PROPERTIES FOLDER test)
+ add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c)
+ target_include_directories (filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (filter_plugin SHARED)
+ target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ set_target_properties (filter_plugin PROPERTIES FOLDER test)
+
+ add_executable (vol_plugin ${HDF5_TEST_SOURCE_DIR}/vol_plugin.c)
+ target_include_directories (vol_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (vol_plugin SHARED)
+ target_link_libraries (vol_plugin PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ set_target_properties (vol_plugin PROPERTIES FOLDER test)
endif ()
##############################################################################
@@ -429,44 +538,43 @@ endif ()
##############################################################################
set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_chunk ${use_append_chunk_SOURCES})
-TARGET_NAMING (use_append_chunk STATIC)
-TARGET_C_PROPERTIES (use_append_chunk STATIC " " " ")
-target_link_libraries (use_append_chunk ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (use_append_chunk PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES})
- TARGET_NAMING (use_append_chunk-shared SHARED)
- TARGET_C_PROPERTIES (use_append_chunk-shared SHARED " " " ")
- target_link_libraries (use_append_chunk-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test)
+target_compile_options(use_append_chunk PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (use_append_chunk STATIC)
+ target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (use_append_chunk SHARED)
+ target_link_libraries (use_append_chunk PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (use_append_chunk PROPERTIES FOLDER test)
set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
-TARGET_NAMING (use_append_mchunks STATIC)
-TARGET_C_PROPERTIES (use_append_mchunks STATIC " " " ")
-target_link_libraries (use_append_mchunks ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES})
- TARGET_NAMING (use_append_mchunks-shared SHARED)
- TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED " " " ")
- target_link_libraries (use_append_mchunks-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test)
+target_compile_options(use_append_mchunks PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (use_append_mchunks STATIC)
+ target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (use_append_mchunks SHARED)
+ target_link_libraries (use_append_mchunks PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c)
add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
-TARGET_NAMING (use_disable_mdc_flushes STATIC)
-TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC " " " ")
-target_link_libraries (use_disable_mdc_flushes ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
-set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test)
-if (BUILD_SHARED_LIBS)
- add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES})
- TARGET_NAMING (use_disable_mdc_flushes-shared SHARED)
- TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED " " " ")
- target_link_libraries (use_disable_mdc_flushes-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
- set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test)
+target_compile_options(use_disable_mdc_flushes PRIVATE "${HDF5_CMAKE_C_FLAGS}")
+target_include_directories (use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)
+ target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (use_disable_mdc_flushes SHARED)
+ target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
+set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test)
-include (CMakeTests.cmake)
+if (HDF5_TEST_SERIAL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/test/CMakePassthroughVOLTests.cmake b/test/CMakePassthroughVOLTests.cmake
new file mode 100644
index 0000000..e1b1f92
--- /dev/null
+++ b/test/CMakePassthroughVOLTests.cmake
@@ -0,0 +1,214 @@
+
+# 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.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+# included from CMakeTests.cmake
+
+set (VOL_LIST
+ vol_native
+ vol_pass_through1
+ vol_pass_through2
+)
+
+set (vol_native native)
+set (vol_pass_through1 "pass_through under_vol=0\;under_info={}")
+set (vol_pass_through2 "pass_through under_vol=505\;under_info={under_vol=0\;under_info={}}")
+
+foreach (voltest ${VOL_LIST})
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}")
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}/testfiles")
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}/testfiles/plist_files")
+endforeach ()
+
+foreach (voltest ${VOL_LIST})
+ foreach (h5_tfile ${HDF5_TEST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${voltest}/${h5_tfile}" "HDF5_VOLTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+foreach (voltest ${VOL_LIST})
+ foreach (ref_file ${HDF5_REFERENCE_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${voltest}/${ref_file}" "HDF5_VOLTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+foreach (voltest ${VOL_LIST})
+ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${voltest}/${h5_file}" "HDF5_VOLTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+foreach (voltest ${VOL_LIST})
+ foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${voltest}/testfiles/plist_files/${plistfile}" "HDF5_VOLTEST_LIB_files")
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${voltest}/testfiles/plist_files/def_${plistfile}" "HDF5_VOLTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VOLTEST_LIB tests" DEPENDS ${HDF5_VOLTEST_LIB_files_list})
+
+##############################################################################
+##############################################################################
+### V O L T E S T S ###
+##############################################################################
+##############################################################################
+
+ set (H5_VOL_SKIP_TESTS
+ cache
+ cache_image
+ accum
+ fheap
+ big
+ vol
+ error_test
+ err_compat
+ tcheck_version
+ testmeta
+ links_env
+ external_env
+ vds_env
+ )
+ if (NOT CYGWIN)
+ list (REMOVE_ITEM H5_VOL_SKIP_TESTS big cache)
+ endif ()
+
+ # Windows only macro
+ macro (CHECK_VOL_TEST voltest volname volinfo resultcode)
+ 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}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${voltest}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VOL:STRING=${volinfo}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${volname}-${voltest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}"
+ -P "${HDF_RESOURCES_DIR}/volTest.cmake"
+ )
+ set_tests_properties (VOL-${volname}-${voltest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
+ )
+ else ()
+ add_test (NAME VOL-${volname}-${voltest}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP VOL-${volname}-${voltest}"
+ )
+ endif ()
+ else ()
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${volname}-${voltest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}"
+ -P "${HDF_RESOURCES_DIR}/volTest.cmake"
+ )
+ set_tests_properties (VOL-${volname}-${voltest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
+ )
+ endif ()
+ else ()
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${volname}-${voltest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}"
+ -P "${HDF_RESOURCES_DIR}/volTest.cmake"
+ )
+ set_tests_properties (VOL-${volname}-${voltest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
+ )
+ endif ()
+ endmacro ()
+
+ macro (DO_VOL_TEST voltest volname volinfo resultcode)
+ #message(STATUS "${voltest}-${volname} with ${volinfo}")
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${volname}-${voltest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}"
+ -P "${HDF_RESOURCES_DIR}/volTest.cmake"
+ )
+ set_tests_properties (VOL-${volname}-${voltest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
+ )
+ endmacro ()
+
+ macro (ADD_VOL_TEST volname volinfo resultcode)
+ #message(STATUS "volname=${volname} volinfo=${volinfo}")
+ foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_VOL_SKIP_TESTS)
+ if (WIN32)
+ CHECK_VOL_TEST (${h5_test} ${volname} "${volinfo}" ${resultcode})
+ else ()
+ DO_VOL_TEST (${h5_test} ${volname} "${volinfo}" ${resultcode})
+ endif ()
+ endif ()
+ endforeach ()
+ set_tests_properties (VOL-${volname}-flush2 PROPERTIES DEPENDS VOL-${volname}-flush1)
+ set_tests_properties (VOL-${volname}-flush1 PROPERTIES TIMEOUT 10)
+ set_tests_properties (VOL-${volname}-flush2 PROPERTIES TIMEOUT 10)
+ set_tests_properties (VOL-${volname}-istore PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+ if (NOT CYGWIN)
+ 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
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:fheap>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VOL:STRING=${volinfo}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${volname}-fheap.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}"
+ -P "${HDF_RESOURCES_DIR}/volTest.cmake"
+ )
+ set_tests_properties (VOL-${volname}-fheap PROPERTIES
+ TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}
+ )
+ endif ()
+ endmacro ()
+
+ # Run test with different Virtual File Driver
+ foreach (volname ${VOL_LIST})
+ #message(STATUS "volname=${volname}")
+ foreach (volinfo IN LISTS ${volname})
+ #message(STATUS "${volname} volinfo=${volinfo}")
+ ADD_VOL_TEST (${volname} "${volinfo}" 0)
+ endforeach ()
+ endforeach ()
+
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 5d2f30b..2371468 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -1,4 +1,4 @@
-#
+
# Copyright by The HDF Group.
# All rights reserved.
#
@@ -20,32 +20,6 @@
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files")
-if (BUILD_SHARED_LIBS)
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared")
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles")
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files")
-endif ()
-
-if (HDF5_TEST_VFD)
- set (VFD_LIST
- sec2
- stdio
- core
- core_paged
- split
- multi
- family
- )
- if (DIRECT_VFD)
- set (VFD_LIST ${VFD_LIST} direct)
- endif ()
- foreach (vfdtest ${VFD_LIST})
- file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
- #if (BUILD_SHARED_LIBS)
- # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared")
- #endif ()
- endforeach ()
-endif ()
# --------------------------------------------------------------------
# Copy all the HDF5 files from the source directory into the test directory
@@ -60,31 +34,10 @@ add_custom_command (
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different "$<TARGET_FILE:accum_swmr_reader>" "${PROJECT_BINARY_DIR}/H5TEST/accum_swmr_reader"
)
-if (BUILD_SHARED_LIBS)
- add_custom_command (
- TARGET accum_swmr_reader
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "$<TARGET_FILE:accum_swmr_reader>" "${PROJECT_BINARY_DIR}/H5TEST-shared/accum_swmr_reader"
- )
-endif ()
foreach (h5_tfile ${HDF5_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
-if (HDF5_TEST_VFD)
- foreach (vfdtest ${VFD_LIST})
- foreach (h5_tfile ${HDF5_TEST_FILES})
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}" "HDF5_TEST_LIBSH_files")
- endif ()
- endforeach ()
- endforeach ()
-endif ()
# --------------------------------------------------------------------
# Copy all the HDF5 files from the test directory into the source directory
@@ -99,20 +52,7 @@ set (HDF5_REFERENCE_FILES
foreach (ref_file ${HDF5_REFERENCE_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
-if (HDF5_TEST_VFD)
- foreach (vfdtest ${VFD_LIST})
- foreach (ref_file ${HDF5_REFERENCE_FILES})
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}" "HDF5_TEST_LIBSH_files")
- endif ()
- endforeach ()
- endforeach ()
-endif ()
# --------------------------------------------------------------------
# Copy test files from test/testfiles/plist_files dir to test dir
@@ -171,10 +111,6 @@ set (HDF5_REFERENCE_PLIST_FILES
foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIB_files")
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/${plistfile}" "HDF5_TEST_LIBSH_files")
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files/def_${plistfile}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
# --------------------------------------------------------------------
@@ -199,6 +135,7 @@ set (HDF5_REFERENCE_TEST_FILES
filespace_1_6.h5
filespace_1_8.h5
fill_old.h5
+ fill18.h5
filter_error.h5
fsm_aggr_nopersist.h5
fsm_aggr_persist.h5
@@ -212,6 +149,7 @@ set (HDF5_REFERENCE_TEST_FILES
le_data.h5
le_extlink1.h5
le_extlink2.h5
+ memleak_H5O_dtype_decode_helper_H5Odtype.h5
mergemsg.h5
multi_file_v16-r.h5
multi_file_v16-s.h5
@@ -234,132 +172,63 @@ set (HDF5_REFERENCE_TEST_FILES
foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}" "HDF5_TEST_LIBSH_files")
- endif ()
endforeach ()
-if (HDF5_TEST_VFD)
- foreach (vfdtest ${VFD_LIST})
- foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_TEST_LIB_files")
- if (BUILD_SHARED_LIBS)
- HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}" "HDF5_TEST_LIBSH_files")
- endif ()
- endforeach ()
- endforeach ()
-endif ()
+
add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list})
-if (BUILD_SHARED_LIBS)
- add_custom_target(HDF5_TEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_TEST_LIBSH tests" DEPENDS ${HDF5_TEST_LIBSH_files_list})
-endif ()
+
+set (testhdf5_CLEANFILES
+ coord.h5
+ dtypes10.h5
+ sys_file1
+ tattr.h5
+ tfile1.h5
+ tfile2.h5
+ tfile3.h5
+ tfile4.h5
+ tfile5.h5
+ tfile6.h5
+ tfile7.h5
+ tfilespace.h5
+ th5o_file
+ th5s1.h5
+ tselect.h5
+ tsohm.h5
+ tsohm_dst.h5
+ tsohm_src.h5
+)
# Remove any output file left over from previous test run
-add_test (NAME H5TEST-clear-testhdf5-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- coord.h5
- dtypes10.h5
- sys_file1
- tattr.h5
- tfile1.h5
- tfile2.h5
- tfile3.h5
- tfile4.h5
- tfile5.h5
- tfile6.h5
- tfile7.h5
- th5o_file
- th5s1.h5
- tselect.h5
- tsohm.h5
- tsohm_dst.h5
- tsohm_src.h5
- 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-testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5)
-if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-testhdf5-base COMMAND $<TARGET_FILE:testhdf5> -x heap -x file -x select)
- set_tests_properties (H5TEST-testhdf5-base PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
- 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)
- set_tests_properties (H5TEST-testhdf5-heap PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
- 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)
- set_tests_properties (H5TEST-testhdf5-file PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
- 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)
- set_tests_properties (H5TEST-testhdf5-select PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
- ENVIRONMENT "HDF5_ALARM_SECONDS=3600;srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- )
-else ()
- add_test (NAME H5TEST-testhdf5 COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=testhdf5.txt"
- #-D "TEST_REFERENCE=testhdf5.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5TEST-testhdf5 PROPERTIES
- DEPENDS H5TEST-clear-testhdf5-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- )
- if (BUILD_SHARED_LIBS)
- add_test (NAME H5TEST-shared-clear-testhdf5-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- coord.h5
- dtypes10.h5
- sys_file1
- tattr.h5
- tfile1.h5
- tfile2.h5
- tfile3.h5
- tfile4.h5
- tfile5.h5
- tfile6.h5
- tfile7.h5
- th5o_file
- th5s1.h5
- tselect.h5
- tsohm.h5
- tsohm_dst.h5
- tsohm_src.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- add_test (NAME H5TEST-shared-testhdf5 COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:testhdf5-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=testhdf5.txt"
- #-D "TEST_REFERENCE=testhdf5.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES
- DEPENDS H5TEST-shared-clear-testhdf5-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endif ()
-endif ()
+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 ${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 ${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 ${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"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
##############################################################################
##############################################################################
@@ -394,6 +263,9 @@ set (test_CLEANFILES
bt2_hdr_fd.h5
storage_size.h5
dls_01_strings.h5
+ power2up.h5
+ version_bounds.h5
+ alloc_0sized.h5
extend.h5
istore.h5
extlinks*.h5
@@ -405,6 +277,9 @@ set (test_CLEANFILES
lheap.h5
fheap.h5
ohdr.h5
+ ohdr_min_a.h5
+ ohdr_min_b.h5
+ min_dset_ohdr_testfile.h5
stab.h5
extern_*.h5
extern_*.raw
@@ -413,61 +288,19 @@ set (test_CLEANFILES
dt_arith2
links.h5
links*.h5
- extlinks16A00000.h5
- extlinks16A00001.h5
- extlinks16A00002.h5
- extlinks16B-b.h5
- extlinks16B-g.h5
- extlinks16B-l.h5
- extlinks16B-r.h5
- extlinks16B-s.h5
- extlinks19B00000.h5
- extlinks19B00001.h5
- extlinks19B00002.h5
- extlinks19B00003.h5
- extlinks19B00004.h5
- extlinks19B00005.h5
- extlinks19B00006.h5
- extlinks19B00007.h5
- extlinks19B00008.h5
- extlinks19B00009.h5
- extlinks19B00010.h5
- extlinks19B00011.h5
- extlinks19B00012.h5
- extlinks19B00013.h5
- extlinks19B00014.h5
- extlinks19B00015.h5
- extlinks19B00016.h5
- extlinks19B00017.h5
- extlinks19B00018.h5
- extlinks19B00019.h5
- extlinks19B00020.h5
- extlinks19B00021.h5
- extlinks19B00022.h5
- extlinks19B00023.h5
- extlinks19B00024.h5
- extlinks19B00025.h5
- extlinks19B00026.h5
- extlinks19B00027.h5
- extlinks19B00028.h5
+ extlinks*.h5
tmp
+ tmp_links
+ tmp2_links
+ tmp_links_env
+ tmp_vds/*
+ tmp_vds_env/*
big.data
big*.h5
stdio.h5
sec2.h5
- dtypes0.h5
- dtypes1.h5
- dtypes2.h5
- dtypes3.h5
- dtypes4.h5
- dtypes5.h5
- dtypes6.h5
- dtypes7.h5
- dtypes8.h5
- dtypes9.h5
- dtypes10.h5
- dt_arith1.h5
- dt_arith2.h5
+ dtypes*.h5
+ dt_arith*.h5
tattr.h5
tselect.h5
mtime.h5
@@ -479,9 +312,8 @@ set (test_CLEANFILES
mount_*.h5
testmeta.h5
ttime.h5
- trefer1.h5
- trefer2.h5
- trefer3.h5
+ trefer*.h5
+ trefer_*.h5
tvltypes.h5
tvlstr.h5
tvlstr2.h5
@@ -500,27 +332,18 @@ set (test_CLEANFILES
tarray1.h5
tgenprop.h5
tmisc*.h5
- set_extent1.h5
- set_extent2.h5
- set_extent3.h5
- set_extent4.h5
- set_extent5.h5
- ext1.bin
- ext2.bin
+ set_extent*.h5
+ ext*.bin
getname.h5
- getname1.h5
- getname2.h5
- getname3.h5
+ getname*.h5
sec2_file.h5
direct_file.h5
family_file000*.h5
new_family_v16_000*.h5
- multi_file-r.h5
- multi_file-s.h5
+ multi_file-*.h5
core_file
- plugin.h5
- new_move_a.h5
- new_move_b.h5
+ filter_plugin.h5
+ new_move_*.h5
ntypes.h5
dangle.h5
error_test.h5
@@ -528,28 +351,22 @@ set (test_CLEANFILES
dtransform.h5
test_filters.h5
get_file_name.h5
- tstint1.h5
- tstint2.h5
+ tstint*.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
- efc0.h5
- efc1.h5
- efc2.h5
- efc3.h5
- efc4.h5
- efc5.h5
+ efc*.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
@@ -559,19 +376,18 @@ set (test_CLEANFILES
unregister_filter_2.h5
vds_virt.h5
vds_dapl.h5
- vds_src_0.h5
- vds_src_1.h5
+ vds_src_*.h5
swmr_data.h5
use_use_append_chunk.h5
use_append_mchunks.h5
use_disable_mdc_flushes.h5
- tbogus.h5.copy
flushrefresh.h5
flushrefresh_VERIFICATION_START
flushrefresh_VERIFICATION_CHECKPOINT1
flushrefresh_VERIFICATION_CHECKPOINT2
flushrefresh_VERIFICATION_DONE
filenotclosed.h5
+ del_many_dense_attrs.h5
atomic_data
accum_swmr_big.h5
ohdr_swmr.h5
@@ -580,177 +396,93 @@ set (test_CLEANFILES
cache_logging.out
vds_swmr.h5
vds_swmr_src_*.h5
+ swmr*.h5
+ swmr_writer.out
+ swmr_writer.log.*
+ swmr_reader.out.*
+ swmr_reader.log.*
+ tbogus.h5.copy
+ cache_image_test.h5
+ direct_chunk.h5
+ native_vol_test.h5
+ splitter*.h5
+ splitter.log
+ mirror_rw/*
+ mirror_wo/*
)
# 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_H5TEST)
-set (H5TEST_TESTS
- #testhdf5
- #cache
- cache_api
- cache_tagging
- lheap
- ohdr
- stab
- gheap
- evict_on_close
- farray
- earray
- btree2
- fheap
- pool
- accum
- #hyperslab
- istore
- bittests
- dt_arith
- dtypes
- dsets
- cmpd_dset
- filter_fail
- extend
- external
- efc
- objcopy
- links
- unlink
- twriteorder
- big
- mtime
- fillval
- mount
+set (H5TEST_SEPARATE_TESTS
+ testhdf5
+ cache
+ cache_image
+ external_env
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
- page_buffer
- vds
- file_image
- unregister
- cache_logging
- cork
- swmr
+ vds_env
)
-
-foreach (test ${H5TEST_TESTS})
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-${test} COMMAND $<TARGET_FILE:${test}>)
- set_tests_properties (H5TEST-${test} PROPERTIES
- DEPENDS H5TEST-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- )
- else ()
- if (${test} STREQUAL "big" AND CYGWIN)
- add_test (NAME H5TEST-${test}
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}"
+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 ${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"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
else ()
- add_test (NAME H5TEST-${test} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${test}.txt"
- #-D "TEST_REFERENCE=${test}.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ if ("${h5_test}" STREQUAL "big" AND CYGWIN)
+ add_test (NAME H5TEST-${h5_test}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}"
+ )
+ 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"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=${h5_test}.txt"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
+ #-D "TEST_REFERENCE=${test}.out"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ endif ()
+ set_tests_properties (H5TEST-${h5_test} PROPERTIES
+ FIXTURES_REQUIRED clear_H5TEST
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
endif ()
- set_tests_properties (H5TEST-${test} PROPERTIES
- DEPENDS H5TEST-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- )
endif ()
endforeach ()
-set_tests_properties (H5TEST-flush2 PROPERTIES DEPENDS H5TEST-flush1)
-set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800)
-set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800)
-set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT 1800)
-set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT 1800)
-
-if (BUILD_SHARED_LIBS)
- # Remove any output file left over from previous test run
- add_test (NAME H5TEST-shared-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${test_CLEANFILES}
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
-
- foreach (test ${H5TEST_TESTS})
- if (${test} STREQUAL "big" AND CYGWIN)
- add_test (NAME H5TEST-shared-${test}
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared"
- )
- else ()
- add_test (NAME H5TEST-shared-${test} COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=${test}.txt"
- #-D "TEST_REFERENCE=${test}.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (H5TEST-shared-${test} PROPERTIES
- DEPENDS H5TEST-shared-clear-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endforeach ()
-
- set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1)
- set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800)
- set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800)
- set_tests_properties (H5TEST-shared-btree2 PROPERTIES TIMEOUT 1800)
- set_tests_properties (H5TEST-shared-objcopy PROPERTIES TIMEOUT 1800)
-endif ()
-
-##############################################################################
-##############################################################################
-### A D D I T I O N A L T E S T S ###
-##############################################################################
-##############################################################################
+set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+set_tests_properties (H5TEST-big PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+set_tests_properties (H5TEST-btree2 PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
#-- 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-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"
@@ -762,281 +494,388 @@ if (NOT CYGWIN)
)
endif ()
set_tests_properties (H5TEST-cache PROPERTIES
- DEPENDS H5TEST-clear-cache-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3"
+ FIXTURES_REQUIRED clear_cache
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+endif ()
+
+if (TEST_CACHE_IMAGE)
+ #-- Adding test for cache_image
+ add_test (
+ 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-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 clear_cache_image
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
- set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 1800)
endif ()
-#-- Adding test for cache_image
+#-- Adding test for external_env
add_test (
- NAME H5TEST-clear-cache_image-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- cache_image_test.h5
+ NAME H5TEST-external_env-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ extern_1r.raw
+ extern_2r.raw
+ extern_3r.raw
+ extern_4r.raw
+ extern_1w.raw
+ extern_2w.raw
+ extern_3w.raw
+ extern_4w.raw
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
-add_test (NAME H5TEST-cache_image COMMAND $<TARGET_FILE:cache_image>)
-set_tests_properties (H5TEST-cache_image PROPERTIES
- DEPENDS H5TEST-clear-cache_image-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3"
+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 ${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"
+ -D "TEST_ENV_VALUE:STRING=\${ORIGIN}"
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=external_env.txt"
+ #-D "TEST_REFERENCE=external_env.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-external_env PROPERTIES
+ 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 filenotclosed
+#-- Adding test for vds_env
add_test (
- NAME H5TEST-clear-filenotclosed-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- filenotclosed.h5
+ NAME H5TEST-vds_env-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ vds_virt_0.h5
+ vds_virt_3.h5
+ vds_src_2.h5
WORKING_DIRECTORY
${HDF5_TEST_BINARY_DIR}/H5TEST
)
-add_test (NAME H5TEST-filenotclosed COMMAND $<TARGET_FILE:filenotclosed>)
-set_tests_properties (H5TEST-filenotclosed PROPERTIES
- DEPENDS H5TEST-clear-filenotclosed-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
+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 ${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_vds_env"
+ -D "TEST_EXPECT=0"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=vds_env.txt"
+ #-D "TEST_REFERENCE=vds_env.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+endif ()
+set_tests_properties (H5TEST-vds_env PROPERTIES
+ 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 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
- )
- add_test (NAME H5TEST-err_compat COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:err_compat>"
+#-- Adding test for flush1/2
+add_test (NAME H5TEST-flush-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ flush.h5
+ flush-swmr.h5
+ noflush.h5
+ noflush-swmr.h5
+ flush_extend.h5
+ flush_extend-swmr.h5
+ noflush_extend.h5
+ noflush_extend-swmr.h5
+ 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 ${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"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_OUTPUT=err_compat.txt"
- -D "TEST_REFERENCE=err_compat_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush1.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5TEST-err_compat PROPERTIES
- DEPENDS H5TEST-clear-err_compat-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+endif ()
+set_tests_properties (H5TEST-flush1 PROPERTIES
+ 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 ${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"
+ -D "TEST_SKIP_COMPARE=TRUE"
+ -D "TEST_OUTPUT=flush2.txt"
+ -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
+set_tests_properties (H5TEST-flush2 PROPERTIES
+ FIXTURES_REQUIRED clear_flush
+ DEPENDS H5TEST-flush1
+)
-#-- 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
+#-- Adding test for tcheck_version
+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-error_test COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:error_test>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_OUTPUT=error_test.txt"
- -D "TEST_REFERENCE=error_test_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+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"
)
-set_tests_properties (H5TEST-error_test PROPERTIES
- DEPENDS H5TEST-clear-error_test-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
+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"
)
-#-- 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
- extlinks_env0.h5
- extlinks_env1.h5
- tmp/extlinks_env1.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
-)
-add_test (NAME H5TEST-links_env COMMAND "${CMAKE_COMMAND}"
- -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_EXPECT=0"
- -D "TEST_OUTPUT=links_env.txt"
- -D "TEST_REFERENCE=links_env.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+##############################################################################
+##############################################################################
+### A D D I T I O N A L T E S T S ###
+##############################################################################
+##############################################################################
+# H5_CHECK_TESTS
+#---------------
+# error_test
+# err_compat
+# testmeta
+# atomic_writer
+# atomic_reader
+# links_env
+# filenotclosed
+# del_many_dense_attrs
+# flushrefresh
+##############################################################################
+# autotools script tests
+# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
+# NOT CONVERTED accum_swmr_reader is used by accum.c.
+# NOT CONVERTED atomic_writer and atomic_reader are standalone programs.
+# links_env is used by testlinks_env.sh
+# filenotclosed and del_many_dense_attrs are used by testabort_fail.sh
+# NOT CONVERTED flushrefresh is used by testflushrefresh.sh.
+# NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh
+# NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh.
+# NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh
+# NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG.
+# NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly,
+# NOT CONVERTED and this lets automake keep all its test programs in one place.
+##############################################################################
+
+#-- Adding test for filenotclosed
+add_test (
+ NAME H5TEST-filenotclosed-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove filenotclosed.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-set_tests_properties (H5TEST-links_env PROPERTIES
- DEPENDS H5TEST-clear-links_env-objects
+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 clear_filenotclosed
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-#-- Adding test for libinfo
-add_test (NAME H5TEST-testlibinfo
- COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}"
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST
+#-- Adding test for del_many_dense_attrs
+add_test (
+ 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-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 clear_del_many_dense_attrs
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
-if (BUILD_SHARED_LIBS)
- #-- Adding test for cache
- if (NOT CYGWIN AND NOT WIN32)
- add_test (NAME H5TEST-shared-clear-cache-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- cache_test.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>)
- else ()
- add_test (NAME H5TEST-shared-cache COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:cache-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_SKIP_COMPARE=TRUE"
- -D "TEST_OUTPUT=cache-shared.txt"
- #-D "TEST_REFERENCE=cache-shared.out"
- -D "TEST_FOLDER=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- endif ()
- set_tests_properties (H5TEST-shared-cache PROPERTIES
- DEPENDS H5TEST-shared-clear-cache-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- set_tests_properties (H5TEST-shared-cache PROPERTIES TIMEOUT 1800)
- endif ()
-
- #-- Adding test for err_compat
- if (HDF5_ENABLE_DEPRECATED_SYMBOLS)
- add_test (NAME H5TEST-shared-clear-err_compat-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- err_compat.txt
- err_compat.txt.err
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- add_test (NAME H5TEST-shared-err_compat COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:err_compat-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_EXPECT=0"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_OUTPUT=err_compat.txt"
- -D "TEST_REFERENCE=err_compat_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5TEST-shared-err_compat PROPERTIES
- DEPENDS H5TEST-shared-clear-err_compat-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- endif ()
+#-- Adding test for err_compat
+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"
+ -D "TEST_MASK_ERROR=true"
+ -D "ERROR_APPEND=1"
+ -D "TEST_OUTPUT=err_compat.txt"
+ -D "TEST_REFERENCE=err_compat_1"
+ -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
+ )
+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-shared-clear-error_test-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- error_test.txt
- error_test.txt.err
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
+#-- Adding test for 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"
)
- add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>"
+ set_tests_properties (H5TEST-error_test PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+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"
-D "TEST_MASK_ERROR=true"
+ -D "ERROR_APPEND=1"
-D "TEST_OUTPUT=error_test.txt"
-D "TEST_REFERENCE=error_test_1"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5TEST-shared-error_test PROPERTIES
- DEPENDS H5TEST-shared-clear-error_test-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
+ set_tests_properties (H5TEST-error_test PROPERTIES
+ 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-shared-clear-links_env-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- links_env.txt
- links_env.txt.err
- extlinks_env0.h5
- extlinks_env1.h5
- tmp/extlinks_env1.h5
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
- add_test (NAME H5TEST-shared-links_env COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:links_env-shared>"
+#-- Adding test for links_env
+add_test (NAME H5TEST-links_env-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ extlinks_env0.h5
+ extlinks_env1.h5
+ tmp_links_env/extlinks_env1.h5
+ WORKING_DIRECTORY
+ ${HDF5_TEST_BINARY_DIR}/H5TEST
+)
+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 ${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_VAR:STRING=HDF5_EXT_PREFIX"
+ #-D "TEST_ENV_VALUE:STRING=.:tmp_links_env"
-D "TEST_EXPECT=0"
-D "TEST_OUTPUT=links_env.txt"
-D "TEST_REFERENCE=links_env.out"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5TEST-shared-links_env PROPERTIES
- DEPENDS H5TEST-shared-clear-links_env-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
- )
+endif ()
+set_tests_properties (H5TEST-links_env PROPERTIES
+ 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
+)
+if (NOT BUILD_SHARED_LIBS)
+ #-- Adding test for libinfo
+ add_test (NAME H5TEST-testlibinfo
+ COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIB_TARGET}>" -P "${GREP_RUNNER}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+else ()
#-- Adding test for libinfo
- add_test (NAME H5TEST-shared-testlibinfo
+ add_test (NAME H5TEST-testlibinfo
COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIBSH_TARGET}>" -P "${GREP_RUNNER}"
- WORKING_DIRECTORY
- ${HDF5_TEST_BINARY_DIR}/H5TEST-shared
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
endif ()
##############################################################################
-### P L U G I N T E S T S
+### F I L T E R P L U G I N T E S T S
##############################################################################
-if (WIN32)
- set (CMAKE_SEP "\;")
- set (BIN_REL_PATH "../../")
-else ()
- set (CMAKE_SEP ":")
- set (BIN_REL_PATH "../")
-endif ()
+if (BUILD_SHARED_LIBS)
+ if (WIN32 OR MINGW)
+ set (CMAKE_SEP "\;")
+ set (BIN_REL_PATH "../../")
+ else ()
+ set (CMAKE_SEP ":")
+ set (BIN_REL_PATH "../")
+ endif ()
-add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>)
-set_tests_properties (H5PLUGIN-plugin PROPERTIES
- ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2;srcdir=${HDF5_TEST_BINARY_DIR}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}
-)
+ 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}
+ )
##############################################################################
# HDFFV-9655 relative plugin test disabled
#
-#add_test (NAME H5PLUGIN-pluginRelative COMMAND $<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}
-#)
+# 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}
+# )
##############################################################################
+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
##############################################################################
@@ -1045,6 +884,42 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES
# testswmr.sh: swmr*
# testvdsswmr.sh: vds_swmr*
+# 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-testflushrefresh-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
+ )
+ 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"
+ -D "TEST_ERR:STRING=flushrefresh_ERROR"
+ -D "TEST_EXPECT=0"
+ -D "TEST_OUTPUT=flushrefresh.out"
+ -D "TEST_REFERENCE=flushrefresh.txt"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test"
+ -D "PERL_SCRIPT=${HDF5_SOURCE_DIR}/bin/runbkgprog"
+ -D "PERL_EXECUTABLE=${PERL_EXECUTABLE}"
+ -P "${HDF5_TEST_SOURCE_DIR}/flushrefreshTest.cmake"
+ )
+ set_tests_properties (H5TEST-testflushrefresh PROPERTIES
+ FIXTURES_REQUIRED clear_testflushrefresh
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test
+ )
+ endif ()
+else ()
+ message (STATUS "Cannot execute TEST flushrefresh - perl not found")
+endif ()
+
##############################################################################
##############################################################################
### V F D T E S T S ###
@@ -1052,272 +927,36 @@ set_tests_properties (H5PLUGIN-plugin PROPERTIES
##############################################################################
if (HDF5_TEST_VFD)
+ include (CMakeVFDTests.cmake)
+endif ()
- set (H5_VFD_TESTS
- testhdf5
-# cache
- cache_api
- cache_tagging
- lheap
- ohdr
- stab
- gheap
- evict_on_close
- pool
-# accum
- farray
- earray
- btree2
-# fheap
- hyperslab
- istore
- bittests
- dt_arith
- dtypes
- dsets
- cmpd_dset
- filter_fail
- extend
- external
- efc
- objcopy
- links
- unlink
-# big
- mtime
- fillval
- mount
- flush1
- flush2
- app_ref
- enum
- set_extent
- ttsafe
- getname
-# vfd
- ntypes
- dangle
- dtransform
- reserved
- cross_read
- freespace
- mf
-# error_test
-# err_compat
- #tcheck_version
-# testmeta
-# links_env
- unregister
- )
- if (NOT CYGWIN)
- set (H5_VFD_TESTS ${H5_VFD_TESTS} big cache)
- endif ()
-
- # Windows only macro
- macro (CHECK_VFD_TEST vfdtest vfdname resultcode)
- if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2")
- if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split")
- if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
- add_test (NAME VFD-${vfdname}-${vfdtest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
- if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
- else ()
- add_test (NAME VFD-${vfdname}-${vfdtest}
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}"
- )
- if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared"
- )
- endif ()
- endif ()
- else ()
- add_test (NAME VFD-${vfdname}-${vfdtest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
- if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
- endif ()
- else ()
- add_test (NAME VFD-${vfdname}-${vfdtest}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
- if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache")
- add_test (NAME VFD-${vfdname}-${vfdtest}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
- endif ()
- endmacro ()
+##############################################################################
+##############################################################################
+### V O L T E S T S ###
+##############################################################################
+##############################################################################
- macro (ADD_VFD_TEST vfdname resultcode)
- foreach (test ${H5_VFD_TESTS})
- if (WIN32)
- CHECK_VFD_TEST (${test} ${vfdname} ${resultcode})
- else ()
- add_test (NAME VFD-${vfdname}-${test}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${test}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${test} PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
- if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-${test}-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-${test}-shared"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
- endif ()
- endforeach ()
- set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1)
- set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1800)
- if (NOT CYGWIN)
- set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT 1800)
- endif ()
- if (BUILD_SHARED_LIBS)
- set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared)
- set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10)
- set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1800)
- if (NOT CYGWIN AND NOT WIN32)
- set_tests_properties (VFD-${vfdname}-cache-shared PROPERTIES TIMEOUT 1800)
- endif ()
- endif ()
- if (HDF5_TEST_FHEAP_VFD)
- add_test (NAME VFD-${vfdname}-fheap
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:fheap>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-fheap"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-fheap PROPERTIES
- TIMEOUT 1800
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
- )
- if (BUILD_SHARED_LIBS)
- add_test (NAME VFD-${vfdname}-fheap-shared
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:fheap-shared>"
- -D "TEST_ARGS:STRING="
- -D "TEST_VFD:STRING=${vfdname}"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_OUTPUT=${vfdname}-fheap-shared"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared"
- -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES
- TIMEOUT 1800
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}"
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared
- )
- endif ()
- endif ()
- endmacro ()
+##############################################################################
+### V O L P L U G I N T E S T S
+##############################################################################
+if (BUILD_SHARED_LIBS)
+ if (WIN32 OR MINGW)
+ set (CMAKE_SEP "\;")
+ set (BIN_REL_PATH "../../")
+ else ()
+ set (CMAKE_SEP ":")
+ set (BIN_REL_PATH "../")
+ endif ()
- # Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
- endforeach ()
+ 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}
+ )
+endif ()
+if (HDF5_TEST_PASSTHROUGH_VOL)
+ include (CMakePassthroughVOLTests.cmake)
endif ()
##############################################################################
@@ -1326,12 +965,12 @@ endif ()
##############################################################################
##############################################################################
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
macro (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c)
- TARGET_NAMING (${genfile} STATIC)
- TARGET_C_PROPERTIES (${genfile} STATIC " " " ")
- target_link_libraries (${genfile} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${genfile} STATIC)
+ target_link_libraries (${genfile} PRIVATE ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (${genfile} PROPERTIES FOLDER generator/test)
endmacro ()
@@ -1340,6 +979,7 @@ if (HDF5_BUILD_GENERATORS)
gen_bad_offset
gen_bad_ohdr
gen_bogus
+ gen_bounds
gen_cross
gen_deflate
gen_filters
@@ -1359,8 +999,8 @@ if (HDF5_BUILD_GENERATORS)
gen_plist
)
- foreach (gen ${H5_GENERATORS})
- ADD_H5_GENERATOR (${gen})
+ foreach (h5_gen ${H5_GENERATORS})
+ ADD_H5_GENERATOR (${h5_gen})
endforeach ()
endif ()
diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake
new file mode 100644
index 0000000..d4a5ddc
--- /dev/null
+++ b/test/CMakeVFDTests.cmake
@@ -0,0 +1,210 @@
+
+# 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.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+# included from CMakeTests.cmake
+
+set (VFD_LIST
+ sec2
+ stdio
+ core
+ core_paged
+ split
+ multi
+ family
+)
+if (DIRECT_VFD)
+ set (VFD_LIST ${VFD_LIST} direct)
+endif ()
+
+foreach (vfdtest ${VFD_LIST})
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles")
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files")
+endforeach ()
+
+foreach (vfdtest ${VFD_LIST})
+ foreach (h5_tfile ${HDF5_TEST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}" "HDF5_VFDTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+foreach (vfdtest ${VFD_LIST})
+ foreach (ref_file ${HDF5_REFERENCE_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}" "HDF5_VFDTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+foreach (vfdtest ${VFD_LIST})
+ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}" "HDF5_VFDTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+foreach (vfdtest ${VFD_LIST})
+ foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/${plistfile}" "HDF5_VFDTEST_LIB_files")
+ HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files/def_${plistfile}" "HDF5_VFDTEST_LIB_files")
+ endforeach ()
+endforeach ()
+
+add_custom_target(HDF5_VFDTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VFDTEST_LIB tests" DEPENDS ${HDF5_VFDTEST_LIB_files_list})
+
+##############################################################################
+##############################################################################
+### V F D T E S T S ###
+##############################################################################
+##############################################################################
+
+ set (H5_VFD_SKIP_TESTS
+ cache
+ cache_image
+ accum
+ fheap
+ big
+ vfd
+ error_test
+ err_compat
+ tcheck_version
+ testmeta
+ links_env
+ external_env
+ vds_env
+ )
+ if (NOT CYGWIN)
+ list (REMOVE_ITEM H5_VFD_SKIP_TESTS big cache)
+ endif ()
+
+ # Windows only macro
+ macro (CHECK_VFD_TEST vfdtest vfdname resultcode)
+ if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2")
+ if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split")
+ if (NOT BUILD_SHARED_LIBS AND NOT HDF_CFG_NAME MATCHES "Debug")
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
+ else ()
+ add_test (NAME VFD-${vfdname}-${vfdtest}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}"
+ )
+ endif ()
+ else ()
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
+ endif ()
+ else ()
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
+ endif ()
+ endmacro ()
+
+ macro (DO_VFD_TEST vfdtest vfdname resultcode)
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-${vfdtest}.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-${vfdtest} PROPERTIES
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
+ endmacro ()
+
+ macro (ADD_VFD_TEST vfdname resultcode)
+ foreach (h5_test ${H5_TESTS})
+ if (NOT h5_test IN_LIST H5_VFD_SKIP_TESTS)
+ if (WIN32)
+ CHECK_VFD_TEST (${h5_test} ${vfdname} ${resultcode})
+ else ()
+ DO_VFD_TEST (${h5_test} ${vfdname} ${resultcode})
+ endif ()
+ endif ()
+ endforeach ()
+ set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1)
+ set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10)
+ set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10)
+ set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+ if (NOT CYGWIN)
+ set_tests_properties (VFD-${vfdname}-cache PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT})
+ endif ()
+ if (HDF5_TEST_FHEAP_VFD)
+ 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}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-fheap.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (VFD-${vfdname}-fheap PROPERTIES
+ TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
+ )
+ endif ()
+ endmacro ()
+
+ # Run test with different Virtual File Driver
+ foreach (h5_vfd ${VFD_LIST})
+ ADD_VFD_TEST (${h5_vfd} 0)
+ endforeach ()
diff --git a/test/H5srcdir.h b/test/H5srcdir.h
index 32fe8c9..b02d432 100644
--- a/test/H5srcdir.h
+++ b/test/H5srcdir.h
@@ -21,50 +21,19 @@
#define _H5SRCDIR_H
/* Include the header file with the correct relative path for the srcdir string */
-#include "H5srcdir_str.h"
-
-/* Buffer to construct path in and return pointer to */
-static char srcdir_path[1024] = "";
-
-/* Buffer to construct file in and return pointer to */
-static char srcdir_testpath[1024] = "";
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Just return the srcdir path */
-static const char *
-H5_get_srcdir(void)
-{
- const char *srcdir = HDgetenv("srcdir");
-
- /* Check for using the srcdir from configure time */
- if(NULL == srcdir)
- srcdir = config_srcdir;
-
- /* Build path to all test files */
- if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
- HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir);
- return(srcdir_path);
- } /* end if */
- else
- return(NULL);
-} /* end H5_get_srcdir() */
+H5TEST_DLL const char *H5_get_srcdir(void);
/* Append the test file name to the srcdir path and return the whole string */
-static const char *H5_get_srcdir_filename(const char *filename)
-{
- const char *srcdir = H5_get_srcdir();
+H5TEST_DLL const char *H5_get_srcdir_filename(const char *filename);
+
+#ifdef __cplusplus
+}
+#endif
- /* Check for error */
- if(NULL == srcdir)
- return(NULL);
- else {
- /* Build path to test file */
- if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
- HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
- return(srcdir_testpath);
- } /* end if */
- else
- return(NULL);
- } /* end else */
-} /* end H5_get_srcdir_filename() */
#endif /* _H5SRCDIR_H */
diff --git a/test/Makefile.am b/test/Makefile.am
index 610c619..e6ce954 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -26,22 +26,28 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src
# testlibinfo.sh:
# testcheck_version.sh: tcheck_version
# testlinks_env.sh: links_env
-# test_filenotclosed.sh: filenotclosed.c
+# testexternal_env.sh: external_env
# testflushrefresh.sh: flushrefresh
-# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
+# testvds_env.sh: vds_env
# testswmr.sh: swmr*
# testvdsswmr.sh: vds_swmr*
-TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filenotclosed.sh\
- testswmr.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh
-SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) test_filenotclosed$(EXEEXT) \
+# testabort_fail.sh: filenotclosed.c and del_many_dense_attrs.c
+# test_filter_plugin.sh: filter_plugin.c
+# test_mirror.sh: mirror_vfd ../utils/mirror_vfd/*
+# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
+TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh testexternal_env.sh \
+ testswmr.sh testvds_env.sh testvdsswmr.sh testflushrefresh.sh test_usecases.sh testabort_fail.sh \
+ test_mirror.sh
+SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \
+ external_env$(EXEEXT) filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \
flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \
swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \
swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \
swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \
- vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT)
+ vds_env$(EXEEXT) vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT)
if HAVE_SHARED_CONDITIONAL
- TEST_SCRIPT += test_plugin.sh
- SCRIPT_DEPEND += plugin$(EXEEXT)
+ TEST_SCRIPT += test_filter_plugin.sh test_vol_plugin.sh
+ SCRIPT_DEPEND += filter_plugin$(EXEEXT) vol_plugin$(EXEEXT)
endif
check_SCRIPTS = $(TEST_SCRIPT)
@@ -51,15 +57,15 @@ check_SCRIPTS = $(TEST_SCRIPT)
# As an exception, long-running tests should occur earlier in the list.
# This gives them more time to run when tests are executing in parallel.
TEST_PROG= testhdf5 \
- cache cache_api cache_image cache_tagging lheap ohdr stab gheap \
- evict_on_close farray earray btree2 fheap \
+ 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 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 \
- timer
+ dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \
+ external efc objcopy objcopy_ref 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 ros3 s3comms hdfs ntypes \
+ dangle dtransform reserved cross_read freespace mf vds file_image \
+ unregister cache_logging cork swmr thread_id vol timer
# 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.
@@ -67,22 +73,27 @@ TEST_PROG= testhdf5 \
# accum_swmr_reader is used by accum.c.
# atomic_writer and atomic_reader are standalone programs.
# links_env is used by testlinks_env.sh
-# filenotclosed is used by test_filenotclosed.sh
+# external_env is used by testexternal_env.sh
+# filenotclosed and del_many_dense_attrs are used by testabort_fail.sh
# flushrefresh is used by testflushrefresh.sh.
# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh
# swmr_* files (besides swmr.c) are used by testswmr.sh.
# vds_swmr_* files are used by testvdsswmr.sh
+# vds_env is used by testvds_env.sh
+# mirror_vfd is used by test_mirror.sh
# 'make check' doesn't run them directly, so they are not included in TEST_PROG.
# Also build testmeta, which is used for timings test. It builds quickly,
# and this lets automake keep all its test programs in one place.
check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \
- testmeta accum_swmr_reader atomic_writer atomic_reader \
- links_env filenotclosed flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \
+ testmeta accum_swmr_reader atomic_writer atomic_reader external_env \
+ links_env filenotclosed del_many_dense_attrs flushrefresh \
+ use_append_chunk use_append_chunk_mirror use_append_mchunks use_disable_mdc_flushes \
swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \
swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \
- swmr_check_compat_vfd vds_swmr_gen vds_swmr_reader vds_swmr_writer
+ swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \
+ mirror_vfd
if HAVE_SHARED_CONDITIONAL
- check_PROGRAMS+= plugin
+ check_PROGRAMS+= filter_plugin vol_plugin
endif
# These programs generate test files for the tests. They don't need to be
@@ -95,45 +106,40 @@ endif
BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \
- gen_sizes_lheap gen_file_image gen_plist gen_bad_offset
+ gen_sizes_lheap gen_file_image gen_plist gen_bad_offset gen_bounds
if BUILD_ALL_CONDITIONAL
noinst_PROGRAMS=$(BUILD_ALL_PROGS)
endif
-# The libh5test library provides common support code for the tests.
-noinst_LTLIBRARIES=libh5test.la
-
if HAVE_SHARED_CONDITIONAL
- # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c.
- # Build it as shared library if configure is enabled for shared library.
- dyn_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la
- libdynlib1_la_SOURCES=dynlib1.c
- libdynlib2_la_SOURCES=dynlib2.c
- libdynlib3_la_SOURCES=dynlib3.c
- libdynlib4_la_SOURCES=dynlib4.c
- libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
- libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
- libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
- libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
-
-libdynlib1.la: $(libdynlib1_la_OBJECTS) $(libdynlib1_la_DEPENDENCIES) $(EXTRA_libdynlib1_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlib1_la_LINK) $(am_libdynlib1_la_rpath) $(libdynlib1_la_OBJECTS) $(libdynlib1_la_LIBADD)
-
-libdynlib2.la: $(libdynlib2_la_OBJECTS) $(libdynlib2_la_DEPENDENCIES) $(EXTRA_libdynlib2_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlib2_la_LINK) $(am_libdynlib2_la_rpath) $(libdynlib2_la_OBJECTS) $(libdynlib2_la_LIBADD)
-
-libdynlib3.la: $(libdynlib3_la_OBJECTS) $(libdynlib3_la_DEPENDENCIES) $(EXTRA_libdynlib3_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlib3_la_LINK) $(am_libdynlib3_la_rpath) $(libdynlib3_la_OBJECTS) $(libdynlib3_la_LIBADD)
-
-libdynlib4.la: $(libdynlib4_la_OBJECTS) $(libdynlib4_la_DEPENDENCIES) $(EXTRA_libdynlib4_la_DEPENDENCIES)
- $(AM_V_CCLD)$(libdynlib4_la_LINK) $(am_libdynlib4_la_rpath) $(libdynlib4_la_OBJECTS) $(libdynlib4_la_LIBADD)
-
-#install-exec-hook:
-# $(RM) $(DESTDIR)$(dyndir)/*dynlib*
+ # The libh5test library provides common support code for the tests.
+ # The filter_plugin* libraries are for use in filter_plugin.c.
+ # Build them as shared libraries if that option was enabled in configure.
+ noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la libnull_vol_connector.la
+ libfilter_plugin1_dsets_la_SOURCES=filter_plugin1_dsets.c
+ libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c
+ libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c
+ libfilter_plugin4_groups_la_SOURCES=filter_plugin4_groups.c
+ libfilter_plugin1_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libfilter_plugin2_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libfilter_plugin3_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libfilter_plugin4_groups_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libfilter_plugin3_dsets_la_LIBADD=$(LIBHDF5)
+ libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5)
+
+ # VOL plugin test libraries
+ #
+ # null_vol_connector is used for testing basic VOL plugin functionality.
+ libnull_vol_connector_la_SOURCES=null_vol_connector.c
+ libnull_vol_connector_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+
+else
+ # The libh5test library provides common support code for the tests.
+ noinst_LTLIBRARIES=libh5test.la
endif
-libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c
+libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c
# Use libhd5test.la to compile all of the tests
LDADD=libh5test.la $(LIBHDF5)
@@ -142,12 +148,18 @@ LDADD=libh5test.la $(LIBHDF5)
ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \
ttsafe_acreate.c
cache_image_SOURCES=cache_image.c genall5.c
+mirror_vfd_SOURCES=mirror_vfd.c genall5.c
VFD_LIST = sec2 stdio core core_paged split multi family
if DIRECT_VFD_CONDITIONAL
VFD_LIST += direct
endif
+# Test with just the native connector, with a single pass-through connector
+# and with a doubly-stacked pass-through.
+VOL_LIST = native "pass_through under_vol=0;under_info={}" \
+ "pass_through under_vol=505;under_info={under_vol=0;under_info={}}"
+
# Additional target for running timing test
timings _timings: testmeta
@for timing in $(TIMINGS) dummy; do \
@@ -172,53 +184,60 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse
chunk_fixed.h5 copy_dcpl_newfile.h5 partial_chunks.h5 layout_extend.h5 \
zero_chunk.h5 chunk_single.h5 swmr_non_latest.h5 \
earray_hdr_fd.h5 farray_hdr_fd.h5 bt2_hdr_fd.h5 \
- storage_size.h5 dls_01_strings.h5 \
+ storage_size.h5 dls_01_strings.h5 power2up.h5 version_bounds.h5 \
+ alloc_0sized.h5 \
extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \
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 \
- dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \
- big.data big[0-9][0-9][0-9][0-9][0-9].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 tmp_links tmp2_links tmp_links_env tmp_vds 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 \
fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \
- trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 twriteorder.dat \
+ trefer[1-3].h5 trefer_*.h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 twriteorder.dat \
flush.h5 flush-swmr.h5 noflush.h5 noflush-swmr.h5 flush_extend.h5 \
flush_extend-swmr.h5 noflush_extend.h5 noflush_extend-swmr.h5 \
enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \
tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin \
getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \
family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \
- multi_file-[rs].h5 core_file plugin.h5 \
+ multi_file-[rs].h5 core_file filter_plugin.h5 \
new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \
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 \
+ objcopy_ext.dat app_ref.h5 farray.h5 farray_tmp.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 \
- swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_disable_mdc_flushes.h5 \
- flushrefresh.h5 flushrefresh_VERIFICATION_START \
+ swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 \
+ use_disable_mdc_flushes.h5 flushrefresh.h5 flushrefresh_VERIFICATION_START \
flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \
- flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \
+ flushrefresh_VERIFICATION_DONE filenotclosed.h5 del_many_dense_attrs.h5 \
+ atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \
test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \
swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \
- tbogus.h5.copy cache_image_test.h5
+ tbogus.h5.copy cache_image_test.h5 direct_chunk.h5 native_vol_test.h5 \
+ splitter*.h5 splitter.log mirror_rw mirror_ro
# Sources for testhdf5 executable
testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \
tgenprop.c th5o.c th5s.c tcoords.c theap.c tid.c titerate.c tmeta.c tmisc.c \
- trefer.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \
+ trefer.c trefer_deprec.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c ttst.c tunicode.c \
tvlstr.c tvltypes.c
# Sources for Use Cases
use_append_chunk_SOURCES=use_append_chunk.c use_common.c
+use_append_chunk_mirror_SOURCES=use_append_chunk_mirror.c use_common.c
use_append_mchunks_SOURCES=use_append_mchunks.c use_common.c
use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c
# Temporary files.
-DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh \
- testswmr.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh test_filenotclosed.sh
+DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \
+ testexternal_env.sh testswmr.sh testvds_env.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh \
+ testabort_fail.sh test_vol_plugin.sh test_mirror.sh
include $(top_srcdir)/config/conclude.am
diff --git a/test/SWMR_UseCase_UG.txt b/test/SWMR_UseCase_UG.txt
index e29944a..18d4927 100644
--- a/test/SWMR_UseCase_UG.txt
+++ b/test/SWMR_UseCase_UG.txt
@@ -11,7 +11,7 @@
%%%%Use Case 1.7%%%%
-
+
3. Use Case [1.7]:
Appending a single chunk
diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake
new file mode 100644
index 0000000..98f3daf
--- /dev/null
+++ b/test/ShellTests.cmake
@@ -0,0 +1,217 @@
+
+# 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.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G S H E L L S C R I P T S ###
+##############################################################################
+
+if (UNIX)
+
+ find_program (SH_PROGRAM sh)
+ if (SH_PROGRAM)
+
+ ##############################################################################
+ # configure scripts to test dir
+ ##############################################################################
+ find_package (Perl)
+ if (PERL_FOUND)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY)
+ endif ()
+ configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh @ONLY)
+ configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh @ONLY)
+
+ ##############################################################################
+ # copy test programs to test dir
+ ##############################################################################
+ add_custom_command (
+ TARGET swmr_check_compat_vfd
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_check_compat_vfd>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_check_compat_vfd"
+ )
+
+ add_custom_command (
+ TARGET swmr_check_compat_vfd
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh"
+ )
+
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
+ add_custom_command (
+ TARGET flushrefresh
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:flushrefresh>" "${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh"
+ )
+
+ #shell script creates dir
+ #file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/usecases_test")
+ add_custom_command (
+ TARGET use_append_mchunks
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:use_append_mchunks>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_append_mchunks"
+ )
+ add_custom_command (
+ TARGET use_disable_mdc_flushes
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:use_disable_mdc_flushes>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_disable_mdc_flushes"
+ )
+ add_custom_command (
+ TARGET twriteorder
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:twriteorder>" "${HDF5_TEST_BINARY_DIR}/H5TEST/twriteorder"
+ )
+ add_custom_command (
+ TARGET use_append_chunk
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:use_append_chunk>" "${HDF5_TEST_BINARY_DIR}/H5TEST/use_append_chunk"
+ )
+
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/swmr_test")
+ add_custom_command (
+ TARGET swmr_generator
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_generator>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_generator"
+ )
+ add_custom_command (
+ TARGET swmr_start_write
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_start_write>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_start_write"
+ )
+ add_custom_command (
+ TARGET swmr_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_reader"
+ )
+ add_custom_command (
+ TARGET swmr_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_writer"
+ )
+ add_custom_command (
+ TARGET swmr_remove_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_remove_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_remove_reader"
+ )
+ add_custom_command (
+ TARGET swmr_remove_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_remove_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_remove_writer"
+ )
+ add_custom_command (
+ TARGET swmr_addrem_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_addrem_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_addrem_writer"
+ )
+ add_custom_command (
+ TARGET swmr_sparse_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_sparse_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_sparse_reader"
+ )
+ add_custom_command (
+ TARGET swmr_sparse_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:swmr_sparse_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/swmr_test/swmr_sparse_writer"
+ )
+
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/vds_swmr_test")
+ add_custom_command (
+ TARGET vds_swmr_gen
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_gen>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_gen"
+ )
+ add_custom_command (
+ TARGET vds_swmr_writer
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_writer>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_writer"
+ )
+ add_custom_command (
+ TARGET vds_swmr_reader
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different "$<TARGET_FILE:vds_swmr_reader>" "${HDF5_TEST_BINARY_DIR}/H5TEST/vds_swmr_reader"
+ )
+
+
+
+ ##############################################################################
+ ##############################################################################
+ ### A D D I T I O N A L T E S T S ###
+ ##############################################################################
+ ##############################################################################
+ # H5_CHECK_TESTS
+ #---------------
+ # atomic_writer
+ # atomic_reader
+ # filenotclosed
+ # del_many_dense_attrs
+ # flushrefresh
+ ##############################################################################
+ # autotools script tests
+ # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
+ # NOT CONVERTED accum_swmr_reader is used by accum.c.
+ # NOT CONVERTED atomic_writer and atomic_reader are standalone programs.
+ # links_env is used by testlinks_env.sh
+ # filenotclosed and del_many_dense_attrs are used by testabort_fail.sh
+ # NOT CONVERTED flushrefresh is used by testflushrefresh.sh.
+ # NOT CONVERTED use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh
+ # NOT CONVERTED swmr_* files (besides swmr.c) are used by testswmr.sh.
+ # NOT CONVERTED vds_swmr_* files are used by testvdsswmr.sh
+ # NOT CONVERTED 'make check' doesn't run them directly, so they are not included in TEST_PROG.
+ # NOT CONVERTED Also build testmeta, which is used for timings test. It builds quickly,
+ # NOT CONVERTED and this lets automake keep all its test programs in one place.
+ ##############################################################################
+
+ ##############################################################################
+ ### S W M R T E S T S
+ ##############################################################################
+ # testflushrefresh.sh: flushrefresh
+ # test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes
+ # testswmr.sh: swmr*
+ # testvdsswmr.sh: vds_swmr*
+ add_test (H5SHELL-testflushrefresh ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh)
+ set_tests_properties (H5SHELL-testflushrefresh PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-test_usecases ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh)
+ set_tests_properties (H5SHELL-test_usecases PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-testswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh)
+ set_tests_properties (H5SHELL-testswmr PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+ add_test (H5SHELL-testvdsswmr ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh)
+ set_tests_properties (H5SHELL-testvdsswmr PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ )
+
+ endif ()
+endif ()
diff --git a/test/accum.c b/test/accum.c
index d76c866..548a04d 100644
--- a/test/accum.c
+++ b/test/accum.c
@@ -20,13 +20,19 @@
#define H5FD_TESTING
#include "H5Fpkg.h"
#include "H5FDpkg.h"
+
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Filename */
-#define FILENAME "accum.h5"
+/* (The file names are the same as the define in accum_swmr_reader.c) */
+const char *FILENAME[] = {
+ "accum",
+ "accum_swmr_big",
+ NULL
+};
-/* The file name is the same as the define in accum_swmr_reader.c */
-#define SWMR_FILENAME "accum_swmr_big.h5"
/* The reader forked by test_swmr_write_big() */
#define SWMR_READER "accum_swmr_reader"
@@ -39,33 +45,30 @@
#define RAND_SEG_LEN (1024)
#define RANDOM_BASE_OFF (1024 * 1024)
-/* Make file global to all tests */
-H5F_t * f = NULL;
-
/* Function Prototypes */
-unsigned test_write_read(const H5F_io_info2_t *fio_info);
-unsigned test_write_read_nonacc_front(const H5F_io_info2_t *fio_info);
-unsigned test_write_read_nonacc_end(const H5F_io_info2_t *fio_info);
-unsigned test_accum_overlap(const H5F_io_info2_t *fio_info);
-unsigned test_accum_overlap_clean(const H5F_io_info2_t *fio_info);
-unsigned test_accum_overlap_size(const H5F_io_info2_t *fio_info);
-unsigned test_accum_non_overlap_size(const H5F_io_info2_t *fio_info);
-unsigned test_accum_adjust(const H5F_io_info2_t *fio_info);
-unsigned test_read_after(const H5F_io_info2_t *fio_info);
-unsigned test_free(const H5F_io_info2_t *fio_info);
-unsigned test_big(const H5F_io_info2_t *fio_info);
-unsigned test_random_write(const H5F_io_info2_t *fio_info);
+unsigned test_write_read(H5F_t *f);
+unsigned test_write_read_nonacc_front(H5F_t *f);
+unsigned test_write_read_nonacc_end(H5F_t *f);
+unsigned test_accum_overlap(H5F_t *f);
+unsigned test_accum_overlap_clean(H5F_t *f);
+unsigned test_accum_overlap_size(H5F_t *f);
+unsigned test_accum_non_overlap_size(H5F_t *f);
+unsigned test_accum_adjust(H5F_t *f);
+unsigned test_read_after(H5F_t *f);
+unsigned test_free(H5F_t *f);
+unsigned test_big(H5F_t *f);
+unsigned test_random_write(H5F_t *f);
unsigned test_swmr_write_big(hbool_t newest_format);
/* Helper Function Prototypes */
-void accum_printf(void);
+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), H5AC_ind_read_dxpl_id, (b))
-#define accum_read(a,s,b) H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)(a), (size_t)(s), H5AC_ind_read_dxpl_id, (b))
-#define accum_free(fio_info,a,s) H5F__accum_free(fio_info, H5FD_MEM_DEFAULT, (haddr_t)(a), (hsize_t)(s))
-#define accum_flush(fio_info) H5F__accum_flush(fio_info)
-#define accum_reset(fio_info) H5F__accum_reset(fio_info, TRUE)
+#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->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 */
@@ -74,12 +77,12 @@ void accum_printf(void);
/*-------------------------------------------------------------------------
* Function: main
- *
+ *
* Purpose: Test the metadata accumulator code
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Mike McGreevy
* October 7, 2010
*
@@ -88,48 +91,60 @@ void accum_printf(void);
int
main(void)
{
- H5F_io_info2_t fio_info; /* I/O info for operation */
unsigned nerrors = 0; /* track errors */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
hid_t fid = -1;
+ hid_t fapl = -1; /* File access property list */
+ char filename[1024];
+ H5F_t * f = NULL; /* File for all tests */
+
/* Test Setup */
- puts("Testing the metadata accumulator");
+ HDputs("Testing the metadata accumulator");
+
+ /* File access property list */
+ h5_reset();
+ if((fapl = h5_fileaccess()) < 0)
+ FAIL_STACK_ERROR
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Create a test file */
- if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
/* Get H5F_t * to internal file structure */
- if(NULL == (f = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR
+ if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR
/* We'll be writing lots of garbage data, so extend the
file a ways. 10MB should do. */
if(H5FD_set_eoa(f->shared->lf, H5FD_MEM_DEFAULT, (haddr_t)(1024*1024*10)) < 0) FAIL_STACK_ERROR
- /* Set up I/O info for operation */
- fio_info.f = f;
- if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id))) FAIL_STACK_ERROR
- if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id))) FAIL_STACK_ERROR
-
/* Reset metadata accumulator for the file */
- if(accum_reset(&fio_info) < 0) FAIL_STACK_ERROR
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR
/* Test Functions */
- nerrors += test_write_read(&fio_info);
- nerrors += test_write_read_nonacc_front(&fio_info);
- nerrors += test_write_read_nonacc_end(&fio_info);
- nerrors += test_accum_overlap(&fio_info);
- nerrors += test_accum_overlap_clean(&fio_info);
- nerrors += test_accum_overlap_size(&fio_info);
- nerrors += test_accum_non_overlap_size(&fio_info);
- nerrors += test_accum_adjust(&fio_info);
- nerrors += test_read_after(&fio_info);
- nerrors += test_free(&fio_info);
- nerrors += test_big(&fio_info);
- nerrors += test_random_write(&fio_info);
+ nerrors += test_write_read(f);
+ nerrors += test_write_read_nonacc_front(f);
+ nerrors += test_write_read_nonacc_end(f);
+ nerrors += test_accum_overlap(f);
+ nerrors += test_accum_overlap_clean(f);
+ nerrors += test_accum_overlap_size(f);
+ nerrors += test_accum_non_overlap_size(f);
+ nerrors += test_accum_adjust(f);
+ nerrors += test_read_after(f);
+ nerrors += test_free(f);
+ nerrors += test_big(f);
+ nerrors += test_random_write(f);
+
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
/* End of test code, close and delete file */
if(H5Fclose(fid) < 0) TEST_ERROR
- HDremove(FILENAME);
/* This test uses a different file */
nerrors += test_swmr_write_big(TRUE);
@@ -137,12 +152,15 @@ main(void)
if(nerrors)
goto error;
- puts("All metadata accumulator tests passed.");
+ HDputs("All metadata accumulator tests passed.");
+ h5_cleanup(FILENAME, fapl);
return 0;
-error:
- puts("*** TESTS FAILED ***");
+error:
+ if(api_ctx_pushed) H5CX_pop();
+
+ HDputs("*** TESTS FAILED ***");
return 1;
} /* end main() */
@@ -153,19 +171,19 @@ error:
/*-------------------------------------------------------------------------
* Function: test_write_read
- *
+ *
* Purpose: Simple test to write to then read from metadata accumulator.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Mike McGreevy
* October 7, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_write_read(const H5F_io_info2_t *fio_info)
+test_write_read(H5F_t *f)
{
int i = 0;
int *write_buf, *read_buf;
@@ -188,7 +206,7 @@ test_write_read(const H5F_io_info2_t *fio_info)
if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -204,24 +222,24 @@ error:
HDfree(read_buf);
return 1;
-} /* test_write_read */
+} /* test_write_read */
/*-------------------------------------------------------------------------
* Function: test_write_read_nonacc_front
- *
+ *
* Purpose: Simple test to write to then read from before metadata accumulator.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Allen Byrne
* October 8, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_write_read_nonacc_front(const H5F_io_info2_t *fio_info)
+test_write_read_nonacc_front(H5F_t *f)
{
int i = 0;
int *write_buf, *read_buf;
@@ -241,13 +259,13 @@ test_write_read_nonacc_front(const H5F_io_info2_t *fio_info)
/* Do a simple write/read/verify of data */
/* Write 1KB at Address 0 */
if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR;
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR;
if(accum_read(0, 1024, read_buf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -263,24 +281,24 @@ error:
HDfree(read_buf);
return 1;
-} /* test_write_read */
+} /* test_write_read */
/*-------------------------------------------------------------------------
* Function: test_write_read_nonacc_end
- *
+ *
* Purpose: Simple test to write to then read from after metadata accumulator.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Allen Byrne
* October 8, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_write_read_nonacc_end(const H5F_io_info2_t *fio_info)
+test_write_read_nonacc_end(H5F_t *f)
{
int i = 0;
int *write_buf, *read_buf;
@@ -300,13 +318,13 @@ test_write_read_nonacc_end(const H5F_io_info2_t *fio_info)
/* Do a simple write/read/verify of data */
/* Write 1KB at Address 0 */
if(accum_write(1024, 1024, write_buf) < 0) FAIL_STACK_ERROR;
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
if(accum_write(0, 1024, write_buf) < 0) FAIL_STACK_ERROR;
if(accum_read(1024, 1024, read_buf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(write_buf, read_buf, (size_t)1024) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -322,24 +340,24 @@ error:
HDfree(read_buf);
return 1;
-} /* test_write_read */
+} /* test_write_read */
/*-------------------------------------------------------------------------
* Function: test_free
*
* Purpose: Simple test to free metadata accumulator.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Raymond Lu
* October 8, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_free(const H5F_io_info2_t *fio_info)
+test_free(H5F_t *f)
{
int i = 0;
int32_t *wbuf = NULL;
@@ -348,7 +366,7 @@ test_free(const H5F_io_info2_t *fio_info)
TESTING("simple freeing metadata accumulator");
- /* Write and free the whole accumulator. */
+ /* Write and free the whole accumulator. */
wbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t));
HDassert(wbuf);
rbuf = (int32_t *)HDmalloc(256 * sizeof(int32_t));
@@ -362,38 +380,38 @@ test_free(const H5F_io_info2_t *fio_info)
if(accum_write(0, 256 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
- if(accum_free(fio_info, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 0, 256 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Free an empty accumulator */
- if(accum_free(fio_info, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 0, 256 * 1024 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Write second quarter of the accumulator */
if(accum_write(64 * sizeof(int32_t), 64 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
- /* Free the second quarter of the accumulator, the requested area
+ /* Free the second quarter of the accumulator, the requested area
* is bigger than the data region on the right side. */
- if(accum_free(fio_info, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 64 * sizeof(int32_t), 65 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
- /* Write half of the accumulator. */
+ /* Write half of the accumulator. */
if(accum_write(0, 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
/* Free the first block of 4B */
- if(accum_free(fio_info, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 0, sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(1 * sizeof(int32_t), 127 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf + 1, rbuf, 127 * sizeof(int32_t)) != 0) TEST_ERROR;
/* Free the block of 4B at 127*4B */
- if(accum_free(fio_info, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 127 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(1 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf + 1, rbuf, 126 * sizeof(int32_t)) != 0) TEST_ERROR;
/* Free the block of 4B at 2*4B */
- if(accum_free(fio_info, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 2 * sizeof(int32_t), sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(1 * sizeof(int32_t), 1 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -406,10 +424,10 @@ test_free(const H5F_io_info2_t *fio_info)
* entirely before dirty section */
if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t));
- if(accum_free(fio_info, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 62 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(66 * sizeof(int32_t), 126 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -420,10 +438,10 @@ test_free(const H5F_io_info2_t *fio_info)
* completely contains dirty section */
if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
if(accum_write(68 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 68, wbuf, 4 * sizeof(int32_t));
- if(accum_free(fio_info, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 62 * sizeof(int32_t), 16 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -434,10 +452,10 @@ test_free(const H5F_io_info2_t *fio_info)
* before dirty section */
if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
- if(accum_free(fio_info, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 66 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(70 * sizeof(int32_t), 122 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -448,10 +466,10 @@ test_free(const H5F_io_info2_t *fio_info)
* dirty section, and ends in dirty section */
if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
- if(accum_free(fio_info, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 70 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(74 * sizeof(int32_t), 118 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -462,10 +480,10 @@ test_free(const H5F_io_info2_t *fio_info)
* contains dirty section */
if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
if(accum_write(72 * sizeof(int32_t), 4 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 72, wbuf, 4 * sizeof(int32_t));
- if(accum_free(fio_info, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 70 * sizeof(int32_t), 8 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(78 * sizeof(int32_t), 114 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -476,10 +494,10 @@ test_free(const H5F_io_info2_t *fio_info)
* of dirty section, and ends in dirty section */
if(accum_write(64 * sizeof(int32_t), 128 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 64, wbuf, 128 * sizeof(int32_t));
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
if(accum_write(72 * sizeof(int32_t), 8 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
HDmemcpy(expect + 72, wbuf, 8 * sizeof(int32_t));
- if(accum_free(fio_info, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
+ if(accum_free(f, 72 * sizeof(int32_t), 4 * sizeof(int32_t)) < 0) FAIL_STACK_ERROR;
/* Check that the accumulator still contains the correct data */
if(accum_read(76 * sizeof(int32_t), 116 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
@@ -492,7 +510,7 @@ test_free(const H5F_io_info2_t *fio_info)
HDfree(expect);
expect = NULL;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -507,26 +525,26 @@ error:
HDfree(expect);
return 1;
-} /* test_free */
+} /* test_free */
/*-------------------------------------------------------------------------
* Function: test_accum_overlap
- *
+ *
* Purpose: This test will write a series of pieces of data
* to the accumulator with the goal of overlapping
* the writes in various different ways.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Mike McGreevy
* October 7, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_overlap(const H5F_io_info2_t *fio_info)
+test_accum_overlap(H5F_t *f)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -611,9 +629,9 @@ test_accum_overlap(const H5F_io_info2_t *fio_info)
if(accum_write(96, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
if(accum_read(96, 3 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, 3 * sizeof(int32_t)) != 0) TEST_ERROR;
-
+
/* Set up expected data buffer and verify contents of
- accumulator as constructed by cases 1-8, above */
+ accumulator as constructed by cases 1-8, above */
for(i = 0; i < 5; i++)
wbuf[i] = 4;
for(i = 5; i < 6; i++)
@@ -662,7 +680,7 @@ test_accum_overlap(const H5F_io_info2_t *fio_info)
if(accum_read(112, 6 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, 6 * sizeof(int32_t)) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -698,7 +716,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
+test_accum_overlap_clean(H5F_t *f)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -724,7 +742,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
/* Case 2: End of new piece aligns with start of clean accumulated data */
/* Write 5 2's at address 20 */
/* @0:| 222221111111111| */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
for(i = 0; i < 5; i++)
wbuf[i] = 2;
if(accum_write(20, 5 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
@@ -764,7 +782,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
/* Case 6: New piece completely within clean accumulated data */
/* Write 3 6's at address 44 */
/* @0:| 333334666511111| */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
for(i = 0; i < 3; i++)
wbuf[i] = 6;
if(accum_write(44, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
@@ -774,7 +792,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
/* Case 7: New piece overlaps start of clean accumulated data */
/* Write 2 7's at address 16 */
/* @0:| 7733334666511111| */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
for(i = 0; i < 2; i++)
wbuf[i] = 7;
if(accum_write(16, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
@@ -794,7 +812,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
/* Case 9: Start of new piece aligns with end of clean accumulated data */
/* Write 3 9's at address 80 */
/* @0:| 88883334666511111999| */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
for(i = 0; i < 3; i++)
wbuf[i] = 9;
if(accum_write(80, 3 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
@@ -804,7 +822,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
/* Case 10: New piece overlaps end of clean accumulated data */
/* Write 3 2's at address 88 */
/* @0:| 888833346665111119922| */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR;
for(i = 0; i < 2; i++)
wbuf[i] = 2;
if(accum_write(88, 2 * sizeof(int32_t), wbuf) < 0) FAIL_STACK_ERROR;
@@ -842,7 +860,7 @@ test_accum_overlap_clean(const H5F_io_info2_t *fio_info)
if(accum_read(12, 22 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, 22 * sizeof(int32_t)) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -863,21 +881,21 @@ error:
/*-------------------------------------------------------------------------
* Function: test_accum_non_overlap_size
- *
+ *
* Purpose: This test will write a series of pieces of data
* to the accumulator with the goal of not overlapping
* the writes with a data size larger then the accum size.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Allen Byrne
* October 8, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_non_overlap_size(const H5F_io_info2_t *fio_info)
+test_accum_non_overlap_size(H5F_t *f)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -909,7 +927,7 @@ test_accum_non_overlap_size(const H5F_io_info2_t *fio_info)
if(accum_read(0, 20 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, 20 * sizeof(int32_t)) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -932,7 +950,7 @@ error:
*
* Purpose: This test will write a series of pieces of data
* to the accumulator with the goal of overlapping
- * the writes with a data size completely overlapping
+ * the writes with a data size completely overlapping
* the accumulator at both ends.
*
* Return: Success: SUCCEED
@@ -944,7 +962,7 @@ error:
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_overlap_size(const H5F_io_info2_t *fio_info)
+test_accum_overlap_size(H5F_t *f)
{
int i = 0;
int32_t *wbuf, *rbuf;
@@ -976,7 +994,7 @@ test_accum_overlap_size(const H5F_io_info2_t *fio_info)
if(accum_read(60, 72 * sizeof(int32_t), rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, 72 * sizeof(int32_t)) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -997,32 +1015,32 @@ error:
/*-------------------------------------------------------------------------
* Function: test_accum_adjust
- *
+ *
* Purpose: This test examines the various ways the accumulator might
* adjust itself as a result of data appending or prepending
* to it.
*
- * This test program covers all the code in H5F_accum_adjust,
+ * This test program covers all the code in H5F_accum_adjust,
* but NOT all possible paths through said code. It only covers
* six potential paths through the function. (Again, though, each
* piece of code within an if/else statement in H5F_accum_adjust is
- * covered by one of the paths in this test function). Since there
- * are a ridiculous number of total possible paths through this
+ * covered by one of the paths in this test function). Since there
+ * are a ridiculous number of total possible paths through this
* function due to its large number of embedded if/else statements,
- * that's certainly a lot of different test cases to write by hand.
- * (Though if someone comes across this code and has some free
+ * that's certainly a lot of different test cases to write by hand.
+ * (Though if someone comes across this code and has some free
* time, go for it).
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Mike McGreevy
* October 11, 2010
*
*-------------------------------------------------------------------------
*/
unsigned
-test_accum_adjust(const H5F_io_info2_t *fio_info)
+test_accum_adjust(H5F_t *f)
{
int i = 0;
int s = 1048576; /* size of buffer */
@@ -1050,7 +1068,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
* an increase in size because it's already at it's maximum size */
if(accum_write((1024 * 1024), (1024 * 1024) - 1, wbuf) < 0) FAIL_STACK_ERROR;
- /* Write a small (1KB) block that prepends to the front of the accumulator. */
+ /* Write a small (1KB) block that prepends to the front of the accumulator. */
/* ==> Accumulator will need more buffer space */
/* ==> Accumulator will try to resize, but see that it's getting too big */
/* ==> Size of new block is less than half maximum size of accumulator */
@@ -1066,9 +1084,9 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
/* Read back and verify second write */
if(accum_read((1024 * 1024) - 1024, 1024, rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR;
-
+
/* Reset accumulator for next case */
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* ================================================================ */
/* Case 2: Prepending large block to large, fully dirty accumulator */
@@ -1097,7 +1115,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
if(HDmemcmp(wbuf, rbuf, (size_t)1048571) != 0) TEST_ERROR;
/* Reset accumulator for next case */
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* ========================================================= */
/* Case 3: Appending small block to large, clean accumulator */
@@ -1111,7 +1129,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
/* Flush the accumulator -- we want to test the case when
accumulator contains clean data */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR
/* Write a small (1KB) block to the end of the accumulator */
/* ==> Accumulator will need more buffer space */
@@ -1126,13 +1144,13 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
to disk */
if(accum_write(0, 1, wbuf) < 0) FAIL_STACK_ERROR;
- /* Read in the piece we wrote to disk above, and then verify that
+ /* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read((1024 * 1024) - 1, 1024, rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0) TEST_ERROR;
/* Reset accumulator for next case */
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* ==================================================================== */
/* Case 4: Appending small block to large, partially dirty accumulator, */
@@ -1146,7 +1164,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR;
/* Flush the accumulator to clean it */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR
/* write to part of the accumulator so just the start of it is dirty */
if(accum_write(0, 5, wbuf) < 0) FAIL_STACK_ERROR;
@@ -1157,7 +1175,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
/* ==> Size of new block is less than than half maximum size of accumulator */
/* ==> New block being appended to accumulator */
/* ==> We can slide the dirty region down, to accomodate the request */
- /* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */
+ /* ==> Max Buffer Size - (dirty offset + adjust size) >= 2 * size) */
/* ==> Need to adjust location of accumulator while appending */
/* ==> Accumulator will need to be reallocated */
if(accum_write(1048571, 349523, wbuf) < 0) FAIL_STACK_ERROR;
@@ -1166,13 +1184,13 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
to disk */
if(accum_write(1398900, 1, wbuf) < 0) FAIL_STACK_ERROR;
- /* Read in the piece we wrote to disk above, and then verify that
+ /* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR;
/* Reset accumulator for next case */
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* ==================================================================== */
/* Case 5: Appending small block to large, partially dirty accumulator, */
@@ -1183,7 +1201,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
if(accum_write(0, (1024 * 1024) - 5, wbuf) < 0) FAIL_STACK_ERROR;
/* Flush the accumulator to clean it */
- if(accum_flush(fio_info) < 0) FAIL_STACK_ERROR
+ if(accum_flush(f) < 0) FAIL_STACK_ERROR
/* write to part of the accumulator so it's dirty, but not entirely dirty */
/* (just the begging few bytes will be clean) */
@@ -1195,7 +1213,7 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
/* ==> Size of new block is less than than half maximum size of accumulator */
/* ==> New block being appended to accumulator */
/* ==> We can slide the dirty region down, to accomodate the request */
- /* ==> Max Buffer Size - (dirty offset + adjust size) < 2 * size) */
+ /* ==> Max Buffer Size - (dirty offset + adjust size) < 2 * size) */
/* ==> Need to adjust location of accumulator while appending */
if(accum_write((1024 * 1024) - 5, 10, wbuf) < 0) FAIL_STACK_ERROR;
@@ -1203,13 +1221,13 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
to disk */
if(accum_write(0, 1, wbuf) < 0) FAIL_STACK_ERROR;
- /* Read in the piece we wrote to disk above, and then verify that
+ /* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read((1024 * 1024) - 5, 10, rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, (size_t)10) != 0) TEST_ERROR;
/* Reset accumulator for next case */
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* ================================================================= */
/* Case 6: Appending small block to large, fully dirty accumulator */
@@ -1235,12 +1253,12 @@ test_accum_adjust(const H5F_io_info2_t *fio_info)
to disk */
if(accum_write(1398900, 1, wbuf) < 0) FAIL_STACK_ERROR;
- /* Read in the piece we wrote to disk above, and then verify that
+ /* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read(1048571, 349523, rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, (size_t)349523) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -1261,24 +1279,24 @@ error:
/*-------------------------------------------------------------------------
* Function: test_read_after
- *
- * Purpose: This test will verify the case when metadata is read partly
- * from the accumulator and partly from disk. The test will
+ *
+ * Purpose: This test will verify the case when metadata is read partly
+ * from the accumulator and partly from disk. The test will
* write a block of data at address 512, force the data to be
- * written to disk, write new data partially overlapping the
- * original block from below, then read data at address 512.
- * The data read should be partly new and partly original.
- *
+ * written to disk, write new data partially overlapping the
+ * original block from below, then read data at address 512.
+ * The data read should be partly new and partly original.
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Larry Knox
* October 8, 2010
*
*-------------------------------------------------------------------------
*/
-unsigned
-test_read_after(const H5F_io_info2_t *fio_info)
+unsigned
+test_read_after(H5F_t *f)
{
int i = 0;
int s = 128; /* size of buffer */
@@ -1311,19 +1329,19 @@ test_read_after(const H5F_io_info2_t *fio_info)
of the original block */
if(accum_write(256, 512, wbuf) < 0) FAIL_STACK_ERROR;
- /* Read 128 bytes at the original address, and then */
+ /* Read 128 bytes at the original address, and then */
if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR;
- /* Set the second half of wbuf back to 1s */
+ /* Set the second half of wbuf back to 1s */
for(i = 64; i < s; i++)
wbuf[i] = 1;
- /* Read in the piece we wrote to disk above, and then verify that
+ /* Read in the piece we wrote to disk above, and then verify that
the data is as expected */
if(accum_read(512, 512, rbuf) < 0) FAIL_STACK_ERROR;
if(HDmemcmp(wbuf, rbuf, (size_t)128) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -1344,20 +1362,20 @@ error:
/*-------------------------------------------------------------------------
* Function: test_big
- *
+ *
* Purpose: This test exercises writing large pieces of metadata to the
* file.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Quincey Koziol
* October 12, 2010
*
*-------------------------------------------------------------------------
*/
-unsigned
-test_big(const H5F_io_info2_t *fio_info)
+unsigned
+test_big(H5F_t *f)
{
uint8_t *wbuf, *wbuf2, *rbuf, *zbuf; /* Buffers for reading & writing, etc */
unsigned u; /* Local index variable */
@@ -1393,7 +1411,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to middle of accumulator */
@@ -1412,7 +1430,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(1024, 1024, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to overlap with end of "big" region */
@@ -1430,7 +1448,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(BIG_BUF_SIZE - 512, 1024, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to overlap with beginning of "big" region */
@@ -1448,7 +1466,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, 1024, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to middle of accumulator */
@@ -1470,7 +1488,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)BIG_BUF_SIZE);
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to overlap with end of "big" region */
@@ -1493,7 +1511,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE + 512, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512));
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to be past "big" region */
@@ -1521,7 +1539,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1024));
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section to be past "big" region */
@@ -1549,7 +1567,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(1536, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536));
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section before "big" region */
@@ -1576,7 +1594,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(512, BIG_BUF_SIZE, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 512));
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section before "big" region */
@@ -1604,7 +1622,7 @@ test_big(const H5F_io_info2_t *fio_info)
/* Reset data in file back to zeros & reset the read buffer */
if(accum_write(0, BIG_BUF_SIZE + 1536, zbuf) < 0) FAIL_STACK_ERROR;
HDmemset(rbuf, 0, (size_t)(BIG_BUF_SIZE + 1536));
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
/* Write small section before "big" region */
@@ -1628,7 +1646,7 @@ test_big(const H5F_io_info2_t *fio_info)
if(HDmemcmp(wbuf2, rbuf + 512, (size_t)BIG_BUF_SIZE) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -1652,20 +1670,20 @@ error:
/*-------------------------------------------------------------------------
* Function: test_random_write
- *
+ *
* Purpose: This test writes random pieces of data to the file and
* then reads it all back.
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Quincey Koziol
* October 11, 2010
*
*-------------------------------------------------------------------------
*/
-unsigned
-test_random_write(const H5F_io_info2_t *fio_info)
+unsigned
+test_random_write(H5F_t *f)
{
uint8_t *wbuf, *rbuf; /* Buffers for reading & writing */
unsigned seed = 0; /* Random # seed */
@@ -1765,7 +1783,7 @@ HDfprintf(stderr, "Random # seed was: %u\n", seed);
/* Verify data read back in */
if(HDmemcmp(wbuf, rbuf, (size_t)RANDOM_BUF_SIZE) != 0) TEST_ERROR;
- if(accum_reset(fio_info) < 0) FAIL_STACK_ERROR;
+ if(accum_reset(f) < 0) FAIL_STACK_ERROR;
PASSED();
@@ -1790,28 +1808,29 @@ error:
/*-------------------------------------------------------------------------
* Function: test_swmr_write_big
- *
+ *
* Purpose: A SWMR test: verifies that writing "large" metadata to a file
- * opened with SWMR_WRITE will flush the existing metadata in the
+ * opened with SWMR_WRITE will flush the existing metadata in the
* accumulator to disk first before writing the "large" metadata
- * to disk.
+ * to disk.
* This test will fork and exec a reader "accum_swmr_reader" which
* opens the same file with SWMR_READ and verifies that the correct
* metadata is read from disk.
- *
+ *
* Return: Success: 0
* Failure: 1
- *
+ *
* Programmer: Vailin Choi; April 2013
*
*-------------------------------------------------------------------------
*/
-unsigned
+unsigned
test_swmr_write_big(hbool_t newest_format)
{
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
H5F_t *rf = NULL; /* File pointer */
+ char filename[1024];
uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */
uint8_t wbuf[1024]; /* Buffer for reading & writing */
unsigned u; /* Local index variable */
@@ -1819,15 +1838,13 @@ test_swmr_write_big(hbool_t newest_format)
pid_t pid; /* Process ID */
#endif /* H5_HAVE_UNISTD_H */
int status; /* Status returned from child process */
- H5F_io_info2_t fio_info; /* I/O info for operation */
- char *new_argv[] = {NULL};
char *driver = NULL; /* VFD string (from env variable) */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
- if(newest_format) {
- TESTING("SWMR write of large metadata: with latest format");
- } else {
- TESTING("SWMR write of large metadata: with non-latest-format");
- } /* end if */
+ if(newest_format)
+ TESTING("SWMR write of large metadata: with latest format")
+ else
+ TESTING("SWMR write of large metadata: with non-latest-format")
#if !(defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID))
@@ -1841,25 +1858,27 @@ test_swmr_write_big(hbool_t newest_format)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if (!H5FD_supports_swmr_test(driver)) {
+ if(!H5FD__supports_swmr_test(driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
return 0;
- } /* end if */
+ }
/* File access property list */
if((fapl = h5_fileaccess()) < 0)
FAIL_STACK_ERROR
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
/* Both cases will result in v3 superblock and version 2 object header for SWMR */
if(newest_format) { /* latest format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
FAIL_STACK_ERROR
- if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- } else { /* non-latest-format */
- if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
+ }
+ else { /* non-latest-format */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -1868,18 +1887,15 @@ test_swmr_write_big(hbool_t newest_format)
FAIL_STACK_ERROR
/* Open the file with SWMR_WRITE */
- if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0)
FAIL_STACK_ERROR
- /* Get H5F_t * to internal file structure */
- if(NULL == (rf = (H5F_t *)H5I_object(fid))) FAIL_STACK_ERROR
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
- /* Set up I/O info for operation */
- fio_info.f = rf;
- if(NULL == (fio_info.meta_dxpl = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id)))
- FAIL_STACK_ERROR
- if(NULL == (fio_info.raw_dxpl = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id)))
- FAIL_STACK_ERROR
+ /* Get H5F_t * to internal file structure */
+ if(NULL == (rf = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR
/* We'll be writing lots of garbage data, so extend the
file a ways. 10MB should do. */
@@ -1890,7 +1906,7 @@ test_swmr_write_big(hbool_t newest_format)
FAIL_STACK_ERROR;
/* Reset metadata accumulator for the file */
- if(accum_reset(&fio_info) < 0)
+ if(accum_reset(rf) < 0)
FAIL_STACK_ERROR;
/* Allocate space for the write & read buffers */
@@ -1904,16 +1920,16 @@ test_swmr_write_big(hbool_t newest_format)
wbuf[u] = (uint8_t)u;
/* Write [1024, 1024] bytes with wbuf */
- if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, wbuf) < 0)
+ if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, wbuf) < 0)
FAIL_STACK_ERROR;
/* Read the data */
- if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0)
+ if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data read is correct */
if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0)
TEST_ERROR;
/* Flush the data to disk */
- if(accum_reset(&fio_info) < 0)
+ if(accum_reset(rf) < 0)
FAIL_STACK_ERROR;
/* Initialize wbuf with all 1s */
@@ -1925,10 +1941,10 @@ test_swmr_write_big(hbool_t newest_format)
wbuf2[u] = (uint8_t)(u + 1);
/* Write [1024,1024] with wbuf--all 1s */
- if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, wbuf) < 0)
+ if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, wbuf) < 0)
FAIL_STACK_ERROR;
/* Read the data */
- if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0)
+ if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data read is correct */
if(HDmemcmp(wbuf, rbuf, (size_t)1024) != 0)
@@ -1936,10 +1952,10 @@ test_swmr_write_big(hbool_t newest_format)
/* The data stays in the accumulator */
/* Write a large piece of metadata [2048, BIG_BUF_SIZE] with wbuf2 */
- if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5AC_ind_read_dxpl_id, wbuf2) < 0)
+ if(H5F_block_write(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, wbuf2) < 0)
FAIL_STACK_ERROR;
/* Read the data */
- if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, H5AC_ind_read_dxpl_id, rbuf) < 0)
+ if(H5F_block_read(rf, H5FD_MEM_DEFAULT, (haddr_t)2048, (size_t)BIG_BUF_SIZE, rbuf) < 0)
FAIL_STACK_ERROR;
/* Verify the data read is correct */
if(HDmemcmp(wbuf2, rbuf, (size_t)BIG_BUF_SIZE) != 0)
@@ -1949,10 +1965,18 @@ test_swmr_write_big(hbool_t newest_format)
if((pid = HDfork()) < 0) {
HDperror("fork");
FAIL_STACK_ERROR;
- } else if(0 == pid) { /* Child process */
- /* Run the reader */
- status = HDexecv(SWMR_READER, new_argv);
- printf("errno from execv = %s\n", strerror(errno));
+ }
+ else if(0 == pid) { /* Child process */
+ /* By convention, argv[0] tells the name of program invoked.
+ *
+ * execv on NetBSD 8 will actually return EFAULT if there is a
+ * NULL at argv[0], so we follow the convention unconditionally.
+ */
+ char swmr_reader[] = SWMR_READER;
+ char * const new_argv[] = {swmr_reader, NULL};
+ /* Run the reader */
+ status = HDexecv(SWMR_READER, new_argv);
+ HDprintf("errno from execv = %s\n", strerror(errno));
FAIL_STACK_ERROR;
} /* end if */
@@ -1962,17 +1986,21 @@ test_swmr_write_big(hbool_t newest_format)
/* Check if child process terminates normally and its return value */
if(WIFEXITED(status) && !WEXITSTATUS(status)) {
- /* Flush the accumulator */
- if(accum_reset(&fio_info) < 0)
+ /* Flush the accumulator */
+ if(accum_reset(rf) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Close and remove the file */
+ if(H5Fclose(fid) < 0)
+ FAIL_STACK_ERROR;
+
+ /* Close the property list */
+ if(H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- /* Close the property list */
- if(H5Pclose(fapl) < 0)
- FAIL_STACK_ERROR;
- /* Close and remove the file */
- if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
- HDremove(SWMR_FILENAME);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
/* Release memory */
if(wbuf2)
@@ -1985,9 +2013,12 @@ test_swmr_write_big(hbool_t newest_format)
error:
/* Closing and remove the file */
- H5Pclose(fapl);
H5Fclose(fid);
- HDremove(SWMR_FILENAME);
+
+ if(api_ctx_pushed) H5CX_pop();
+
+ H5Pclose(fapl);
+
/* Release memory */
if(wbuf2)
HDfree(wbuf2);
@@ -2003,34 +2034,35 @@ error:
/*-------------------------------------------------------------------------
* Function: accum_printf
- *
+ *
* Purpose: Debug function to print some stats about the accumulator
- *
+ *
* Return: Success: SUCCEED
* Failure: FAIL
- *
+ *
* Programmer: Mike McGreevy
* October 7, 2010
*
*-------------------------------------------------------------------------
*/
void
-accum_printf(void)
+accum_printf(const H5F_t *f)
{
H5F_meta_accum_t * accum = &f->shared->accum;
- printf("\n");
- printf("Current contents of accumulator:\n");
- if (accum->alloc_size == 0) {
- printf("=====================================================\n");
- printf(" No accumulator allocated.\n");
- printf("=====================================================\n");
- } else {
- printf("=====================================================\n");
- printf(" accumulator allocated size == %zu\n", accum->alloc_size);
- printf(" accumulated data size == %zu\n", accum->size);
+ HDprintf("\n");
+ HDprintf("Current contents of accumulator:\n");
+ if(accum->alloc_size == 0) {
+ HDprintf("=====================================================\n");
+ HDprintf(" No accumulator allocated.\n");
+ HDprintf("=====================================================\n");
+ }
+ else {
+ HDprintf("=====================================================\n");
+ HDprintf(" accumulator allocated size == %zu\n", accum->alloc_size);
+ HDprintf(" accumulated data size == %zu\n", accum->size);
HDfprintf(stdout, " accumulator dirty? == %t\n", accum->dirty);
- printf("=====================================================\n");
+ HDprintf("=====================================================\n");
HDfprintf(stdout, " start of accumulated data, loc = %a\n", accum->loc);
if(accum->dirty) {
HDfprintf(stdout, " start of dirty region, loc = %a\n", (haddr_t)(accum->loc + accum->dirty_off));
@@ -2038,8 +2070,8 @@ accum_printf(void)
} /* end if */
HDfprintf(stdout, " end of accumulated data, loc = %a\n", (haddr_t)(accum->loc + accum->size));
HDfprintf(stdout, " end of accumulator allocation, loc = %a\n", (haddr_t)(accum->loc + accum->alloc_size));
- printf("=====================================================\n");
+ HDprintf("=====================================================\n");
}
- printf("\n\n");
+ HDprintf("\n\n");
} /* accum_printf() */
diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c
index c1a238d..c3be09a 100644
--- a/test/accum_swmr_reader.c
+++ b/test/accum_swmr_reader.c
@@ -17,23 +17,31 @@
#include "H5Fpkg.h"
#include "H5FDpkg.h"
+
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Filename: this is the same as the define in accum.c used by test_swmr_write_big() */
-#define SWMR_FILENAME "accum_swmr_big.h5"
+const char *FILENAME[] = {
+ "accum",
+ "accum_swmr_big",
+ NULL
+};
+
/*-------------------------------------------------------------------------
* Function: main
- *
- * Purpose: This is the reader forked/execved by "test_swmr_write_big()"
+ *
+ * Purpose: This is the reader forked/execved by "test_swmr_write_big()"
* test in accum.c. The reader reads at address 1024 from the file
* and verifies that the metadata in the accumulator at address
* 1024 does get written to disk.
- *
+ *
* Return: Success: EXIT_SUCCESS
* Failure: EXIT_FAILURE
- *
+ *
* Programmer: Vailin Choi; June 2013
*
*-------------------------------------------------------------------------
@@ -44,18 +52,19 @@ main(void)
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* file access property list ID */
H5F_t *f = NULL; /* File pointer */
+ char filename[1024];
unsigned u; /* Local index variable */
uint8_t rbuf[1024]; /* Buffer for reading */
uint8_t buf[1024]; /* Buffer for holding the expected data */
char *driver = NULL; /* VFD string (from env variable) */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if(!H5FD_supports_swmr_test(driver)) {
+ if(!H5FD__supports_swmr_test(driver))
return EXIT_SUCCESS;
- }
/* Initialize buffers */
for(u = 0; u < 1024; u++) {
@@ -65,33 +74,48 @@ main(void)
if((fapl = h5_fileaccess()) < 0)
FAIL_STACK_ERROR
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
/* Open the file with SWMR_READ */
- if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
- FAIL_STACK_ERROR
+ if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
/* Get H5F_t * to internal file structure */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
- FAIL_STACK_ERROR
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
+ FAIL_STACK_ERROR
/* Should read in [1024, 2024] with buf data */
- if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, H5AC_ind_read_dxpl_id, rbuf) < 0)
- FAIL_STACK_ERROR;
+ if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0)
+ FAIL_STACK_ERROR;
/* Verify the data read is correct */
- if(HDmemcmp(buf, rbuf, (size_t)1024) != 0)
- TEST_ERROR;
+ if(HDmemcmp(buf, rbuf, (size_t)1024) != 0)
+ TEST_ERROR;
/* CLose the file */
if(H5Pclose(fapl) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Fclose(fid) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
+
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
return EXIT_SUCCESS;
-error:
- H5Fclose(fid);
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
return EXIT_FAILURE;
} /* end main() */
diff --git a/test/app_ref.c b/test/app_ref.c
index 3ef3fef..a4853fa 100644
--- a/test/app_ref.c
+++ b/test/app_ref.c
@@ -83,8 +83,8 @@ Abrt_Handler (int H5_ATTR_UNUSED sig)
int i, n;
for (i=0; i<T_NUMCLASSES; i++) {
- fprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
- fprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
+ HDfprintf(stderr, "%s ID reference count: %n", IDNAME[i], &n);
+ HDfprintf(stderr, "%*d\n", (n < ERR_WIDTH) ? (ERR_WIDTH - n) : 0, rc[i]);
}
}
@@ -195,7 +195,7 @@ main (void)
error:
- puts("***** APPLICATION REFERENCE COUNT TESTS FAILED *****");
+ HDputs("***** APPLICATION REFERENCE COUNT TESTS FAILED *****");
return 1;
}
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/big.c b/test/big.c
index fe52aef..a2f07af 100644
--- a/test/big.c
+++ b/test/big.c
@@ -69,7 +69,7 @@
# define GB8LL 0 /*cannot do the test*/
#endif
-/* Define Small, Large, Extra Large, Huge File which
+/* Define Small, Large, Extra Large, Huge File which
* corrspond to less than 2GB, 2GB, 4GB, and tens of GB file size.
* NO_FILE stands for "no file" to be tested.
*/
@@ -275,6 +275,13 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static int
enough_room(hid_t fapl)
{
@@ -315,6 +322,7 @@ done:
return ret_value;
}
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
@@ -524,7 +532,7 @@ reader(char *filename, hid_t fapl)
}
if(zero) {
H5_FAILED();
- printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
+ HDprintf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
} else if(wrong) {
SKIPPED();
HDputs(" Possible overlap with another region.");
@@ -625,7 +633,7 @@ error:
return 1;
} /* end test_sec2() */
-static int
+static int
test_stdio(hid_t fapl)
{
char filename[1024];
@@ -765,7 +773,7 @@ main (int ac, char **av)
family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
}
else{
- printf("***Missing fsize value***\n");
+ HDprintf("***Missing fsize value***\n");
usage();
return 1;
}
diff --git a/test/bittests.c b/test/bittests.c
index ccd725c..046528a 100644
--- a/test/bittests.c
+++ b/test/bittests.c
@@ -57,13 +57,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero length test failed (lsb)!");
+ HDputs (" Zero length test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero length test failed (msb)!");
+ HDputs (" Zero length test failed (msb)!");
goto failed;
}
@@ -73,13 +73,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero buffer test failed (lsb)!");
+ HDputs (" Zero buffer test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE);
if(-1 != n) {
H5_FAILED();
- puts (" Zero buffer test failed (msb)!");
+ HDputs (" Zero buffer test failed (msb)!");
goto failed;
}
@@ -90,13 +90,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE);
if((ssize_t)i != n) {
H5_FAILED();
- printf (" Test for set bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for set bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE);
if((ssize_t)i != n) {
H5_FAILED();
- printf (" Test for set bit %d failed (msb)!\n", i);
+ HDprintf (" Test for set bit %d failed (msb)!\n", i);
goto failed;
}
}
@@ -106,13 +106,13 @@ test_find (void)
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE);
if(-1 != n) {
H5_FAILED();
- puts (" One buffer test failed (lsb)!");
+ HDputs (" One buffer test failed (lsb)!");
goto failed;
}
n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE);
if(-1 != n) {
H5_FAILED();
- puts (" One buffer test failed (msb)!");
+ HDputs (" One buffer test failed (msb)!");
goto failed;
}
@@ -123,13 +123,13 @@ test_find (void)
n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_LSB, FALSE);
if ((ssize_t)i!=n) {
H5_FAILED();
- printf (" Test for clear bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_MSB, FALSE);
if ((ssize_t)i!=n) {
H5_FAILED();
- printf (" Test for clear bit %d failed (lsb)!\n", i);
+ HDprintf (" Test for clear bit %d failed (lsb)!\n", i);
goto failed;
}
}
@@ -139,9 +139,9 @@ test_find (void)
return 0;
failed:
- printf (" v = 0x");
- for (i=0; i<(int)sizeof(v1); i++) printf ("%02x", v1[i]);
- printf ("\n");
+ HDprintf (" v = 0x");
+ for (i=0; i<(int)sizeof(v1); i++) HDprintf ("%02x", v1[i]);
+ HDprintf ("\n");
return -1;
}
@@ -185,12 +185,12 @@ test_copy (void)
for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find copied region in destination");
+ HDputs (" Unabled to find copied region in destination");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found copied bits when we shouldn't have");
+ HDputs (" Found copied bits when we shouldn't have");
goto failed;
}
@@ -199,25 +199,25 @@ test_copy (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1);
if (size>0 && n!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find first copied bit in destination "
+ HDprintf (" Unable to find first copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found copied bits and shouldn't have!");
+ HDputs (" Found copied bits and shouldn't have!");
goto failed;
}
n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0);
if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) {
H5_FAILED();
- printf (" Unable to find last copied bit in destination "
+ HDprintf (" Unable to find last copied bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order zeros are present and shouldn't be!");
+ HDputs (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -228,25 +228,25 @@ test_copy (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
H5_FAILED();
- printf (" Unable to find last copied bit in destination "
+ HDprintf (" Unable to find last copied bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found copied bits but shouldn't have (reverse)!");
+ HDputs (" Found copied bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find beginning of copied data "
+ HDprintf (" Unable to find beginning of copied data "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading original data but shouldn't have!");
+ HDputs (" Found leading original data but shouldn't have!");
goto failed;
}
@@ -256,14 +256,14 @@ test_copy (void)
return 0;
failed:
- printf (" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, s_offset=%lu, d_offset=%lu, size=%lu\n",
i, (unsigned long)s_offset, (unsigned long)d_offset,
(unsigned long)size);
- printf (" s = 0x");
- for (j=sizeof(v1)-1; j>=0; --j) printf ("%02x", v1[j]);
- printf ("\n d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" s = 0x");
+ for (j=sizeof(v1)-1; j>=0; --j) HDprintf ("%02x", v1[j]);
+ HDprintf ("\n d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -311,7 +311,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if(n != (ssize_t)offset + shift_dist) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -323,7 +323,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -338,7 +338,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n!=offset) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -350,7 +350,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if(n != (ssize_t)(offset + size) - shift_dist - 1) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -373,7 +373,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (n >= 0) {
H5_FAILED();
- printf (" Unable to verify all bits are zero in destination(LSB) "
+ HDprintf (" Unable to verify all bits are zero in destination(LSB) "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -382,7 +382,7 @@ test_shift (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n >= 0) {
H5_FAILED();
- printf (" Unable to verify all bits are zero in destination(MSB) "
+ HDprintf (" Unable to verify all bits are zero in destination(MSB) "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -392,11 +392,11 @@ test_shift (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu, shift_dist=%lu\n",
i, (unsigned long)offset, (unsigned long)size,
(unsigned long)shift_dist);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -446,13 +446,13 @@ test_increment (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (size!=1 && (size_t)n!=offset+size-1) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if(size==1 && n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bit in destination "
+ HDprintf (" Unable to verify all-zero bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -464,13 +464,13 @@ test_increment (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (size!=1 && n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if(size==1 && n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bit in destination "
+ HDprintf (" Unable to verify all-zero bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -480,10 +480,10 @@ test_increment (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -530,7 +530,7 @@ test_decrement (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n!=offset) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -542,7 +542,7 @@ test_decrement (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -552,10 +552,10 @@ test_decrement (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -602,7 +602,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if ((size_t)n!=offset) {
H5_FAILED();
- printf (" Unable to find first bit in destination "
+ HDprintf (" Unable to find first bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -614,7 +614,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n!=(ssize_t)(offset+size-1)) {
H5_FAILED();
- printf (" Unable to find last bit in destination "
+ HDprintf (" Unable to find last bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -630,7 +630,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1);
if (n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bits in destination "
+ HDprintf (" Unable to verify all-zero bits in destination "
"(n=%d)\n", (int)n);
goto failed;
}
@@ -642,7 +642,7 @@ test_negate (void)
n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1);
if (n>=0) {
H5_FAILED();
- printf (" Unable to verify all-zero bits in destination "
+ HDprintf (" Unable to verify all-zero bits in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
@@ -652,10 +652,10 @@ test_negate (void)
return 0;
failed:
- printf (" i=%d, offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, offset=%lu, size=%lu\n",
i, (unsigned long)offset, (unsigned long)size);
- for (j=sizeof(vector)-1; j>=0; --j) printf ("%02x", vector[j]);
- printf ("\n");
+ for (j=sizeof(vector)-1; j>=0; --j) HDprintf ("%02x", vector[j]);
+ HDprintf ("\n");
return -1;
}
@@ -697,12 +697,12 @@ test_set (void)
for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find set region in buffer");
+ HDputs (" Unabled to find set region in buffer");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found set bits when we shouldn't have");
+ HDputs (" Found set bits when we shouldn't have");
goto failed;
}
@@ -711,25 +711,25 @@ test_set (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1);
if (size>0 && n!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find first set bit in destination "
+ HDprintf (" Unable to find first set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found set bits and shouldn't have!");
+ HDputs (" Found set bits and shouldn't have!");
goto failed;
}
n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0);
if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) {
H5_FAILED();
- printf (" Unable to find last set bit in destination "
+ HDprintf (" Unable to find last set bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order zeros are present and shouldn't be!");
+ HDputs (" High-order zeros are present and shouldn't be!");
goto failed;
}
@@ -740,25 +740,25 @@ test_set (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
H5_FAILED();
- printf (" Unable to find last set bit in destination "
+ HDprintf (" Unable to find last set bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found set bits but shouldn't have (reverse)!");
+ HDputs (" Found set bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find beginning of set bit region "
+ HDprintf (" Unable to find beginning of set bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading zeros but shouldn't have!");
+ HDputs (" Found leading zeros but shouldn't have!");
goto failed;
}
@@ -768,11 +768,11 @@ test_set (void)
return 0;
failed:
- printf (" i=%d, d_offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, d_offset=%lu, size=%lu\n",
i, (unsigned long)d_offset, (unsigned long)size);
- printf (" d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
@@ -814,12 +814,12 @@ test_clear (void)
for (j=0; j<(int)sizeof(v2); j++) if (0xff!=v2[j]) break;
if (size>0 && j>=(int)sizeof(v2)) {
H5_FAILED();
- puts (" Unabled to find cleared region in buffer");
+ HDputs (" Unabled to find cleared region in buffer");
goto failed;
}
if (0==size && j<(int)sizeof(v2)) {
H5_FAILED();
- puts (" Found cleared bits when we shouldn't have");
+ HDputs (" Found cleared bits when we shouldn't have");
goto failed;
}
@@ -828,25 +828,25 @@ test_clear (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 0);
if (size>0 && n!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find first cleared bit in destination "
+ HDprintf (" Unable to find first cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found cleared bits and shouldn't have!");
+ HDputs (" Found cleared bits and shouldn't have!");
goto failed;
}
n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 1);
if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) {
H5_FAILED();
- printf (" Unable to find last cleared bit in destination "
+ HDprintf (" Unable to find last cleared bit in destination "
"(n=%d)\n", (int)n);
goto failed;
}
if (d_offset+size==8*sizeof(v2) && n>=0) {
H5_FAILED();
- puts (" High-order ones are present and shouldn't be!");
+ HDputs (" High-order ones are present and shouldn't be!");
goto failed;
}
@@ -857,25 +857,25 @@ test_clear (void)
n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 0);
if (size>0 && (size_t)(n+1)!=d_offset+size) {
H5_FAILED();
- printf (" Unable to find last cleared bit in destination "
+ HDprintf (" Unable to find last cleared bit in destination "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==size && n>=0) {
H5_FAILED();
- puts (" Found cleared bits but shouldn't have (reverse)!");
+ HDputs (" Found cleared bits but shouldn't have (reverse)!");
goto failed;
}
n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 1);
if (d_offset>0 && n+1!=(ssize_t)d_offset) {
H5_FAILED();
- printf (" Unable to find beginning of cleared bit region "
+ HDprintf (" Unable to find beginning of cleared bit region "
"(reverse, n=%d)\n", (int)n);
goto failed;
}
if (0==d_offset && n>=0) {
H5_FAILED();
- puts (" Found leading ones but shouldn't have!");
+ HDputs (" Found leading ones but shouldn't have!");
goto failed;
}
@@ -885,23 +885,21 @@ test_clear (void)
return 0;
failed:
- printf (" i=%d, d_offset=%lu, size=%lu\n",
+ HDprintf (" i=%d, d_offset=%lu, size=%lu\n",
i, (unsigned long)d_offset, (unsigned long)size);
- printf (" d = 0x");
- for (j=sizeof(v2)-1; j>=0; --j) printf ("%02x", v2[j]);
- printf ("\n");
+ HDprintf (" d = 0x");
+ for (j=sizeof(v2)-1; j>=0; --j) HDprintf ("%02x", v2[j]);
+ HDprintf ("\n");
return -1;
}
/*-------------------------------------------------------------------------
- * 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.
@@ -928,14 +926,14 @@ main(void)
nerrors += test_negate() < 0 ? 1 : 0;
if(nerrors) {
- printf("***** %u FAILURE%s! *****\n",
+ HDprintf("***** %u FAILURE%s! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
- printf("All bit tests passed.\n");
+ 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 4c820b3..c4c5530 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -20,12 +20,13 @@
* 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"
/* Other private headers that this test requires */
-#include "H5Iprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5VLprivate.h" /* Virtual Object Layer */
const char *FILENAME[] = {
"btree2",
@@ -49,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
*
*-------------------------------------------------------------------------
@@ -89,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
*
*-------------------------------------------------------------------------
@@ -106,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));
@@ -116,7 +117,7 @@ create_file(hid_t *file, H5F_t **f, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -130,26 +131,26 @@ 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
*
*-------------------------------------------------------------------------
*/
static int
-create_btree(H5F_t *f, hid_t dxpl, const H5B2_create_t *cparam,
+create_btree(H5F_t *f, const H5B2_create_t *cparam,
H5B2_t **bt2, haddr_t *bt2_addr)
{
/* Create the v2 B-tree & get its address */
- if(NULL == (*bt2 = H5B2_create(f, dxpl, cparam, f)))
+ if(NULL == (*bt2 = H5B2_create(f, cparam, f)))
FAIL_STACK_ERROR
if(H5B2_get_addr(*bt2, bt2_addr/*out*/) < 0)
FAIL_STACK_ERROR
@@ -163,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
*
*-------------------------------------------------------------------------
@@ -180,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));
@@ -190,7 +191,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -204,32 +205,32 @@ 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
*
*-------------------------------------------------------------------------
*/
static int
-reopen_btree(H5F_t *f, hid_t dxpl, H5B2_t **bt2, haddr_t bt2_addr,
+reopen_btree(H5F_t *f, H5B2_t **bt2, haddr_t bt2_addr,
const bt2_test_param_t *tparam)
{
/* Check for closing & re-opening the B-tree */
if(tparam->reopen_btree) {
/* Close (empty) v2 B-tree */
- if(H5B2_close(*bt2, dxpl) < 0)
+ if(H5B2_close(*bt2) < 0)
FAIL_STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (*bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (*bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
} /* end if */
@@ -240,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
*
*-------------------------------------------------------------------------
@@ -274,26 +275,26 @@ 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
*
*-------------------------------------------------------------------------
*/
static int
-check_node_depth(H5B2_t *bt2, hid_t dxpl, void *record, unsigned depth)
+check_node_depth(H5B2_t *bt2, void *record, unsigned depth)
{
int rec_depth; /* Depth of record in B-tree */
- if((rec_depth = H5B2_get_node_depth_test(bt2, dxpl, record)) < 0)
+ if((rec_depth = H5B2__get_node_depth_test(bt2, record)) < 0)
FAIL_STACK_ERROR
if((unsigned)rec_depth != depth)
TEST_ERROR
@@ -305,27 +306,27 @@ 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
*
*-------------------------------------------------------------------------
*/
static int
-check_node_info(H5B2_t *bt2, hid_t dxpl, hsize_t record,
+check_node_info(H5B2_t *bt2, hsize_t record,
H5B2_node_info_test_t *ninfo)
{
H5B2_node_info_test_t rec_ninfo; /* Node info for record in B-tree */
- if(H5B2_get_node_info_test(bt2, dxpl, &record, &rec_ninfo) < 0)
+ if(H5B2__get_node_info_test(bt2, &record, &rec_ninfo) < 0)
FAIL_STACK_ERROR
if(rec_ninfo.depth != ninfo->depth)
TEST_ERROR
@@ -339,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
*
*-------------------------------------------------------------------------
@@ -366,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
*
*-------------------------------------------------------------------------
@@ -396,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
*
*-------------------------------------------------------------------------
@@ -422,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
*
*-------------------------------------------------------------------------
@@ -449,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
*
*-------------------------------------------------------------------------
@@ -477,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
*
*-------------------------------------------------------------------------
@@ -505,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
*
*-------------------------------------------------------------------------
@@ -531,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
*
*-------------------------------------------------------------------------
@@ -558,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
*
*-------------------------------------------------------------------------
@@ -585,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
*
*-------------------------------------------------------------------------
@@ -609,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
*
*-------------------------------------------------------------------------
@@ -635,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
*
*-------------------------------------------------------------------------
@@ -653,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -672,7 +672,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
PASSED();
@@ -683,12 +683,12 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree iteration: empty B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to iterate over a B-tree with no records */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index hasn't changed */
if(idx != 0)
@@ -696,13 +696,13 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find record in B-tree with no records */
idx = 0;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, NULL) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, NULL) != FALSE)
TEST_ERROR
/* Attempt to index record in B-tree with no records */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -716,37 +716,37 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: first record");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 42;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
idx = 41;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != FALSE)
+ if(H5B2_find(bt2, &idx, NULL, NULL) != FALSE)
TEST_ERROR
/* Attempt to find existant record in B-tree with 1 record */
idx = 42;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
TEST_ERROR
/* Try again with NULL 'op' */
- if(H5B2_find(bt2, dxpl, &idx, NULL, NULL) != TRUE)
+ if(H5B2_find(bt2, &idx, NULL, NULL) != TRUE)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -754,7 +754,7 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with 1 record */
idx = 42;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
TEST_ERROR
PASSED();
@@ -765,45 +765,45 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: several records");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/*
* Test inserting second record into v2 B-tree, before all other records
*/
record = 34;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/*
* Test inserting third record into v2 B-tree, after all other records
*/
record = 56;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/*
* Test inserting fourth record into v2 B-tree, in the middle of other records
*/
record = 38;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
idx = 41;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several record */
idx = 56;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -811,20 +811,20 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with several records */
idx = 34;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
TEST_ERROR
idx = 38;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, find_cb, &idx) < 0)
TEST_ERROR
idx = 42;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, find_cb, &idx) < 0)
TEST_ERROR
idx = 56;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, find_cb, &idx) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -840,25 +840,25 @@ test_insert_basic(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -888,13 +887,13 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records to fill root leaf node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC - 1); u++) {
record = u + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -904,16 +903,16 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split root leaf node */
record = INSERT_SPLIT_ROOT_NREC + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -922,20 +921,20 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert a couple more records, on the left side of the B-tree */
record = 0;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -944,17 +943,17 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -964,23 +963,23 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find non-existant record in level-1 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC + 10;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Attempt to find existant record in root of level-1 B-tree */
idx = 33;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Attempt to find existant record in leaf of level-1 B-tree */
idx = 56;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Attempt to index non-existant record in level-1 B-tree */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -988,21 +987,21 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-1 B-tree */
idx = 33;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in left leaf of level-1 B-tree */
idx = 0;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in right leaf of level-1 B-tree */
idx = 50;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1016,26 +1015,26 @@ test_insert_split_root(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1044,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -1063,13 +1061,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC/2) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1079,18 +1077,18 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)INSERT_SPLIT_ROOT_NREC;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force redistribution from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1100,11 +1098,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1116,13 +1114,13 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redistribute 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1132,17 +1130,17 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)(INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force redistribution from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1152,11 +1150,11 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (hsize_t)((INSERT_SPLIT_ROOT_NREC / 2) + (INSERT_SPLIT_ROOT_NREC / 4) + 1);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1171,26 +1169,26 @@ test_insert_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1199,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -1218,13 +1215,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1234,17 +1231,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1254,14 +1251,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 31;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 63;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1273,13 +1270,13 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split side leaf into 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1289,17 +1286,17 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force right node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1309,14 +1306,14 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 62;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1331,28 +1328,28 @@ test_insert_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1361,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -1381,13 +1377,13 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1397,17 +1393,17 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (2 * INSERT_SPLIT_ROOT_NREC);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1417,20 +1413,20 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC + (INSERT_SPLIT_ROOT_NREC / 2) + 1);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert records to force middle node to redistribute */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) {
record = u + INSERT_SPLIT_ROOT_NREC;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1440,19 +1436,19 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 52;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 105;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1460,7 +1456,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1475,27 +1471,27 @@ test_insert_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1504,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -1524,13 +1519,13 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 2);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1540,17 +1535,17 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = (2 * INSERT_SPLIT_ROOT_NREC) + (INSERT_SPLIT_ROOT_NREC / 2);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force split from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1560,22 +1555,22 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 62;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 126;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1583,7 +1578,7 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1598,23 +1593,23 @@ test_insert_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1623,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -1644,18 +1638,18 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 9); u++) {
record = u + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + 1); u++) {
record = u + 4;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1665,37 +1659,37 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 948;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to left-most leaf */
record = 0;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record = (INSERT_SPLIT_ROOT_NREC * 9) + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = (INSERT_SPLIT_ROOT_NREC * 9) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1705,43 +1699,43 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find non-existant record in level-2 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_SPLIT_ROOT_NREC * 30;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Attempt to find existant record in root of level-2 B-tree */
idx = 948;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Check with B-tree */
record = 948;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
idx = 505;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Check with B-tree */
record = 505;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
idx = 555;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
/* Check with B-tree */
record = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
idx = 0;
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -1749,21 +1743,21 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-2 B-tree */
idx = 948;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)948, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in internal node of level-2 B-tree */
idx = 505;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)505, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to index existing record in leaf of level-2 B-tree */
idx = 555;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -1778,25 +1772,25 @@ test_insert_make_level2(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1805,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -1825,19 +1818,19 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
/* And fill rightmost leaf */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) {
record = u + INSERT_SPLIT_ROOT_NREC + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1847,22 +1840,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1859;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1921;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to force redistribution of rightmost leaf */
record = u + INSERT_SPLIT_ROOT_NREC + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -1871,13 +1864,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1875;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1922;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -1885,7 +1878,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redistrib left-most leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -1894,13 +1887,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 94;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 32;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Add more records to left-most leaf, to force a 2->1 split and then a
@@ -1908,7 +1901,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
*/
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1918,13 +1911,13 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 47;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -1932,7 +1925,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redistrib middle leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -1941,22 +1934,22 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */
TEST_ERROR
record = 535;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
TEST_ERROR
record = 630;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
TEST_ERROR
record = 568;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
TEST_ERROR
/* Add more records to middle leaf, to force a split and a 3 node redistribution on middle leaf */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 2) + 1; u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 8) + (INSERT_SPLIT_ROOT_NREC / 2) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -1966,25 +1959,25 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1008;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0) /* Record in root node */
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0) /* Record in root node */
TEST_ERROR
record = 524;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node before insertion point */
TEST_ERROR
record = 577;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0) /* Record in middle node after insertion point */
TEST_ERROR
record = 568;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0) /* Record in leaf node just after insertion point */
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -1992,7 +1985,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2007,25 +2000,25 @@ test_insert_level2_leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -2034,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -2054,18 +2046,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 8); u++) {
record = u + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2)); u++) {
record = u + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2075,23 +2067,23 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1797; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1859; /* Right-most record in right-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert enough records to force right-most leaf to split */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC / 2) + 1); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 29) + (INSERT_SPLIT_ROOT_NREC / 2) + 2;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2101,16 +2093,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1828; /* Next-to-right-most record in right-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1860; /* Right-most record in right-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1891; /* Right-most record in right-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2118,7 +2110,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split left-most leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2127,18 +2119,18 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 63; /* Left-most record in left-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 1; /* Left-most record in left-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Add another record to left-most leaf, to force a 1->2 node split on left leaf */
record = 0;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2147,16 +2139,16 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 63; /* Left-most record in left-most internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 32; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0; /* Left-most record in left-most leaf */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2164,7 +2156,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split middle leaf in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2173,21 +2165,21 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 504; /* Record in internal node just before insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 568; /* Record in internal node just after insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 506; /* Record in leaf node just after insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Add another record to middle leaf, to force a node split on middle leaf */
record = (INSERT_SPLIT_ROOT_NREC * 8) + 1;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2196,28 +2188,28 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 946; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 504; /* Left-most record of split in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 537; /* Middle record of split in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 568; /* Right-most record of split in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 506; /* Record in leaf node just after insertion point */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2225,7 +2217,7 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2240,26 +2232,26 @@ test_insert_level2_leaf_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -2268,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -2288,14 +2279,14 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
/* And fill up right internal node, to just before to redistribute it */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 44); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2305,22 +2296,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1318; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3114; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3145; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to redistribute right-most internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 6) - 4;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2329,13 +2320,13 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1822; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3114; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3146; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2343,7 +2334,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: redist. 2 internal (l->r) in level 2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2352,19 +2343,19 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1822; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 436; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 374; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Force left-most internal node to redistribute */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 6) - 4); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2374,22 +2365,22 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1570; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 61; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2397,7 +2388,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2412,26 +2403,26 @@ test_insert_level2_2internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -2440,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -2460,14 +2450,14 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
/* (And fill up two child internal nodes) */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 59); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2477,22 +2467,22 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 2759; /* Record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 4555; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 4586; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split right-most internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2501,16 +2491,16 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 2759; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3704; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 4555; /* Right-most record in right internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 4387; /* Right-most record in right leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
PASSED();
@@ -2518,7 +2508,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree insert: split side internal node to 2 in level 2 B-tree (l->2)");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2527,19 +2517,19 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 2759; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 932; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 870; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Force left-most internal node to split */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 14) - (INSERT_SPLIT_ROOT_NREC / 4) + 3); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2549,25 +2539,25 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 870; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1814; /* Next-to-left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 61; /* Left-most record in left internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 0; /* Left-most record in left leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2575,7 +2565,7 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2590,27 +2580,27 @@ test_insert_level2_2internal_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -2619,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -2639,18 +2628,18 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 3 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 36); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2660,29 +2649,29 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 2267; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3199; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3137; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert records to fill up middle internal node */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 36);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2692,28 +2681,28 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3104; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3137; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3135; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert another record, forcing the middle internal node to redistribute */
record = u + (INSERT_SPLIT_ROOT_NREC * 36);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2722,30 +2711,30 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1574; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3104; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
#ifdef NONE
record = 2862; /* Record to left of insertion point in right internal node (now) */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
#endif /* NONE */
record = 3137; /* Record to right of insertion point in right internal node (now) */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 3135; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2753,7 +2742,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2768,27 +2757,27 @@ test_insert_level2_3internal_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -2797,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -2817,24 +2805,24 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 3 internal nodes */
/* (and fill right internal node) */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 31); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC * 74); u++) {
record = u + ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 3);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
@@ -2843,25 +2831,25 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 1952; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2884; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2822; /* Record just after insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Insert records to fill up middle internal node */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 13) + ((3 * INSERT_SPLIT_ROOT_NREC) / 4) + 2); u++) {
record = u + (INSERT_SPLIT_ROOT_NREC * 31);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -2871,28 +2859,28 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 2789; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2822; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2823; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split middle internal node */
record = u + (INSERT_SPLIT_ROOT_NREC * 31);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -2901,33 +2889,33 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 2789; /* Middle record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
record = 3703; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
#ifdef NONE
record = 3049; /* Record to left of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
#endif /* NONE */
record = 2822; /* Record to right of insertion point in middle internal node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 2823; /* Record just above insertion point in leaf node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -2935,7 +2923,7 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -2950,24 +2938,24 @@ test_insert_level2_3internal_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -2976,10 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -3030,7 +3017,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3038,13 +3025,13 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert random records */
for(u = 0; u < INSERT_MANY; u++) {
record = records[u];
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3055,7 +3042,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3068,7 +3055,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3076,7 +3063,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Check up on B-tree after re-open */
@@ -3087,7 +3074,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Iterate over B-tree to check records have been inserted correctly */
idx = 0;
- if(H5B2_iterate(bt2, dxpl, iter_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3097,7 +3084,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find non-existant record in level-4 B-tree */
/* (Should not be found, but not fail) */
idx = INSERT_MANY * 2;
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != FALSE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != FALSE)
TEST_ERROR
/* Find random records */
@@ -3106,19 +3093,19 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
idx = (hsize_t)(HDrandom()%INSERT_MANY);
/* Attempt to find existant record in root of level-4 B-tree */
- if(H5B2_find(bt2, dxpl, &idx, find_cb, &idx) != TRUE)
+ if(H5B2_find(bt2, &idx, find_cb, &idx) != TRUE)
FAIL_STACK_ERROR
} /* end for */
/* Attempt to index non-existant record in level-4 B-tree, in increasing & decreasing order */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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, dxpl, 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)
@@ -3131,12 +3118,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Attempt to find existant record in root of level-4 B-tree */
/* (in increasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, find_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, idx, find_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Attempt to find existant record in root of level-4 B-tree */
/* (in decreasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0)
+ if(H5B2_index(bt2, H5_ITER_DEC, idx, find_dec_cb, &idx) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3145,12 +3132,12 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TESTING("B-tree insert: attempt duplicate record in level 4 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = INSERT_MANY / 2;
H5E_BEGIN_TRY {
- ret = H5B2_insert(bt2, dxpl, &record);
+ ret = H5B2_insert(bt2, &record);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -3165,7 +3152,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3182,23 +3169,23 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -3207,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -3222,7 +3208,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/*
@@ -3231,47 +3217,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: inserting first record in empty B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record.key = 42;
record.val = 72;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find existant record in B-tree with 1 record */
find.key = 42;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != 72)
TEST_ERROR
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != TRUE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -3279,7 +3265,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with 1 record */
find.key = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3295,47 +3281,47 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: update only record in B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
modify.key = 42;
modify.val = 43;
- if(H5B2_update(bt2, dxpl, &modify, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &modify, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in B-tree with 1 record */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Try again with NULL 'op' */
/* (Should not be found, but not fail) */
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != FALSE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != FALSE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find modified record in B-tree with 1 record */
find.key = 42;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != 43)
TEST_ERROR
/* Try again with NULL 'op' */
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, NULL, NULL) != TRUE)
+ if(H5B2_find(bt2, &find, NULL, NULL) != TRUE)
FAIL_STACK_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with 1 record */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -3344,7 +3330,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with 1 record */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3360,7 +3346,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: insert several records");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/*
@@ -3368,7 +3354,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
*/
record.key = 34;
record.val = 11;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -3376,7 +3362,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
*/
record.key = 56;
record.val = 12;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/*
@@ -3384,28 +3370,28 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
*/
record.key = 38;
record.val = 13;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
find.key = 10;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several records */
find.key = 56;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
TEST_ERROR
if(find.val != 12)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -3414,7 +3400,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with several records */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 34)
TEST_ERROR
@@ -3422,7 +3408,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 38)
TEST_ERROR
@@ -3430,7 +3416,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3438,7 +3424,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 56)
TEST_ERROR
@@ -3456,43 +3442,43 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
record.key = 34;
modify.key = 34;
modify.val = 21;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
record.key = 38;
modify.key = 38;
modify.val = 23;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
record.key = 42;
modify.key = 42;
modify.val = 24;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
record.key = 56;
modify.key = 56;
modify.val = 22;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Attempt to find non-existant record in level-0 B-tree with several records */
/* (Should not be found, but not fail) */
find.key = 41;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
/* Attempt to find existant record in level-0 B-tree with several record */
find.key = 56;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
TEST_ERROR
if(find.val != 22)
TEST_ERROR
/* Attempt to index non-existant record in B-tree with several records */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -3501,7 +3487,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in B-tree with several records */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 34)
TEST_ERROR
@@ -3509,7 +3495,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 38)
TEST_ERROR
@@ -3517,7 +3503,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)2, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 42)
TEST_ERROR
@@ -3525,7 +3511,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)3, index_rec_cb, &find) < 0)
TEST_ERROR
if(find.key != 56)
TEST_ERROR
@@ -3533,7 +3519,7 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3550,25 +3536,25 @@ test_update_basic(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -3577,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -3600,14 +3585,14 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records to fill root leaf node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC - 1); u++) {
record.key = u + 2;
record.val = u * 2 + 4;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3617,17 +3602,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert record to split root leaf node */
record.key = INSERT_SPLIT_ROOT_NREC_REC + 1;
record.val = (INSERT_SPLIT_ROOT_NREC_REC - 1) * 2 + 4;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -3636,13 +3621,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 2;
idx.val = 4;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3650,7 +3635,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Modify all records */
@@ -3658,7 +3643,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
record.key = u + 2;
modify.key = u + 2;
modify.val = u * 2 + 5;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3668,13 +3653,13 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 2;
idx.val = 5;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3683,17 +3668,17 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert a couple more records, on the left side of the B-tree */
record.key = 0;
record.val = 1;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = 1;
record.val = 3;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check up on B-tree */
@@ -3702,18 +3687,18 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 33;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 1;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -3724,7 +3709,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = 800;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -3732,7 +3717,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-1 B-tree */
find.key = 33;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.key != 33)
TEST_ERROR
@@ -3742,7 +3727,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in leaf of level-1 B-tree */
find.key = 56;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.key != 56)
TEST_ERROR
@@ -3751,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, dxpl, 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)
@@ -3760,7 +3745,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)33, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 33)
TEST_ERROR
@@ -3770,7 +3755,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in left leaf of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)0, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 0)
TEST_ERROR
@@ -3780,7 +3765,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in right leaf of level-1 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)50, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 50)
TEST_ERROR
@@ -3788,7 +3773,7 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3802,26 +3787,26 @@ test_update_split_root(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -3830,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -3849,14 +3833,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
record.val = u + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3866,11 +3850,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = INSERT_SPLIT_ROOT_NREC_REC;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
@@ -3878,7 +3862,7 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) {
record.key = u;
record.val = u + 9;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3888,11 +3872,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3904,14 +3888,14 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: redistribute 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 9;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3921,18 +3905,18 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force redistribution from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 9;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -3942,11 +3926,11 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) + (INSERT_SPLIT_ROOT_NREC_REC / 4) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -3961,26 +3945,26 @@ test_update_level1_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -3989,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -4008,14 +3991,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4025,18 +4008,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4046,14 +4029,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 31;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 64;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4065,14 +4048,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: split side leaf into 2 leaves in level 1 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = u + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4082,18 +4065,18 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force right node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = u + INSERT_SPLIT_ROOT_NREC_REC + 10;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4103,14 +4086,14 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 63;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 95;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4125,28 +4108,28 @@ test_update_level1_side_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -4155,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -4175,14 +4157,14 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1);
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4192,18 +4174,18 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC);
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force left node to split */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4213,21 +4195,21 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = INSERT_SPLIT_ROOT_NREC_REC + (INSERT_SPLIT_ROOT_NREC_REC / 2) + 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert records to force middle node to redistribute */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC_REC / 2) + 1); u++) {
record.key = u + INSERT_SPLIT_ROOT_NREC_REC;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4237,20 +4219,20 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 52;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 107;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4258,7 +4240,7 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4273,27 +4255,27 @@ test_update_level1_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -4302,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -4322,14 +4303,14 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC_REC; u++) {
record.key = u + (INSERT_SPLIT_ROOT_NREC_REC * 2);
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4339,18 +4320,18 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = (2 * INSERT_SPLIT_ROOT_NREC_REC) + (INSERT_SPLIT_ROOT_NREC_REC / 2) - 1;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Force split from left node into right node */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 2); u++) {
record.key = u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4360,23 +4341,23 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 63;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 95;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record.key = 128;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4384,7 +4365,7 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4399,23 +4380,23 @@ test_update_level1_middle_split(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -4424,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -4446,20 +4426,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = u + 2; /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = u + 4; /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4469,42 +4449,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 1347;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to left-most leaf */
record.key = 0;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = 1;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 2;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 9) + 3;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4515,7 +4495,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -4523,45 +4503,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1347;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (1347 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 1347;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (513 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 513;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (555 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -4570,7 +4550,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1347, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 1347)
TEST_ERROR
@@ -4580,7 +4560,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 513)
TEST_ERROR
@@ -4590,7 +4570,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 555)
TEST_ERROR
@@ -4598,7 +4578,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4611,20 +4591,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: make level 2 B-tree (r->l)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 1) - (u +2); /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4634,42 +4614,42 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 1344;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to right-most leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 2;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 3;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9));
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 1;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4680,7 +4660,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -4688,45 +4668,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1344;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (1344 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 1344;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 512;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (512 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 512;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (555 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -4735,7 +4715,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in root of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1344, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 1344)
TEST_ERROR
@@ -4745,7 +4725,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)512, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 512)
TEST_ERROR
@@ -4755,7 +4735,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 555)
TEST_ERROR
@@ -4763,7 +4743,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4776,20 +4756,20 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree update: make level 2 B-tree (l+r->middle)");
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert enough records to force root to split into 2 internal nodes */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC_REC * 9); u++) {
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) + 3) - u;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
for(; u < (INSERT_SPLIT_ROOT_NREC_REC * 41); u++) {
record.key = u - ((INSERT_SPLIT_ROOT_NREC_REC * 9) - 2); /* Leave a gap for later insertion */
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -4799,52 +4779,52 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
if(check_stats(bt2, &bt2_stat) < 0)
TEST_ERROR
record.key = 1345;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Add some extra records to right-most leaf */
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 4;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = (INSERT_SPLIT_ROOT_NREC_REC * 41) + 5;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to middle leaf */
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 2;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = ((INSERT_SPLIT_ROOT_NREC_REC * 41) - (INSERT_SPLIT_ROOT_NREC_REC * 9)) + 3;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Add some extra records to left-most leaf */
record.key = 0;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
record.key = 1;
record.val = record.key * 2;
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Iterate over B-tree to check records have been inserted correctly */
idx.key = 0;
idx.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &idx) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &idx) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -4855,7 +4835,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* (Should not be found, but not fail) */
find.key = INSERT_SPLIT_ROOT_NREC_REC * 42;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -4863,45 +4843,45 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to find existant record in root of level-2 B-tree */
find.key = 1345;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (1345 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 1345;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
/* Attempt to find existant record in internal node of level-2 B-tree */
find.key = 513;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (513 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 513;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Attempt to find existant record in leaf of level-2 B-tree */
find.key = 555;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (555 * 2))
TEST_ERROR
/* Check with B-tree */
record.key = 555;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
/* Attempt to index non-existant record in level-2 B-tree */
H5E_BEGIN_TRY {
- ret = H5B2_index(bt2, dxpl, 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)
@@ -4910,7 +4890,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)1345, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 1345)
TEST_ERROR
@@ -4920,7 +4900,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in internal node of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)513, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 513)
TEST_ERROR
@@ -4930,7 +4910,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to index existing record in leaf of level-2 B-tree */
find.key = (hsize_t)-1;
find.val = (hsize_t)-1;
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, (hsize_t)555, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != 555)
TEST_ERROR
@@ -4938,7 +4918,7 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -4953,23 +4933,23 @@ test_update_make_level2(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -4978,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -5033,13 +5012,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert random records */
for(u = 0; u < INSERT_MANY_REC; u++) {
record = records[u];
- if(H5B2_update(bt2, dxpl, &record, no_modify_cb, NULL) < 0)
+ if(H5B2_update(bt2, &record, no_modify_cb, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -5050,7 +5029,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5064,7 +5043,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Check up on B-tree after re-open */
@@ -5076,7 +5055,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Iterate over B-tree to check records have been inserted correctly */
iter.key = 0;
iter.val = 0;
- if(H5B2_iterate(bt2, dxpl, iter_rec_cb, &iter) < 0)
+ if(H5B2_iterate(bt2, iter_rec_cb, &iter) < 0)
FAIL_STACK_ERROR
/* Make certain that the index is correct */
@@ -5087,7 +5066,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* (Should not be found, but not fail) */
find.key = INSERT_MANY_REC * 2;
find.val = (hsize_t)-1;
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != FALSE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != FALSE)
TEST_ERROR
if(find.val != (hsize_t)-1)
TEST_ERROR
@@ -5099,7 +5078,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
find.val = (hsize_t)-1;
/* Attempt to find existant record in level-4 B-tree */
- if(H5B2_find(bt2, dxpl, &find, find_rec_cb, &find) != TRUE)
+ if(H5B2_find(bt2, &find, find_rec_cb, &find) != TRUE)
FAIL_STACK_ERROR
if(find.val != (find.key * 2))
TEST_ERROR
@@ -5107,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, dxpl, 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, dxpl, 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)
@@ -5132,7 +5111,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existant record in level-4 B-tree */
/* (in increasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_INC, idx, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_INC, idx, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != idx)
TEST_ERROR
@@ -5145,7 +5124,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
/* Attempt to find existant record in level-4 B-tree */
/* (in decreasing order) */
- if(H5B2_index(bt2, dxpl, H5_ITER_DEC, idx, index_rec_cb, &find) < 0)
+ if(H5B2_index(bt2, H5_ITER_DEC, idx, index_rec_cb, &find) < 0)
FAIL_STACK_ERROR
if(find.key != (INSERT_MANY_REC - (idx + 1)))
TEST_ERROR
@@ -5158,13 +5137,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TESTING("B-tree update: update record in level 4 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record.key = INSERT_MANY_REC / 2;
modify.key = INSERT_MANY_REC / 2;
modify.val = record.key * 3;
- if(H5B2_update(bt2, dxpl, &record, modify_rec_cb, &modify) < 0)
+ if(H5B2_update(bt2, &record, modify_rec_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Query the number of records in the B-tree */
@@ -5176,7 +5155,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5194,24 +5173,24 @@ error:
HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -5220,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -5239,7 +5217,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5253,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, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5264,12 +5242,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: non-existant record from 1 record B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert one record into B-tree */
record = 42;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Query the number of records in the B-tree */
@@ -5281,7 +5259,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -5291,7 +5269,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
/* Attempt to remove a non-existant record from a B-tree with 1 record */
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5303,12 +5281,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: existant record from 1 record B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 42;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5324,7 +5302,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has been freed */
@@ -5337,21 +5315,21 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: adding records to B-tree after removal");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Insert several records into B-tree again */
record = 42;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 34;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 56;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
record = 38;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
/* Query the number of records in the B-tree */
@@ -5368,12 +5346,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: non-existant record from level-0 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 0;
H5E_BEGIN_TRY {
- ret = H5B2_remove(bt2, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5385,12 +5363,12 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: mult. existant records from level-0 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 42;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5406,7 +5384,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has not been freed */
@@ -5415,7 +5393,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 34;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5431,7 +5409,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has not been freed */
@@ -5440,7 +5418,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 56;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5456,7 +5434,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has not been freed */
@@ -5465,7 +5443,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
record = 38;
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5481,7 +5459,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the root node has been freed */
@@ -5489,7 +5467,7 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5504,22 +5482,22 @@ test_remove_basic(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -5528,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -5548,13 +5525,13 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -5567,7 +5544,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -5577,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, dxpl, &record, NULL, NULL);
+ ret = H5B2_remove(bt2, &record, NULL, NULL);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -5597,22 +5574,22 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: record from right leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = (INSERT_SPLIT_ROOT_NREC * 2) - 2;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5621,10 +5598,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5641,16 +5618,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: record from left leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
record = 0;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
rrecord = 1;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5659,10 +5636,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5679,16 +5656,16 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: record from middle leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check up on B-tree */
record = INSERT_SPLIT_ROOT_NREC;
- if(check_node_depth(bt2, dxpl, &record, (unsigned)0) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)0) < 0)
TEST_ERROR
rrecord = 0;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5697,10 +5674,10 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Make certain that the leaf nodes didn't redistribute */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5712,7 +5689,7 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5727,22 +5704,22 @@ test_remove_level1_noredistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -5751,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -5770,22 +5746,22 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 94; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5797,7 +5773,7 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -5805,14 +5781,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */
for(u = 0; u < 8; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5830,10 +5806,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 90; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
PASSED();
@@ -5842,13 +5818,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: redistribute 2 leaves in level-1 B-tree (l->r)");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
for(u = 0; u < 39; u++) {
record = u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5866,10 +5842,10 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 64; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 90; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
PASSED();
@@ -5878,13 +5854,13 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: redistribute 3 leaves in level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
for(u = 0; u < 2; u++) {
record = INSERT_SPLIT_ROOT_NREC + 2 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -5902,14 +5878,14 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 64; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 91; /* Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -5924,22 +5900,22 @@ test_remove_level1_redistrib(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -5948,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -5967,24 +5942,24 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -5996,7 +5971,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6004,14 +5979,14 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove enough records from right leaf of a level-1 B-tree to force redistribution */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6031,7 +6006,7 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 62; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
PASSED();
@@ -6040,31 +6015,31 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (l->r)");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Fill B-tree back up */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC / 4); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Remove records */
for(u = 0; u < ((3 * INSERT_SPLIT_ROOT_NREC) / 4) - 1; u++) {
record = u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6084,11 +6059,11 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 94; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6103,22 +6078,22 @@ test_remove_level1_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -6127,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -6146,24 +6120,24 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6175,7 +6149,7 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6183,14 +6157,14 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove enough records from middle leaf of a level-1 B-tree to force merge */
for(u = 0; u < ((5 * INSERT_SPLIT_ROOT_NREC) / 6) - 1; u++) {
record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6210,11 +6184,11 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 37; /* Only record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6229,22 +6203,22 @@ test_remove_level1_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -6253,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -6272,30 +6245,30 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 5 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 4); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 125; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 220; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6307,7 +6280,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6315,13 +6288,13 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
record = 220;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6330,18 +6303,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 125; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6362,12 +6335,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from left leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 62;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6376,18 +6349,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 63; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 125; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6404,12 +6377,12 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from middle leaf of level-1 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
record = 125;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6418,18 +6391,18 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
/* Check record values in root of B-tree */
record = 63; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 126; /* Center-Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
record = 188; /* Center-Right record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 4;
record = 221; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6441,7 +6414,7 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6456,22 +6429,22 @@ test_remove_level1_promote(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -6480,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -6499,24 +6471,24 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6528,7 +6500,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6536,7 +6508,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
@@ -6545,7 +6517,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
for(u = 0; u < 7; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6563,7 +6535,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
record = 94;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6572,12 +6544,12 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 90; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6589,7 +6561,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6604,22 +6576,22 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -6628,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -6647,24 +6618,24 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6676,7 +6647,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6684,7 +6655,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */
@@ -6693,7 +6664,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
for(u = 0; u < 7; u++) {
record = 63 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6711,7 +6682,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
record = 62;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6720,12 +6691,12 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
/* Check record values in root of B-tree */
record = 39; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 86; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6737,7 +6708,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6752,22 +6723,22 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -6776,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -6795,24 +6765,24 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6824,7 +6794,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6832,7 +6802,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from right leaf */
@@ -6841,7 +6811,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
for(u = 0; u < 14; u++) {
record = (INSERT_SPLIT_ROOT_NREC * 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6859,7 +6829,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
record = 87;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -6870,7 +6840,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 62; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6882,7 +6852,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -6897,22 +6867,22 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -6921,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -6940,24 +6909,24 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 leaves */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 2); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 62; /* Left-most record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)1) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)1) < 0)
TEST_ERROR
ninfo.depth = 1;
ninfo.nrec = 2;
record = 94; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -6969,7 +6938,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -6977,7 +6946,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from root node of a level-1 B-tree to force promotion from middle leaf */
@@ -6986,7 +6955,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
for(u = 0; u < 50; u++) {
record = ((3 * INSERT_SPLIT_ROOT_NREC) / 2) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7004,7 +6973,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
record = 25;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7015,7 +6984,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 37; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7027,7 +6996,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7042,22 +7011,22 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -7066,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -7085,13 +7053,13 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-1 B-tree with 2 leaves */
for(u = 0; u < INSERT_SPLIT_ROOT_NREC; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -7099,7 +7067,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 1;
record = 31; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7111,7 +7079,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7119,14 +7087,14 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from B-tree to force a single leaf for the B-tree */
for(u = 0; u < 14; u++) {
record = INSERT_SPLIT_ROOT_NREC - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7146,7 +7114,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 0;
ninfo.nrec = (uint16_t)(INSERT_SPLIT_ROOT_NREC - u);
record = 31; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7158,7 +7126,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7166,7 +7134,7 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7181,22 +7149,22 @@ test_remove_level1_collapse(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -7205,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -7224,24 +7191,24 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7253,7 +7220,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7261,20 +7228,20 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2960; /* Record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion */
record = 2960;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7285,7 +7252,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2961; /* Record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7302,19 +7269,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from left internal of level-2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 1133; /* Record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 1133;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7325,7 +7292,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 29;
record = 1134; /* Record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7342,19 +7309,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote from middle internal of level-2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in middle internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2267; /* Record in middle internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 2267;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7365,7 +7332,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 14;
record = 2268; /* Record in middle internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7382,19 +7349,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree remove: promote record from root of level-2 B-tree");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 1889; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 1889;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7405,7 +7372,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 2;
record = 1890; /* Left record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7417,19 +7384,19 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in root node */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
record = 2834;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7440,7 +7407,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2835; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7452,7 +7419,7 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7467,22 +7434,22 @@ test_remove_level2_promote(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -7491,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -7510,24 +7476,24 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7539,7 +7505,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7547,21 +7513,21 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3685; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 8; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7579,7 +7545,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
record = 3685;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7590,7 +7556,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3681; /* Right-most record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7602,7 +7568,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7617,22 +7583,22 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl, const H5B2_create_t *
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -7641,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -7660,24 +7625,24 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7689,7 +7654,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7697,21 +7662,21 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 62; /* Left-most record in left node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 38; u++) {
record = 63 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7729,7 +7694,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
record = 62;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7740,7 +7705,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
ninfo.depth = 1;
ninfo.nrec = 29;
record = 49; /* Left-most record in left node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7752,7 +7717,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7767,22 +7732,22 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl, const H5B2_create_t *
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -7791,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -7810,24 +7774,24 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7839,7 +7803,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7847,21 +7811,21 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in right internal node */
ninfo.depth = 1;
ninfo.nrec = 14;
record = 3685; /* Right-most record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from right internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 15; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7880,7 +7844,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
/* Force merge by promoting current right-most record */
record = 3678;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -7891,7 +7855,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
ninfo.depth = 1;
ninfo.nrec = 13;
record = 3653; /* Right-most record in right internal node (now) */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7903,7 +7867,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -7918,22 +7882,22 @@ test_remove_level2_promote_2internal_merge(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -7942,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -7961,24 +7924,24 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -7990,7 +7953,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -7998,21 +7961,21 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check information about record in left internal node */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 62; /* Left-most record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to remove record from left internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < 112; u++) {
record = 48 + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8031,7 +7994,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
/* Force merge of left-most internal nodes by promotion */
record = 25;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8042,7 +8005,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
ninfo.depth = 1;
ninfo.nrec = 28;
record = 37; /* Left-most record in left internal node (now) */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8054,7 +8017,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8069,22 +8032,22 @@ test_remove_level2_promote_3internal_merge(hid_t fapl, const H5B2_create_t *cpar
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -8093,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -8112,24 +8074,24 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8141,7 +8103,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8149,14 +8111,14 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 21) + 15); u++) {
record = u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8176,11 +8138,11 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 1;
record = 2834; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8195,22 +8157,22 @@ test_remove_level2_2internal_merge_left(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -8219,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -8238,24 +8199,24 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8267,7 +8228,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8275,14 +8236,14 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from a level-2 B-tree to force 2 internal nodes to merge */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 5) + 17); u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8302,11 +8263,11 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1889; /* Middle record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8321,22 +8282,22 @@ test_remove_level2_2internal_merge_right(hid_t fapl, const H5B2_create_t *cparam
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -8345,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -8364,24 +8324,24 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8393,7 +8353,7 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8401,14 +8361,14 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove record from middle internal node of a level-2 B-tree to force promotion w/redistribution */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 23) + 15); u++) {
record = (INSERT_SPLIT_ROOT_NREC * 20) + u;
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8428,11 +8388,11 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1196; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8447,22 +8407,22 @@ test_remove_level2_3internal_merge(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -8471,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -8491,24 +8450,24 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check record values in root of B-tree */
record = 1889; /* Left record in root node */
- if(check_node_depth(bt2, dxpl, &record, (unsigned)2) < 0)
+ if(check_node_depth(bt2, &record, (unsigned)2) < 0)
TEST_ERROR
ninfo.depth = 2;
ninfo.nrec = 2;
record = 2834; /* Right record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Query the number of records in the B-tree */
@@ -8520,7 +8479,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8528,14 +8487,14 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to remove records from a level-2 B-tree to force back to level-1 */
for(u = 0; u < (INSERT_SPLIT_ROOT_NREC * 34) + 17; u++) {
record = ((INSERT_SPLIT_ROOT_NREC * 59) + 1) - (u + 1);
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8558,7 +8517,7 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8573,22 +8532,22 @@ test_remove_level2_collapse_right(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -8597,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -8610,7 +8568,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8618,13 +8576,13 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, bt2_addr) < 0)
TEST_ERROR
/* Insert random records */
for(u = 0; u < INSERT_MANY; u++) {
record = records[u];
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -8635,7 +8593,7 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8648,25 +8606,25 @@ gen_l4_btree2(const char *filename, hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -8674,13 +8632,12 @@ 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 */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
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 */
@@ -8765,7 +8722,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8784,14 +8741,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
record = records[u];
rrecord = HSIZET_MAX;
- if(H5B2_remove(bt2, dxpl, &record, remove_cb, &rrecord) < 0)
+ if(H5B2_remove(bt2, &record, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8808,7 +8765,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8816,7 +8773,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8860,7 +8817,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8868,7 +8825,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
@@ -8878,7 +8835,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
rrecord = HSIZET_MAX;
/* Remove random record */
- if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0)
+ if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)rem_idx, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8895,7 +8852,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8903,7 +8860,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -8948,7 +8905,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -8956,14 +8913,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
/* Remove first record */
rrecord = HSIZET_MAX;
- if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0)
+ if(H5B2_remove_by_idx(bt2, H5_ITER_INC, (hsize_t)0, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -8980,7 +8937,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -8988,7 +8945,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9033,7 +8990,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9041,14 +8998,14 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
/* Remove last record */
rrecord = HSIZET_MAX;
- if(H5B2_remove_by_idx(bt2, dxpl, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0)
+ if(H5B2_remove_by_idx(bt2, H5_ITER_DEC, (hsize_t)0, remove_cb, &rrecord) < 0)
FAIL_STACK_ERROR
/* Make certain that the record value is correct */
@@ -9065,7 +9022,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
} /* end for */
/* Query the address of the root node in the B-tree */
- if(H5B2_get_root_addr_test(bt2, &root_addr) < 0)
+ if(H5B2__get_root_addr_test(bt2, &root_addr) < 0)
FAIL_STACK_ERROR
/* Make certain that the address of the root node is defined */
@@ -9073,7 +9030,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9093,8 +9050,8 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ H5Fclose(file);
} H5E_END_TRY;
if(fd > 0)
@@ -9107,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
*
*-------------------------------------------------------------------------
@@ -9126,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -9156,45 +9112,45 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < FIND_NEIGHBOR; u++) {
record = records[u];
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Attempt to find record B-tree less than a value */
search = 0;
H5E_BEGIN_TRY {
- ret = H5B2_neighbor(bt2, dxpl, 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)
TEST_ERROR
search = 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 0)
TEST_ERROR
search = 2;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 0)
TEST_ERROR
search = 3;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
search = 4;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
@@ -9203,12 +9159,12 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 14;
record = 250; /* Record in left internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Neighbor is in internal node */
search = 251;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 250)
TEST_ERROR
@@ -9217,18 +9173,18 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 2;
ninfo.nrec = 1;
record = 1888; /* Record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Neighbor is in root node */
search = 1889;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 1888)
TEST_ERROR
search = (FIND_NEIGHBOR * 2) + 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_LESS, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != ((FIND_NEIGHBOR - 1) * 2))
TEST_ERROR
@@ -9241,38 +9197,38 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree find: nearest neighbor greater than a value");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Attempt to find record B-tree less than a value */
search = (FIND_NEIGHBOR * 2) + 1;
H5E_BEGIN_TRY {
- ret = H5B2_neighbor(bt2, dxpl, 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)
TEST_ERROR
search = 0;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
search = 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2)
TEST_ERROR
search = 2;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 4)
TEST_ERROR
search = 3;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 4)
TEST_ERROR
@@ -9281,31 +9237,31 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
ninfo.depth = 1;
ninfo.nrec = 16;
record = 2896; /* Record in right internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Neighbor is in internal node */
search = 2895;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 2896)
TEST_ERROR
/* Neighbor is in root node */
search = 1887;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != 1888)
TEST_ERROR
search = ((FIND_NEIGHBOR - 1) * 2) - 1;
- if(H5B2_neighbor(bt2, dxpl, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
+ if(H5B2_neighbor(bt2, H5B2_COMPARE_GREATER, &search, neighbor_cb, &record) < 0)
FAIL_STACK_ERROR
if(record != ((FIND_NEIGHBOR - 1) * 2))
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9322,24 +9278,24 @@ test_find_neighbor(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -9347,12 +9303,11 @@ 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 */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
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 */
@@ -9383,7 +9338,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9391,18 +9346,18 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -9427,7 +9382,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9435,13 +9390,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < DELETE_SMALL; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9452,14 +9407,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, H5AC_ind_read_dxpl_id, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -9484,7 +9439,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9492,13 +9447,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < DELETE_MEDIUM; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9509,14 +9464,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -9541,7 +9496,7 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9549,13 +9504,13 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Insert records */
for(u = 0; u < DELETE_LARGE; u++) {
record = u;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9566,14 +9521,14 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
/*
* Delete v2 B-tree
*/
- if(H5B2_delete(f, dxpl, bt2_addr, f, NULL, NULL) < 0)
+ if(H5B2_delete(f, bt2_addr, f, NULL, NULL) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -9595,23 +9550,23 @@ test_delete(hid_t fapl, const H5B2_create_t *cparam)
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -9620,9 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -9643,13 +9597,13 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TEST_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Create level-2 B-tree with 3 internal nodes */
for(u = 0; u < ((INSERT_SPLIT_ROOT_NREC * 59) + 1); u++) {
record = u * 5;
- if(H5B2_insert(bt2, dxpl, &record) < 0)
+ if(H5B2_insert(bt2, &record) < 0)
FAIL_STACK_ERROR
} /* end for */
@@ -9663,7 +9617,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 3;
modify = 4;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9674,33 +9628,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree modify: modify record in leaf node");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 0;
ninfo.nrec = 62;
record = 4330; /* Record in leaf node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to modify a record in a leaf node */
record = 4330;
modify = 4331;
- if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0)
+ if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Check status of B-tree */
ninfo.depth = 0;
ninfo.nrec = 62;
record = 4331; /* Record in leaf node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to find modified record */
record = 4331;
found = 4331;
- if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE)
+ if(H5B2_find(bt2, &record, find_cb, &found) != TRUE)
FAIL_STACK_ERROR
if(found != 4331)
TEST_ERROR
@@ -9709,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, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9720,33 +9674,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree modify: modify record in internal node");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 5350; /* Record in internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to modify a record in an internal node */
record = 5350;
modify = 5352;
- if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0)
+ if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Check status of B-tree */
ninfo.depth = 1;
ninfo.nrec = 29;
record = 5352; /* Record in internal node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to find modified record */
record = 5352;
found = 5352;
- if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE)
+ if(H5B2_find(bt2, &record, find_cb, &found) != TRUE)
STACK_ERROR
if(found != 5352)
TEST_ERROR
@@ -9755,7 +9709,7 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 5350;
found = 5350;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
@@ -9766,33 +9720,33 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
TESTING("B-tree modify: modify record in root node");
/* Check for closing & re-opening the B-tree */
- if(reopen_btree(f, dxpl, &bt2, bt2_addr, tparam) < 0)
+ if(reopen_btree(f, &bt2, bt2_addr, tparam) < 0)
TEST_ERROR
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 9445; /* Record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to modify a record in a root node */
record = 9445;
modify = 9448;
- if(H5B2_modify(bt2, dxpl, &record, modify_cb, &modify) < 0)
+ if(H5B2_modify(bt2, &record, modify_cb, &modify) < 0)
FAIL_STACK_ERROR
/* Check status of B-tree */
ninfo.depth = 2;
ninfo.nrec = 2;
record = 9448; /* Record in root node */
- if(check_node_info(bt2, dxpl, record, &ninfo) < 0)
+ if(check_node_info(bt2, record, &ninfo) < 0)
TEST_ERROR
/* Attempt to find modified record */
record = 9448;
found = 9448;
- if(H5B2_find(bt2, dxpl, &record, find_cb, &found) != TRUE)
+ if(H5B2_find(bt2, &record, find_cb, &found) != TRUE)
STACK_ERROR
if(found != 9448)
TEST_ERROR
@@ -9801,14 +9755,14 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
record = 9445;
found = 9445;
H5E_BEGIN_TRY {
- ret = H5B2_modify(bt2, dxpl, &record, modify_cb, &modify);
+ ret = H5B2_modify(bt2, &record, modify_cb, &modify);
} H5E_END_TRY;
/* Should fail */
if(ret != FAIL)
TEST_ERROR
/* Close the v2 B-tree */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9823,24 +9777,24 @@ test_modify(hid_t fapl, const H5B2_create_t *cparam,
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
- H5Fclose(file);
+ H5B2_close(bt2);
+ 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
*
*-------------------------------------------------------------------------
@@ -9848,15 +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 dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
+ 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 */
@@ -9873,7 +9826,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -9881,15 +9834,15 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Create the v2 B-tree & get its address */
- if(create_btree(f, dxpl, cparam, &bt2, &bt2_addr) < 0)
+ if(create_btree(f, cparam, &bt2, &bt2_addr) < 0)
TEST_ERROR
/* Re-open v2 B-tree */
- if(NULL == (bt2_2 = H5B2_open(f, dxpl, bt2_addr, f)))
+ if(NULL == (bt2_2 = H5B2_open(f, bt2_addr, f)))
FAIL_STACK_ERROR
/* Close the second v2 B-tree wrapper */
- if(H5B2_close(bt2_2, dxpl) < 0)
+ if(H5B2_close(bt2_2) < 0)
FAIL_STACK_ERROR
bt2_2 = NULL;
@@ -9901,7 +9854,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Close the first v2 B-tree wrapper */
- if(H5B2_close(bt2, dxpl) < 0)
+ if(H5B2_close(bt2) < 0)
FAIL_STACK_ERROR
bt2 = NULL;
@@ -9927,11 +9880,11 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the B-tree through the second file handle */
- if(NULL == (bt2_2 = H5B2_open(f2, dxpl, bt2_addr, f2)))
+ if(NULL == (bt2_2 = H5B2_open(f2, bt2_addr, f2)))
FAIL_STACK_ERROR
/* Close the extra file handles */
@@ -9941,7 +9894,7 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
FAIL_STACK_ERROR
/* Close the second v2 B-tree */
- if(H5B2_close(bt2_2, dxpl) < 0)
+ if(H5B2_close(bt2_2) < 0)
FAIL_STACK_ERROR
bt2_2 = NULL;
@@ -9958,28 +9911,28 @@ test_open_twice_diff(hid_t fapl, const H5B2_create_t *cparam)
error:
H5E_BEGIN_TRY {
if(bt2)
- H5B2_close(bt2, dxpl);
+ H5B2_close(bt2);
if(bt2)
- H5B2_close(bt2_2, dxpl);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5B2_close(bt2_2);
+ 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
*
*-------------------------------------------------------------------------
@@ -9989,11 +9942,12 @@ 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 */
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
@@ -10004,19 +9958,23 @@ 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);
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* 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 */
@@ -10036,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);
@@ -10050,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);
@@ -10077,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);
@@ -10097,6 +10055,10 @@ main(void)
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
if(nerrors)
goto error;
@@ -10113,6 +10075,8 @@ error:
H5Pclose(fapl);
} H5E_END_TRY;
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */
diff --git a/test/cache.c b/test/cache.c
index 3df8156..bb18728 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -14,85 +14,126 @@
/* 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"
+#include "H5MFprivate.h"
+
+
+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.
+ */
+
+haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the
+ * space allocated for cache items in the file between
+ * cache setup & takedown
+ */
+
+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.
+ */
+
+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.
+ */
+
+hid_t saved_fid = -1; /* store the file id here between cache setup
+ * and takedown.
+ */
+hbool_t write_permitted = TRUE;
+hbool_t try_core_file_driver = FALSE;
+hbool_t core_file_driver_failed = FALSE;
+
+
+/* global variable declarations: */
+
+const char *FILENAME[] = {
+ "cache_test",
+ NULL
+};
-
/* 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 +177,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 +191,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 +245,13 @@ static unsigned check_stats(unsigned paged);
static void check_stats__smoke_check_1(H5F_t * file_ptr);
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
+static H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged);
+
+static void takedown_cache(H5F_t * file_ptr,
+ hbool_t dump_stats,
+ hbool_t dump_detailed_stats);
+
/**************************************************************************/
/**************************************************************************/
/********************************* tests: *********************************/
@@ -212,15 +259,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 +298,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 +336,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 +346,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 +365,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 +374,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 +384,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 +404,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 +429,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 +463,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 +505,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 +543,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 +553,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 +572,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 +581,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 +591,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 +611,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 +636,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 +670,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 +711,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 +749,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 +759,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 +778,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 +787,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 +797,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 +817,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 +842,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 +876,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 +918,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 +956,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 +966,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 +985,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 +994,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 +1004,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 +1024,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 +1049,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 +1083,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 +1140,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 +1173,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 +1327,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 +1384,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 +1419,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 +1571,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 +1628,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 +1662,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 +1816,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 +1873,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 +1907,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 +2061,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 +2113,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 +2160,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 +2169,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 +2179,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 +2196,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 +2215,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 +2230,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 +2239,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 +2249,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 +2264,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 +2290,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 +2299,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 +2330,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 +2339,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 +2359,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 +2389,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 +2441,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 +2480,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 +2490,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 +2505,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 +2524,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 +2539,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 +2548,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 +2558,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 +2573,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 +2599,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 +2608,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 +2628,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 +2654,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 +2663,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 +2683,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 +2712,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 +2759,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 +2797,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 +2807,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 +2828,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 +2839,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 +2849,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 +2869,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 +2885,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 +2921,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 +2929,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 +3007,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 +3021,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,26 +3154,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->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 */
- (cache_ptr->cLRU_list_len != 0) ||
- (cache_ptr->cLRU_list_size != (size_t)0)) {
+ ) {
pass = FALSE;
failure_mssg = "Unexpected insert results 10.";
- }
+ }
}
/* Finally, if stats collection is enabled, verify that the expected
@@ -3135,23 +3183,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 */
@@ -3160,7 +3208,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) {
@@ -3180,16 +3228,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:
@@ -3246,7 +3294,7 @@ check_flush_cache(unsigned paged)
if(pass) {
- check_flush_cache__flush_ops(file_ptr);
+ check_flush_cache__flush_ops(file_ptr);
}
if(pass) {
@@ -3266,16 +3314,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:
@@ -3287,7 +3335,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) {
@@ -3308,7 +3356,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) {
@@ -3319,7 +3367,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -3330,7 +3378,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_CLEAR_ONLY_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG);
if(result < 0) {
@@ -3342,7 +3390,7 @@ check_flush_cache__empty_cache(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_MARKED_ENTRIES_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG);
if(result < 0) {
@@ -3353,22 +3401,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.
*
*-------------------------------------------------------------------------
*/
@@ -4263,9 +4311,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
@@ -4276,10 +4324,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
@@ -4290,11 +4338,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
@@ -4305,12 +4353,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
@@ -4321,13 +4369,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
@@ -4338,14 +4386,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
@@ -4356,15 +4404,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
@@ -4375,16 +4423,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
@@ -4409,9 +4457,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
@@ -4422,10 +4470,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
@@ -4436,11 +4484,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
@@ -4451,12 +4499,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
@@ -4467,9 +4515,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
@@ -4480,10 +4528,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
@@ -4494,11 +4542,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
@@ -4509,12 +4557,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
@@ -4539,9 +4587,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
@@ -4552,10 +4600,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
@@ -4566,10 +4614,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
@@ -4580,10 +4628,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
@@ -4594,9 +4642,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
@@ -4607,9 +4655,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
@@ -4620,9 +4668,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
@@ -4633,9 +4681,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
@@ -4661,9 +4709,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
@@ -4674,10 +4722,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
@@ -4688,10 +4736,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
@@ -4702,10 +4750,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
@@ -4716,9 +4764,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
@@ -4729,13 +4777,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
@@ -4746,13 +4794,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
@@ -4763,9 +4811,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
@@ -4792,9 +4840,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
@@ -4805,10 +4853,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
@@ -4819,10 +4867,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
@@ -4833,10 +4881,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
@@ -4847,10 +4895,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
@@ -4861,10 +4909,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
@@ -4875,10 +4923,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
@@ -4889,10 +4937,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
@@ -4907,15 +4955,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:
@@ -4932,9 +4980,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;
@@ -4942,7 +4990,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) {
@@ -5013,7 +5061,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr,
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags);
+ result = H5C_flush_cache(file_ptr, flush_flags);
if(result < 0) {
@@ -5087,7 +5135,7 @@ check_flush_cache__multi_entry_test(H5F_t * file_ptr,
/* clean up the cache to prep for the next test */
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -5126,15 +5174,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:
@@ -5151,10 +5199,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;
@@ -5162,7 +5210,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) {
@@ -5200,8 +5248,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,
@@ -5230,21 +5278,21 @@ 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++;
}
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags);
+ result = H5C_flush_cache(file_ptr, flush_flags);
if(result < 0) {
@@ -5318,7 +5366,7 @@ check_flush_cache__pe_multi_entry_test(H5F_t * file_ptr,
/* clean up the cache to prep for the next test */
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -5357,21 +5405,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:
@@ -5398,468 +5446,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,
@@ -5870,118 +5918,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,
@@ -5992,104 +6040,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,
@@ -6100,111 +6148,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,
@@ -6216,500 +6264,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,
@@ -6720,131 +6768,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,
@@ -6855,757 +6903,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.
@@ -7614,1512 +7662,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 */
@@ -9129,16 +9177,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:
@@ -9152,16 +9200,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;
@@ -9169,7 +9217,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) {
@@ -9207,10 +9255,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,
@@ -9233,22 +9281,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)
) {
@@ -9276,32 +9324,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++;
}
@@ -9321,7 +9369,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags);
+ result = H5C_flush_cache(file_ptr, flush_flags);
if(result < 0) {
@@ -9355,8 +9403,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;
@@ -9373,113 +9421,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++;
}
}
@@ -9513,7 +9561,7 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
/* clean up the cache to prep for the next test */
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -9525,8 +9573,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,
@@ -9543,7 +9591,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;
@@ -9558,7 +9606,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;
@@ -9571,26 +9619,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
*
*-------------------------------------------------------------------------
*/
@@ -9599,11 +9647,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] =
@@ -9613,63 +9661,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) {
@@ -9688,15 +9736,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;
}
@@ -9709,112 +9757,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);
@@ -9837,648 +9885,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
@@ -10488,101 +10536,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) {
@@ -10591,8 +10639,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];
@@ -10604,14 +10652,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.
*/
@@ -10619,40 +10667,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;
@@ -10670,118 +10718,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
@@ -10792,7 +10840,7 @@ check_flush_cache__flush_op_eviction_test(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -10819,7 +10867,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) ||
@@ -10845,7 +10893,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) ||
@@ -10871,7 +10919,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) ||
@@ -10898,33 +10946,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.
*
*-------------------------------------------------------------------------
*/
@@ -12078,22 +12126,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.
*
@@ -12136,320 +12184,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:
@@ -12471,7 +12519,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;
@@ -12521,7 +12569,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr,
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags);
+ result = H5C_flush_cache(file_ptr, flush_flags);
if(result < 0) {
@@ -12580,7 +12628,7 @@ check_flush_cache__single_entry_test(H5F_t * file_ptr,
/* clean up the cache to prep for the next test */
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -12611,26 +12659,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.
*
*-------------------------------------------------------------------------
*/
@@ -12641,10 +12689,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,
@@ -12653,7 +12701,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;
@@ -12691,29 +12739,29 @@ 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) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, flush_flags);
+ result = H5C_flush_cache(file_ptr, flush_flags);
if(result < 0) {
@@ -12788,7 +12836,7 @@ check_flush_cache__pinned_single_entry_test(H5F_t * file_ptr,
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -12819,15 +12867,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:
@@ -12840,11 +12888,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;
@@ -12885,14 +12933,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.");
@@ -12913,14 +12961,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.");
@@ -12939,14 +12987,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.");
@@ -12965,14 +13013,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.");
@@ -12991,14 +13039,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.");
@@ -13017,14 +13065,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.");
@@ -13049,15 +13097,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:
@@ -13071,11 +13119,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;
@@ -13105,30 +13153,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
@@ -13148,28 +13196,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.
@@ -13185,34 +13233,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
@@ -13230,30 +13278,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
@@ -13272,30 +13320,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.
@@ -13311,35 +13359,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) {
@@ -13359,21 +13407,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.
*
*-------------------------------------------------------------------------
*/
@@ -13426,8 +13474,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";
@@ -13436,11 +13484,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 */
@@ -13449,8 +13497,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";
@@ -13459,11 +13507,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 */
@@ -13472,8 +13520,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";
@@ -13482,11 +13530,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 */
@@ -13495,8 +13543,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";
@@ -13505,11 +13553,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 */
@@ -13518,8 +13566,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";
@@ -13528,11 +13576,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 */
@@ -13541,8 +13589,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";
@@ -13551,11 +13599,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 */
@@ -13564,8 +13612,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";
@@ -13574,11 +13622,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 */
@@ -13587,8 +13635,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";
@@ -13597,11 +13645,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 */
@@ -13610,8 +13658,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";
@@ -13620,11 +13668,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 */
@@ -13638,8 +13686,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";
@@ -13648,11 +13696,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 */
@@ -13661,8 +13709,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";
@@ -13671,11 +13719,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 */
@@ -13690,80 +13738,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 */
@@ -13785,17 +13833,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
*
*-------------------------------------------------------------------------
@@ -13811,26 +13859,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
},
};
@@ -13877,14 +13925,14 @@ 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)
takedown_cache(file_ptr, FALSE, FALSE);
if(pass)
- PASSED()
+ PASSED();
else
H5_FAILED()
@@ -13895,13 +13943,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
*
@@ -13910,7 +13958,7 @@ check_move_entry(unsigned paged)
*
* Modifications:
*
- * None.
+ * None.
*
*-------------------------------------------------------------------------
*/
@@ -14079,15 +14127,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:
@@ -14141,25 +14189,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);
@@ -14181,16 +14229,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
*
*-------------------------------------------------------------------------
@@ -14201,12 +14249,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;
@@ -14261,8 +14309,8 @@ check_resize_entry(unsigned paged)
pass = FALSE;
failure_mssg = "file_ptr NULL from setup_cache.";
- }
- else
+ }
+ else
{
cache_ptr = file_ptr->shared->cache;
@@ -14274,16 +14322,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) {
@@ -14294,48 +14342,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) {
@@ -14350,7 +14398,7 @@ check_resize_entry(unsigned paged)
} else {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if(result < 0) {
@@ -14373,48 +14421,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) {
@@ -14435,7 +14483,7 @@ check_resize_entry(unsigned paged)
} else {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if(result < 0) {
@@ -14458,48 +14506,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) {
@@ -14514,120 +14562,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) {
@@ -14643,44 +14691,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;
- }
+ }
}
@@ -14688,19 +14736,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) {
@@ -14718,17 +14766,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) {
@@ -14739,48 +14787,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) {
@@ -14795,7 +14843,7 @@ check_resize_entry(unsigned paged)
} else {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if(result < 0) {
@@ -14818,50 +14866,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) {
@@ -14882,7 +14930,7 @@ check_resize_entry(unsigned paged)
} else {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if(result < 0) {
@@ -14905,48 +14953,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) {
@@ -14961,129 +15009,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);
}
@@ -15092,44 +15140,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) {
@@ -15147,16 +15195,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) {
@@ -15176,16 +15224,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:
@@ -15199,11 +15247,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;
@@ -15267,8 +15315,8 @@ check_evictions_enabled(unsigned paged)
pass = FALSE;
failure_mssg = "file_ptr NULL from setup_cache.";
- }
- else
+ }
+ else
{
cache_ptr = file_ptr->shared->cache;
@@ -15283,17 +15331,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 */
@@ -15305,12 +15353,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 */
@@ -15335,18 +15383,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 */
@@ -15368,17 +15416,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 */
@@ -15390,31 +15438,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 */
@@ -15435,17 +15483,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 */
@@ -15457,30 +15505,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 */
@@ -15492,12 +15540,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 */
@@ -15507,17 +15555,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 */
@@ -15539,17 +15587,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 */
@@ -15570,17 +15618,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 */
@@ -15592,12 +15640,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 */
@@ -15619,17 +15667,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 */
@@ -15654,17 +15702,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 */
@@ -15676,30 +15724,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 */
@@ -15711,30 +15759,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 */
@@ -15746,12 +15794,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 */
@@ -15775,17 +15823,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 */
@@ -15797,12 +15845,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 */
@@ -15823,17 +15871,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 */
@@ -15845,30 +15893,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 */
@@ -15880,12 +15928,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 */
@@ -15913,16 +15961,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:
@@ -15955,7 +16003,7 @@ check_flush_protected_err(unsigned paged)
protect_entry(file_ptr, 0, 0);
- if(H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET) >= 0) {
+ if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) >= 0) {
pass = FALSE;
failure_mssg = "flush succeeded on cache with protected entry.\n";
@@ -15964,7 +16012,7 @@ check_flush_protected_err(unsigned paged)
unprotect_entry(file_ptr, 0, 0, H5C__DIRTIED_FLAG);
- if(H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET) < 0) {
+ if(H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET) < 0) {
pass = FALSE;
failure_mssg = "flush failed after unprotect.\n";
@@ -15988,17 +16036,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:
@@ -16029,21 +16077,21 @@ 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, H5P_DATASET_XFER_DEFAULT) < 0) {
+ if(H5C_prep_for_file_close(file_ptr) < 0) {
pass = FALSE;
failure_mssg = "unexpected failure of prep for file close.\n";
} /* end if */
- if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) {
+ if(H5C_dest(file_ptr) >= 0) {
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, H5AC_ind_read_dxpl_id) < 0) {
+ if(H5C_dest(file_ptr) < 0) {
pass = FALSE;
failure_mssg = "destroy failed after unpin.\n";
} /* end if */
@@ -16056,11 +16104,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(); }
@@ -16072,16 +16120,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:
@@ -16121,38 +16169,38 @@ check_destroy_protected_err(unsigned paged)
* we are trying to test, put the call to H5C_prep_for_file_close()
* prior to the final protect call.
*/
- if(H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0) {
+ if(H5C_prep_for_file_close(file_ptr) < 0) {
pass = FALSE;
failure_mssg = "unexpected failure of prep for file close.\n";
} /* end if */
protect_entry(file_ptr, 0, 0);
- if(H5C_dest(file_ptr, H5AC_ind_read_dxpl_id) >= 0) {
+ if(H5C_dest(file_ptr) >= 0) {
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, H5AC_ind_read_dxpl_id) < 0) {
+ 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(); }
@@ -16164,16 +16212,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:
@@ -16214,7 +16262,7 @@ check_duplicate_insert_err(unsigned paged)
base_addr = entries[0];
entry_ptr = &(base_addr[0]);
- result = H5C_insert_entry(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_insert_entry(file_ptr,
types[0], entry_ptr->addr,
(void *)entry_ptr, H5C__NO_FLAGS_SET);
@@ -16244,21 +16292,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.
*
*-------------------------------------------------------------------------
*/
@@ -16300,7 +16348,7 @@ check_double_pin_err(unsigned paged)
if(pass) {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__PIN_ENTRY_FLAG);
if(result > 0) {
@@ -16311,8 +16359,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) {
@@ -16332,21 +16380,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.
*
*-------------------------------------------------------------------------
*/
@@ -16386,7 +16434,7 @@ check_double_unpin_err(unsigned paged)
if(pass) {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__UNPIN_ENTRY_FLAG);
if(result > 0) {
@@ -16397,13 +16445,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) {
@@ -16431,21 +16479,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.
*
*-------------------------------------------------------------------------
*/
@@ -16484,7 +16532,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]);
}
@@ -16503,10 +16551,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) {
@@ -16521,9 +16569,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) {
@@ -16543,16 +16591,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
*
*-------------------------------------------------------------------------
@@ -16590,9 +16638,9 @@ check_double_protect_err(unsigned paged)
if(pass) {
- cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id,
- types[0], entry_ptr->addr,
- &entry_ptr->addr, H5C__NO_FLAGS_SET);
+ cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
+ types[0], entry_ptr->addr,
+ &entry_ptr->addr, H5C__NO_FLAGS_SET);
if(cache_entry_ptr != NULL) {
@@ -16623,16 +16671,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
*
*-------------------------------------------------------------------------
@@ -16672,7 +16720,7 @@ check_double_unprotect_err(unsigned paged)
if(pass) {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET);
if(result > 0) {
@@ -16700,19 +16748,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
*
*-------------------------------------------------------------------------
@@ -16746,14 +16794,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) {
@@ -16781,21 +16829,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.
*
*-------------------------------------------------------------------------
*/
@@ -16840,7 +16888,7 @@ check_expunge_entry_errs(unsigned paged)
if(pass) {
- result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_expunge_entry(file_ptr,
types[0], entry_ptr->addr, H5C__NO_FLAGS_SET);
if(result > 0) {
@@ -16851,14 +16899,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, H5AC_ind_read_dxpl_id,
+ result = H5C_expunge_entry(file_ptr,
types[0], entry_ptr->addr, H5C__NO_FLAGS_SET);
if(result > 0) {
@@ -16869,14 +16917,14 @@ check_expunge_entry_errs(unsigned paged)
} else {
- unpin_entry(0, 0);
+ unpin_entry(0, 0);
- }
+ }
}
if(pass) {
- result = H5C_expunge_entry(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_expunge_entry(file_ptr,
types[0], entry_ptr->addr, H5C__NO_FLAGS_SET);
if(result < 0) {
@@ -16885,7 +16933,7 @@ check_expunge_entry_errs(unsigned paged)
failure_mssg =
"attempt to expunge an unpinned and unprotected entry failed.\n";
- }
+ }
}
@@ -16906,16 +16954,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
*
*-------------------------------------------------------------------------
@@ -16999,7 +17047,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;
@@ -17013,7 +17061,7 @@ check_move_entry_errs(unsigned paged)
takedown_cache(file_ptr, FALSE, FALSE);
if(pass)
- PASSED()
+ PASSED();
else {
H5_FAILED()
@@ -17023,16 +17071,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
*
*-------------------------------------------------------------------------
@@ -17077,7 +17125,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) {
@@ -17087,14 +17135,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) {
@@ -17104,9 +17152,9 @@ check_resize_entry_errs(unsigned paged)
} else {
- unpin_entry(0, 0);
+ unpin_entry(0, 0);
- }
+ }
}
if(pass) {
@@ -17126,16 +17174,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
*
*-------------------------------------------------------------------------
@@ -17173,7 +17221,7 @@ check_unprotect_ro_dirty_err(unsigned paged)
if(pass) {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if(result >= 0) {
@@ -17186,7 +17234,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);
}
@@ -17215,7 +17263,7 @@ check_unprotect_ro_dirty_err(unsigned paged)
if(pass) {
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
+ result = H5C_unprotect(file_ptr,
entry_ptr->addr, (void *)entry_ptr, H5C__DIRTIED_FLAG);
if(result > 0) {
@@ -17228,8 +17276,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);
}
@@ -17250,21 +17298,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.
*
*-------------------------------------------------------------------------
*/
@@ -17302,9 +17350,9 @@ check_protect_ro_rw_err(unsigned paged)
if(pass) {
- thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, H5AC_ind_read_dxpl_id,
- types[0], entry_ptr->addr,
- &entry_ptr->addr, H5C__NO_FLAGS_SET);
+ thing_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr,
+ types[0], entry_ptr->addr,
+ &entry_ptr->addr, H5C__NO_FLAGS_SET);
if(thing_ptr != NULL) {
@@ -17315,7 +17363,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) {
@@ -17335,16 +17383,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:
*
*-------------------------------------------------------------------------
*/
@@ -17373,8 +17421,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;
}
@@ -17384,30 +17432,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, H5AC_ind_read_dxpl_id,
+ 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().";
@@ -17428,26 +17476,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, H5AC_ind_read_dxpl_id,
+ 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;
}
@@ -17466,21 +17514,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.
*
*-------------------------------------------------------------------------
*/
@@ -17523,9 +17571,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";
@@ -17534,9 +17582,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";
@@ -17545,30 +17593,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;
}
@@ -17577,9 +17625,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";
@@ -17606,18 +17654,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
*
*-------------------------------------------------------------------------
@@ -17674,9 +17722,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,
@@ -18044,9 +18092,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;
@@ -18332,7 +18380,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) ||
@@ -18376,9 +18424,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;
@@ -18557,9 +18605,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;
@@ -18597,7 +18645,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
@@ -18907,7 +18955,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
@@ -18940,9 +18988,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;
@@ -19452,9 +19500,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;
@@ -19856,9 +19904,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;
@@ -19866,7 +19914,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged)
/* NOTE: upper_hr_threshold MUST be type double (not float)
* or the cache test will fail on 64-bit systems.
*/
- auto_size_ctl.upper_hr_threshold = H5_DOUBLE(0.999); /* for ease of testing */
+ auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */
auto_size_ctl.decrement = 0.5f;
@@ -20113,9 +20161,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;
@@ -20637,7 +20685,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++);
@@ -20671,9 +20719,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;
@@ -20701,9 +20749,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";
@@ -20720,16 +20768,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++);
@@ -20746,17 +20794,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++);
@@ -20772,17 +20820,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++);
@@ -20796,16 +20844,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++);
@@ -20815,8 +20863,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) {
@@ -20824,19 +20872,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
@@ -20850,22 +20898,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++);
@@ -20879,17 +20927,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++);
@@ -20900,17 +20948,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++);
@@ -20924,16 +20972,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++);
@@ -20945,26 +20993,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) {
@@ -20976,19 +21024,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++);
@@ -21008,16 +21056,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++);
@@ -21028,20 +21076,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++);
@@ -21053,20 +21101,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++);
@@ -21077,20 +21125,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++);
@@ -21101,20 +21149,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++);
@@ -21126,16 +21174,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) {
@@ -21146,19 +21194,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++);
@@ -21171,16 +21219,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++);
@@ -21189,16 +21237,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++);
@@ -21209,16 +21257,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++);
@@ -21229,16 +21277,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++);
@@ -21257,16 +21305,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++);
@@ -21278,16 +21326,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) {
@@ -21298,19 +21346,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) {
@@ -21319,16 +21367,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++);
@@ -21337,16 +21385,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++);
@@ -21357,16 +21405,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++);
@@ -21377,16 +21425,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++);
@@ -21405,16 +21453,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
@@ -21422,21 +21470,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++);
@@ -21470,9 +21518,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;
@@ -21502,9 +21550,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";
@@ -21523,17 +21571,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++);
@@ -21549,17 +21597,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++);
@@ -21576,17 +21624,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++);
@@ -21627,19 +21675,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++);
@@ -21660,7 +21708,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;
@@ -21691,16 +21739,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:
@@ -21747,7 +21795,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,
@@ -21792,7 +21840,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;
@@ -21855,9 +21903,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;
@@ -22013,9 +22061,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;
@@ -22170,9 +22218,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;
@@ -22327,9 +22375,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;
@@ -22484,9 +22532,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;
@@ -22640,9 +22688,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;
@@ -22798,9 +22846,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;
@@ -23025,9 +23073,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;
@@ -23259,9 +23307,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;
@@ -23497,9 +23545,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;
@@ -23624,9 +23672,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;
@@ -23751,9 +23799,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;
@@ -23878,9 +23926,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;
@@ -24005,9 +24053,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;
@@ -24133,9 +24181,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;
@@ -24289,9 +24337,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;
@@ -24346,16 +24394,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";
@@ -24385,16 +24433,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";
@@ -24422,16 +24470,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:
@@ -24475,9 +24523,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,
@@ -24564,9 +24612,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;
@@ -24738,9 +24786,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;
@@ -24859,9 +24907,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;
@@ -24938,9 +24986,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;
@@ -25051,9 +25099,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;
@@ -25128,21 +25176,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
@@ -25182,9 +25230,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,
@@ -25290,9 +25338,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;
@@ -25365,9 +25413,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;
@@ -25441,9 +25489,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;
@@ -25514,9 +25562,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;
@@ -25589,9 +25637,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;
@@ -25661,9 +25709,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;
@@ -25737,9 +25785,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;
@@ -25809,9 +25857,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;
@@ -25881,9 +25929,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;
@@ -25956,9 +26004,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;
@@ -26028,9 +26076,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;
@@ -26095,7 +26143,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;
@@ -26104,9 +26152,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;
@@ -26168,7 +26216,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;
@@ -26177,9 +26225,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;
@@ -26252,9 +26300,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;
@@ -26324,9 +26372,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;
@@ -26396,9 +26444,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;
@@ -26471,9 +26519,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;
@@ -26546,10 +26594,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;
@@ -26621,10 +26669,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;
@@ -26694,10 +26742,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;
@@ -26769,10 +26817,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;
@@ -26842,10 +26890,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;
@@ -26918,13 +26966,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;
@@ -26991,13 +27039,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;
@@ -27067,9 +27115,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;
@@ -27139,9 +27187,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;
@@ -27214,9 +27262,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;
@@ -27285,9 +27333,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;
@@ -27360,9 +27408,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;
@@ -27431,9 +27479,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;
@@ -27537,21 +27585,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:
@@ -27600,9 +27648,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,
@@ -28077,11 +28125,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
@@ -28095,9 +28143,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
*
@@ -28128,158 +28176,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;
@@ -28440,13 +28488,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 */
@@ -28494,13 +28542,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 */
@@ -28543,9 +28591,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 */
@@ -28616,19 +28664,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 */
@@ -28671,13 +28719,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
@@ -28802,13 +28850,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 */
@@ -28850,17 +28898,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 */
@@ -28896,13 +28944,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;
@@ -28938,15 +28986,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
*
*-------------------------------------------------------------------------
@@ -28962,13 +29010,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)
@@ -29019,16 +29067,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)
@@ -29038,16 +29086,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)
@@ -30668,7 +30716,7 @@ done:
takedown_cache(file_ptr, FALSE, FALSE);
if(pass)
- PASSED()
+ PASSED();
else {
H5_FAILED();
HDfprintf(stdout, "%s.\n", failure_mssg);
@@ -30677,15 +30725,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
*
*-------------------------------------------------------------------------
@@ -30891,7 +30939,7 @@ done:
takedown_cache(file_ptr, FALSE, FALSE);
if(pass)
- PASSED()
+ PASSED();
else {
H5_FAILED();
HDfprintf(stdout, "%s.\n", failure_mssg);
@@ -30900,16 +30948,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
*
*-------------------------------------------------------------------------
@@ -30924,13 +30972,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 */
@@ -31017,7 +31065,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -31123,7 +31171,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -31235,7 +31283,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -31354,7 +31402,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -31530,7 +31578,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -31740,7 +31788,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -31898,7 +31946,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -32032,7 +32080,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -32225,7 +32273,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -32464,7 +32512,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -32721,7 +32769,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -33008,7 +33056,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -33324,7 +33372,7 @@ check_flush_deps_order(unsigned paged)
/* Reset index for tracking flush order */
flush_order = 0;
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(result < 0) CACHE_ERROR("flushing entries with flush dependendices")
/* Change expected values, and verify the status of the entries
@@ -33463,7 +33511,7 @@ done:
takedown_cache(file_ptr, FALSE, FALSE);
if(pass)
- PASSED()
+ PASSED();
else {
H5_FAILED();
HDfprintf(stdout, "%s.\n", failure_mssg);
@@ -33472,15 +33520,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
*
*-------------------------------------------------------------------------
@@ -33497,13 +33545,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)
@@ -33544,7 +33592,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)
@@ -33572,7 +33620,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)
@@ -33600,7 +33648,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)
@@ -33627,7 +33675,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)
@@ -33655,7 +33703,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)
@@ -33666,7 +33714,7 @@ done:
takedown_cache(file_ptr, FALSE, FALSE);
if(pass)
- PASSED()
+ PASSED();
else {
H5_FAILED();
HDfprintf(stdout, "%s.\n", failure_mssg);
@@ -33675,18 +33723,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
*
*-------------------------------------------------------------------------
*/
@@ -33713,158 +33761,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;
@@ -33911,9 +33959,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.
*
* ========================================================================
* ========================================================================
@@ -33965,9 +34013,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.
*
* ========================================================================
* ========================================================================
@@ -33996,14 +34044,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 */
@@ -34042,10 +34090,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 */
@@ -34081,12 +34129,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 */
@@ -34111,8 +34159,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.
*
* ========================================================================
* ========================================================================
@@ -34144,10 +34192,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 */
@@ -34191,7 +34239,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;
@@ -34210,21 +34258,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 */
@@ -34233,16 +34281,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[] */
@@ -34256,13 +34304,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 {
@@ -34277,21 +34325,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 */
}
@@ -34305,30 +34353,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 */
@@ -34366,15 +34414,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 */
@@ -34404,34 +34452,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.
*
*-------------------------------------------------------------------------
*/
@@ -34459,9 +34507,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.
*/
@@ -34501,32 +34549,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.
*
*-------------------------------------------------------------------------
*/
@@ -34535,8 +34583,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
@@ -34544,12 +34592,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) {
@@ -34568,15 +34616,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;
}
@@ -34584,50 +34632,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);
@@ -34635,34 +34683,34 @@ 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. */
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -34683,7 +34731,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) ||
@@ -34707,7 +34755,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;
@@ -34726,34 +34774,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.
*
*-------------------------------------------------------------------------
*/
@@ -34762,10 +34810,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
@@ -34773,44 +34821,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) {
@@ -34829,15 +34877,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;
}
@@ -34845,54 +34893,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);
@@ -34900,62 +34948,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
@@ -34968,45 +35016,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);
}
}
@@ -35014,7 +35062,7 @@ cedds__H5C_make_space_in_cache(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -35037,7 +35085,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) ||
@@ -35062,7 +35110,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) ||
@@ -35086,7 +35134,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)) {
@@ -35107,34 +35155,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.
*
*-------------------------------------------------------------------------
*/
@@ -35143,8 +35191,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
@@ -35152,40 +35200,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 =
@@ -35214,9 +35262,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,
@@ -35250,15 +35298,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;
}
@@ -35294,49 +35342,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);
@@ -35344,34 +35392,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 */
@@ -35397,38 +35445,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 */
@@ -35450,7 +35498,7 @@ cedds__H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -35472,7 +35520,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) ||
@@ -35496,7 +35544,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)) {
@@ -35517,95 +35565,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.
*
*-------------------------------------------------------------------------
*/
@@ -35614,9 +35662,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;
@@ -35628,13 +35676,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) {
@@ -35653,15 +35701,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;
}
@@ -35670,25 +35718,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) {
@@ -35703,7 +35751,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;
@@ -35718,10 +35766,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);
}
@@ -35730,16 +35778,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.
*/
@@ -35755,9 +35803,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);
@@ -35767,11 +35815,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);
@@ -35780,23 +35828,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) {
@@ -35809,7 +35857,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) {
@@ -35829,7 +35877,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
scan_ptr = scan_ptr->ht_next;
i += 8;
}
- }
+ }
}
@@ -35837,7 +35885,7 @@ cedds__H5C_flush_invalidate_cache__bucket_scan(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -35859,7 +35907,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) ||
@@ -35884,10 +35932,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;
@@ -35907,21 +35955,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:
@@ -35976,7 +36024,7 @@ check_stats(unsigned paged)
SKIPPED();
- HDfprintf(stdout, " Statistics collection disabled.\n");
+ HDfprintf(stdout, " Statistics collection disabled.\n");
#endif /* H5C_COLLECT_CACHE_STATS */
@@ -35984,30 +36032,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.
*
*-------------------------------------------------------------------------
*/
@@ -36016,8 +36064,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) {
@@ -36034,15 +36082,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 */
@@ -36128,13 +36176,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)
@@ -36215,7 +36263,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);
@@ -36310,7 +36358,7 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
if(pass) {
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id, H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
if(result < 0) {
@@ -36415,7 +36463,438 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
+/* Call back functions: */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: check_if_write_permitted
+ *
+ * Purpose: Determine if a write is permitted under the current
+ * circumstances, and set *write_permitted_ptr accordingly.
+ * As a general rule it is, but when we are running in parallel
+ * mode with collective I/O, we must ensure that a read cannot
+ * cause a write.
+ *
+ * In the event of failure, the value of *write_permitted_ptr
+ * is undefined.
+ *
+ * Return: Non-negative on success/Negative on failure.
+ *
+ * Programmer: John Mainzer, 5/15/04
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr)
+{
+ HDassert( write_permitted_ptr );
+
+ *write_permitted_ptr = write_permitted;
+
+ return(SUCCEED);
+} /* check_write_permitted() */
+
+
+/*****************************************************************************
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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
+ *
+ * Failure: NULL
+ *
+ * Programmer: JRM -- 9/13/07
+ *
+ *****************************************************************************/
+
+H5F_t *
+setup_cache(size_t max_cache_size,
+ size_t min_clean_size,
+ unsigned paged)
+{
+ char filename[512];
+ hbool_t show_progress = FALSE;
+ hbool_t verbose = TRUE;
+ int mile_stone = 1;
+ hid_t fid = -1;
+ H5F_t * file_ptr = NULL;
+ H5C_t * cache_ptr = NULL;
+ H5F_t * ret_val = NULL;
+ haddr_t actual_base_addr;
+ hid_t fapl_id = H5P_DEFAULT;
+ hid_t fcpl_id = H5P_DEFAULT;
+
+ if(show_progress) /* 1 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ saved_fid = -1;
+
+ if(pass) {
+ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
+ }
+ }
+
+ if(pass && paged) {
+ /* Set up paged aggregation strategy */
+ if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pset_file_space_strategy() failed.\n";
+ H5Pclose(fcpl_id);
+ fcpl_id = H5P_DEFAULT;
+ }
+ }
+
+ if(pass && paged) {
+ /* Set up file space page size to BASE_ADDR */
+ if(H5Pset_file_space_page_size(fcpl_id, (hsize_t)BASE_ADDR) == FAIL) {
+ pass = FALSE;
+ failure_mssg = "H5Pset_file_space_page_size() failed.\n";
+ H5Pclose(fcpl_id);
+ fcpl_id = H5P_DEFAULT;
+ }
+ }
+
+ if(pass)
+ saved_fcpl_id = fcpl_id;
+
+ /* setup the file name */
+ if(pass) {
+ if(NULL == h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))) {
+ pass = FALSE;
+ failure_mssg = "h5_fixname() failed.\n";
+ }
+ }
+
+ if(show_progress) /* 2 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ 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";
+ }
+ 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;
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
+ } else {
+ saved_fapl_id = fapl_id;
+ }
+ }
+
+ if(show_progress) /* 3 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ /* if we either aren't using the core file driver, or a create
+ * with the core file driver failed, try again with a regular file.
+ * If this fails, we are cooked.
+ */
+ if(pass && fid < 0) {
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ saved_fid = fid;
+
+ if(fid < 0) {
+ pass = FALSE;
+ failure_mssg = "H5Fcreate() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
+ } /* end if */
+ } /* end if */
+
+ /* Push API context */
+ H5CX_push();
+
+ if(show_progress) /* 4 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+ HDassert(fid >= 0);
+ saved_fid = fid;
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
+ pass = FALSE;
+ failure_mssg = "H5Fflush() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
+ }
+ else {
+ file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE);
+ if(file_ptr == NULL) {
+ pass = FALSE;
+ failure_mssg = "Can't get file_ptr.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
+ }
+ }
+ }
+
+ if(show_progress) /* 5 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+
+ /* A bit of fancy footwork here:
+ *
+ * The call to H5Fcreate() allocates an instance of H5C_t,
+ * initializes it, and stores its address in f->shared->cache.
+ *
+ * We don't want to use this cache, as it has a bunch of extra
+ * initialization that may change over time, and in any case
+ * it will not in general be configured the way we want it.
+ *
+ * We used to deal with this problem by storing the file pointer
+ * in another instance of H5C_t, and then ignoring the original
+ * version. However, this strategy doesn't work any more, as
+ * we can't store the file pointer in the instance of H5C_t,
+ * and we have modified many cache routines to use a file
+ * pointer to look up the target cache.
+ *
+ * Thus we now make note of the address of the instance of
+ * H5C_t created by the call to H5Fcreate(), set
+ * file_ptr->shared->cache to NULL, call H5C_create()
+ * to allocate a new instance of H5C_t for test purposes,
+ * and store than new instance's address in
+ * file_ptr->shared->cache.
+ *
+ * On shut down, we call H5C_dest on our instance of H5C_t,
+ * set file_ptr->shared->cache to point to the original
+ * instance, and then close the file normally.
+ */
+
+ HDassert(saved_cache == NULL);
+ saved_cache = file_ptr->shared->cache;
+ file_ptr->shared->cache = NULL;
+
+ cache_ptr = H5C_create(max_cache_size,
+ min_clean_size,
+ (NUMBER_OF_ENTRY_TYPES - 1),
+ types,
+ check_write_permitted,
+ TRUE,
+ NULL,
+ NULL);
+
+ file_ptr->shared->cache = cache_ptr;
+ }
+
+ if(show_progress) /* 6 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+ if(cache_ptr == NULL) {
+ pass = FALSE;
+ failure_mssg = "H5C_create() failed.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
+ }
+ else if(cache_ptr->magic != H5C__H5C_T_MAGIC) {
+ pass = FALSE;
+ failure_mssg = "Bad cache_ptr magic.";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
+ }
+ }
+
+ if(show_progress) /* 7 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ 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) {
+ pass = FALSE;
+ failure_mssg = "H5MF_alloc() failed.";
+
+ 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.
+ */
+ pass = FALSE;
+ failure_mssg = "actual_base_addr > BASE_ADDR";
+
+ if(verbose)
+ HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC);
+ }
+
+ saved_actual_base_addr = actual_base_addr;
+ }
+
+ if(show_progress) /* 8 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ if(pass) {
+ /* Need to set this else all cache tests will fail */
+ cache_ptr->ignore_tags = TRUE;
+
+ H5C_stats__reset(cache_ptr);
+ ret_val = file_ptr;
+ }
+
+ if(show_progress) /* 9 */
+ HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
+ FUNC, mile_stone++, (int)pass);
+
+ return(ret_val);
+} /* setup_cache() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: takedown_cache()
+ *
+ * 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.
+ *
+ * Return: void
+ *
+ * Programmer: John Mainzer
+ * 9/14/07
+ *
+ *-------------------------------------------------------------------------
+ */
+
+void
+takedown_cache(H5F_t * file_ptr,
+ hbool_t dump_stats,
+ hbool_t dump_detailed_stats)
+{
+ char filename[512];
+
+ if ( file_ptr != NULL ) {
+ H5C_t * cache_ptr = file_ptr->shared->cache;
+
+ if ( dump_stats ) {
+
+ H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
+ }
+
+ if ( H5C_prep_for_file_close(file_ptr) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "unexpected failure of prep for file close.\n";
+ }
+
+ flush_cache(file_ptr, TRUE, FALSE, FALSE);
+
+ H5C_dest(file_ptr);
+
+ if ( saved_cache != NULL ) {
+
+ file_ptr->shared->cache = saved_cache;
+ saved_cache = NULL;
+ }
+
+ }
+
+ if ( saved_fapl_id != H5P_DEFAULT ) {
+
+ H5Pclose(saved_fapl_id);
+ saved_fapl_id = H5P_DEFAULT;
+ }
+
+ if ( saved_fcpl_id != H5P_DEFAULT ) {
+ H5Pclose(saved_fcpl_id);
+ saved_fcpl_id = H5P_DEFAULT;
+ }
+
+ if ( saved_fid != -1 ) {
+
+ if ( H5F_addr_defined(saved_actual_base_addr) ) {
+
+ if ( NULL == file_ptr ) {
+ file_ptr = (H5F_t *)H5VL_object_verify(saved_fid, H5I_FILE);
+ HDassert ( file_ptr );
+ }
+
+ H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, saved_actual_base_addr,
+ (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
+ saved_actual_base_addr = HADDR_UNDEF;
+ }
+
+ if ( H5Fclose(saved_fid) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "couldn't close test file.";
+
+ } else {
+
+ saved_fid = -1;
+
+ }
+
+ /* Pop API context */
+ H5CX_pop();
+
+ if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) {
+
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
+ == NULL ) {
+
+ pass = FALSE;
+ failure_mssg = "h5_fixname() failed.\n";
+ }
+
+ if ( HDremove(filename) < 0 ) {
+
+ pass = FALSE;
+ failure_mssg = "couldn't delete test file.";
+
+ }
+ }
+ }
+
+ return;
+
+} /* takedown_cache() */
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -36438,14 +36917,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 7c0ffa3..ca2e0ca 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"
@@ -24,6 +24,11 @@
/* global variable declarations: */
+const char *FILENAME[] = {
+ "cache_api_test",
+ NULL
+};
+
/* macro definitions */
/* private function declarations: */
@@ -36,7 +41,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 +109,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;
@@ -207,7 +212,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -230,7 +235,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -355,7 +360,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -378,7 +383,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -495,7 +500,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 +565,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 +600,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 +635,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 +671,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)
@@ -688,7 +693,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -813,9 +818,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 +851,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 +859,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 +938,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 +973,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 +1008,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)
@@ -1034,7 +1039,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -1117,9 +1122,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 +1332,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 +1453,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 +1528,9 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id)
}
if ( pass ) {
-
+
PASSED();
-
+
} else {
H5_FAILED();
@@ -1561,7 +1566,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 *
@@ -1659,7 +1664,7 @@ init_invalid_configs(void) {
configs[13].lower_hr_threshold = 1.00000001f;
/* 14 -- increment too small */
- configs[14].increment = H5_DOUBLE(0.999999999999);
+ configs[14].increment = 0.999999999999;
/* 15 -- invalid flash_incr_mode */
configs[15].flash_incr_mode = (enum H5C_cache_flash_incr_mode)-1;
@@ -1692,7 +1697,7 @@ init_invalid_configs(void) {
/* 23 -- decrement too big */
configs[23].decr_mode = H5C_decr__threshold;
- configs[23].decrement = H5_DOUBLE(1.0000000001);
+ configs[23].decrement = 1.0000000001;
/* 24 -- epochs_before_eviction too small */
configs[24].epochs_before_eviction = 0;
@@ -1704,13 +1709,13 @@ init_invalid_configs(void) {
configs[26].empty_reserve = -0.0000000001f;
/* 27 -- empty_reserve too big */
- configs[27].empty_reserve = H5_DOUBLE(1.00000000001);
+ configs[27].empty_reserve = 1.00000000001;
/* 28 -- upper_hr_threshold too small */
configs[28].upper_hr_threshold = -0.000000001f;
/* 29 -- upper_hr_threshold too big */
- configs[29].upper_hr_threshold = H5_DOUBLE(1.00000001);
+ configs[29].upper_hr_threshold = 1.00000001;
/* 30 -- upper_hr_threshold <= lower_hr_threshold */
configs[30].lower_hr_threshold = 0.9f;
@@ -1737,7 +1742,7 @@ init_invalid_configs(void) {
} /* initialize_invalid_configs() */
-
+
/*-------------------------------------------------------------------------
* Function: check_fapl_mdc_api_errs()
*
@@ -1913,7 +1918,7 @@ check_fapl_mdc_api_errs(void)
} /* check_fapl_mdc_api_errs() */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_mdc_api_errs()
*
@@ -1963,7 +1968,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC);
}
- if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
+ if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
@@ -2259,7 +2264,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id)
} /* check_file_mdc_api_errs() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -2285,10 +2290,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 69bc26a..1dc13a1 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -14,53 +14,16 @@
/* 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 "H5MFprivate.h"
+#include "H5private.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5MMprivate.h"
-#include "cache_common.h"
-
-
-/* global variable declarations: */
-const char *FILENAME[] = {
- "cache_test",
- "cache_api_test",
- NULL
-};
+#include "cache_common.h"
-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.
- */
-
-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.
- */
-hid_t saved_fid = -1; /* store the file id here between cache setup
- * 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.
- */
-
-haddr_t saved_actual_base_addr = HADDR_UNDEF; /* Store the address of the
- space allocated for cache items in the file between
- cache setup & takedown */
-
-hbool_t write_permitted = TRUE;
hbool_t pass = TRUE; /* set to false on error */
-hbool_t try_core_file_driver = FALSE;
-hbool_t core_file_driver_failed = FALSE;
const char *failure_mssg = NULL;
static test_entry_t *pico_entries = NULL, *orig_pico_entries = NULL;
@@ -129,38 +92,38 @@ static herr_t monster_image_len(const void *thing, size_t *image_len_ptr);
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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t pico_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t nano_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t micro_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t tiny_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t small_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t medium_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t large_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t huge_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t monster_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t variable_pre_serialize(H5F_t *f, void *thing,
+ 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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+static herr_t notify_pre_serialize(H5F_t *f, void *thing,
+ 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,
@@ -212,12 +175,12 @@ static herr_t get_final_load_size(const void *image, size_t image_len,
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, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr,
+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,
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);
@@ -289,7 +252,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,
@@ -496,16 +459,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
*
*-------------------------------------------------------------------------
@@ -575,52 +538,23 @@ addr_to_type_and_index(haddr_t addr,
/* Call back functions: */
-
-/*-------------------------------------------------------------------------
- *
- * Function: check_if_write_permitted
- *
- * Purpose: Determine if a write is permitted under the current
- * circumstances, and set *write_permitted_ptr accordingly.
- * As a general rule it is, but when we are running in parallel
- * mode with collective I/O, we must ensure that a read cannot
- * cause a write.
- *
- * In the event of failure, the value of *write_permitted_ptr
- * is undefined.
- *
- * Return: Non-negative on success/Negative on failure.
- *
- * Programmer: John Mainzer, 5/15/04
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-check_write_permitted(const H5F_t H5_ATTR_UNUSED *f, hbool_t *write_permitted_ptr)
-{
- HDassert( write_permitted_ptr );
-
- *write_permitted_ptr = write_permitted;
- 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
*
*-------------------------------------------------------------------------
*/
static herr_t
-get_initial_load_size(void *udata, size_t *image_length, int32_t entry_type)
+get_initial_load_size(void *udata, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -714,23 +648,23 @@ 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
*
*-------------------------------------------------------------------------
*/
static herr_t
get_final_load_size(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED image_len,
- void *udata, size_t *actual_len, int32_t entry_type)
+ void *udata, size_t *actual_len, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -772,25 +706,26 @@ 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:
*
*-------------------------------------------------------------------------
*/
static htri_t
-verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, int32_t entry_type)
+verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata,
+ int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -815,9 +750,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() */
@@ -827,24 +762,24 @@ 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
*
*-------------------------------------------------------------------------
*/
static void *
-deserialize(const void *image, size_t len, void *udata, hbool_t *dirty,
- int32_t entry_type)
+deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hbool_t *dirty,
+ int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
test_entry_t *base_addr;
@@ -889,7 +824,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)) {
@@ -903,9 +838,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 */
@@ -983,29 +918,27 @@ 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
*
*-------------------------------------------------------------------------
*/
herr_t
-image_len(const void *thing, size_t *image_length, int32_t entry_type)
+image_len(const void *thing, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
const test_entry_t *entry;
- test_entry_t *base_addr;
int32_t type;
- int32_t idx;
HDassert(thing);
HDassert(image_length);
@@ -1015,20 +948,18 @@ image_len(const void *thing, size_t *image_length, int32_t entry_type)
HDassert(entry->self == entry);
type = entry->type;
- idx = entry->index;
HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES));
HDassert(type == entry_type);
- HDassert((idx >= 0) && (idx <= max_indices[type]));
+ HDassert((entry->index >= 0) && (entry->index <= max_indices[type]));
- base_addr = entries[type];
- HDassert(entry == &(base_addr[idx]));
+ HDassert(entry == &(entries[type][entry->index]));
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;
@@ -1102,39 +1033,35 @@ 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
*
*-------------------------------------------------------------------------
*/
herr_t
-pre_serialize(H5F_t *f,
- hid_t H5_ATTR_UNUSED dxpl_id,
+pre_serialize(H5F_t H5_ATTR_NDEBUG_UNUSED *f,
void *thing,
- haddr_t addr,
- size_t len,
+ haddr_t H5_ATTR_NDEBUG_UNUSED addr,
+ size_t H5_ATTR_NDEBUG_UNUSED len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
test_entry_t *entry;
- test_entry_t *base_addr;
- int32_t type;
- int32_t idx;
int32_t i;
HDassert(f);
@@ -1154,16 +1081,9 @@ pre_serialize(H5F_t *f,
/* shouldn't serialize the entry unless it is dirty */
HDassert(entry->is_dirty);
-
- type = entry->type;
- idx = entry->index;
-
- HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES));
- HDassert((idx >= 0) && (idx <= max_indices[type]));
-
- base_addr = entries[type];
-
- HDassert(entry == &(base_addr[idx]));
+ HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES));
+ HDassert((entry->index >= 0) && (entry->index <= max_indices[entry->type]));
+ HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry->num_flush_ops >= 0);
HDassert(entry->num_flush_ops < MAX_FLUSH_OPS);
@@ -1208,7 +1128,6 @@ pre_serialize(H5F_t *f,
herr_t
pico_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1216,13 +1135,12 @@ pico_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
nano_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1230,13 +1148,12 @@ nano_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
micro_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1244,13 +1161,12 @@ micro_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
tiny_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1258,13 +1174,12 @@ tiny_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
small_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1272,13 +1187,12 @@ small_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
medium_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1286,13 +1200,12 @@ medium_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
large_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1300,13 +1213,12 @@ large_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
huge_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1314,13 +1226,12 @@ huge_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
monster_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1328,13 +1239,12 @@ monster_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
variable_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1342,13 +1252,12 @@ variable_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, thing, addr, len,
+ return pre_serialize(f, thing, addr, len,
new_addr_ptr, new_len_ptr, flags_ptr);
}
herr_t
notify_pre_serialize(H5F_t *f,
- hid_t dxpl_id,
void *thing,
haddr_t addr,
size_t len,
@@ -1356,28 +1265,28 @@ notify_pre_serialize(H5F_t *f,
size_t *new_len_ptr,
unsigned *flags_ptr)
{
- return pre_serialize(f, dxpl_id, 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
*
*-------------------------------------------------------------------------
@@ -1386,9 +1295,7 @@ herr_t
serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing)
{
test_entry_t *entry;
- test_entry_t *base_addr;
int32_t type;
- int32_t idx;
HDassert(image_ptr);
HDassert(thing);
@@ -1402,14 +1309,11 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin
HDassert(entry->is_dirty);
type = entry->type;
- idx = entry->index;
HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES));
- HDassert((idx >= 0) && (idx <= max_indices[type]));
-
- base_addr = entries[type];
+ HDassert((entry->index >= 0) && (entry->index <= max_indices[type]));
- HDassert(entry == &(base_addr[idx]));
+ HDassert(entry == &(entries[type][entry->index]));
HDassert(entry->num_flush_ops >= 0);
HDassert(entry->num_flush_ops < MAX_FLUSH_OPS);
@@ -1418,14 +1322,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
@@ -1435,7 +1339,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 */
@@ -1443,9 +1347,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)++;
@@ -1485,7 +1389,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);
@@ -1504,57 +1408,55 @@ 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
*
*-------------------------------------------------------------------------
*/
static herr_t
-notify(H5C_notify_action_t action, void *thing, int32_t entry_type)
+notify(H5C_notify_action_t action, void *thing, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
test_entry_t *entry;
- test_entry_t *base_addr;
HDassert(thing);
entry = (test_entry_t *)thing;
- base_addr = entries[entry->type];
HDassert(entry->index >= 0);
HDassert(entry->index <= max_indices[entry->type]);
HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES));
HDassert(entry->type == entry_type);
- HDassert(entry == &(base_addr[entry->index]));
+ HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry == entry->self);
if(!(action == H5C_NOTIFY_ACTION_ENTRY_DIRTIED && entry->action == TEST_ENTRY_ACTION_MOVE))
HDassert(entry->header.addr == entry->addr);
@@ -1563,8 +1465,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;
@@ -1575,8 +1477,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++;
@@ -1595,42 +1497,38 @@ 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
*
*-------------------------------------------------------------------------
*/
herr_t
-free_icr(test_entry_t *entry, int32_t entry_type)
+free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type)
{
- test_entry_t *base_addr;
-
HDassert(entry);
- base_addr = entries[entry->type];
-
HDassert(entry->type == entry_type);
HDassert(entry->index >= 0);
HDassert(entry->index <= max_indices[entry->type]);
- HDassert(entry == &(base_addr[entry->index]));
+ HDassert(entry == &(entries[entry->type][entry->index]));
HDassert(entry == entry->self);
HDassert(entry->cache_ptr != NULL);
HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC);
@@ -1639,43 +1537,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;
@@ -1750,7 +1648,7 @@ notify_free_icr(void *thing)
return free_icr((test_entry_t *)thing, NOTIFY_ENTRY_TYPE);
}
-
+
/**************************************************************************/
/**************************************************************************/
/************************** test utility functions: ***********************/
@@ -1758,16 +1656,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
*
*-------------------------------------------------------------------------
@@ -1775,12 +1673,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;
@@ -1789,10 +1687,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 );
@@ -1811,15 +1709,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;
}
@@ -1827,24 +1725,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
*
*-------------------------------------------------------------------------
@@ -1852,10 +1750,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;
@@ -1865,13 +1763,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]);
@@ -1882,47 +1780,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
*
*-------------------------------------------------------------------------
@@ -1932,7 +1830,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;
@@ -1948,54 +1846,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
*
*-------------------------------------------------------------------------
@@ -2003,9 +1901,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;
@@ -2037,56 +1935,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;
@@ -2096,65 +1994,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
*
*-------------------------------------------------------------------------
@@ -2194,7 +2092,7 @@ entry_in_cache(H5C_t * cache_ptr,
} /* entry_in_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: create_entry_arrays
*
@@ -2202,7 +2100,7 @@ entry_in_cache(H5C_t * cache_ptr,
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
+ * Programmer: Dana Robinson
* Spring 2016
*
*-------------------------------------------------------------------------
@@ -2310,7 +2208,7 @@ error:
} /* create_entry_arrays() */
-
+
/*-------------------------------------------------------------------------
* Function: free_entry_arrays
*
@@ -2318,7 +2216,7 @@ error:
*
* Return: void
*
- * Programmer: Dana Robinson
+ * Programmer: Dana Robinson
* Spring 2016
*
*-------------------------------------------------------------------------
@@ -2376,15 +2274,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
*
*-------------------------------------------------------------------------
@@ -2436,8 +2334,10 @@ reset_entries(void)
base_addr[j].header.ro_ref_count = FALSE;
base_addr[j].header.next = NULL;
base_addr[j].header.prev = NULL;
+#if H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS
base_addr[j].header.aux_next = NULL;
base_addr[j].header.aux_prev = NULL;
+#endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */
base_addr[j].self = &(base_addr[j]);
base_addr[j].cache_ptr = NULL;
@@ -2526,15 +2426,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.
*
@@ -2551,7 +2451,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;
@@ -2614,28 +2514,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
*
*-------------------------------------------------------------------------
@@ -2663,7 +2563,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++;
}
@@ -2681,19 +2581,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
*
*-------------------------------------------------------------------------
@@ -2701,9 +2601,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;
@@ -2716,222 +2616,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;
}
}
@@ -2942,7 +2842,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,
@@ -2955,7 +2855,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,
@@ -2972,7 +2872,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,
@@ -2988,7 +2888,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,
@@ -3005,7 +2905,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,
@@ -3018,7 +2918,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,
@@ -3031,7 +2931,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,
@@ -3044,7 +2944,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,
@@ -3059,7 +2959,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,
@@ -3077,18 +2977,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
*
*-------------------------------------------------------------------------
@@ -3137,414 +3037,23 @@ 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.
- *
- * 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.
- *
- * 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
- *
- * Failure: NULL
- *
- * Programmer: JRM -- 9/13/07
- *
- *****************************************************************************/
-
-H5F_t *
-setup_cache(size_t max_cache_size,
- size_t min_clean_size,
- unsigned paged)
-{
- char filename[512];
- hbool_t show_progress = FALSE;
- hbool_t verbose = TRUE;
- int mile_stone = 1;
- hid_t fid = -1;
- H5F_t * file_ptr = NULL;
- H5C_t * cache_ptr = NULL;
- H5F_t * ret_val = NULL;
- haddr_t actual_base_addr;
- hid_t fapl_id = H5P_DEFAULT;
- hid_t fcpl_id = H5P_DEFAULT;
-
- if(show_progress) /* 1 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- saved_fid = -1;
-
- if(pass) {
- if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n";
- }
- }
-
- if(pass && paged) {
- /* Set up paged aggregation strategy */
- if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pset_file_space_strategy() failed.\n";
- H5Pclose(fcpl_id);
- fcpl_id = H5P_DEFAULT;
- }
- }
- if(pass && paged) {
- /* Set up file space page size to BASE_ADDR */
- if(H5Pset_file_space_page_size(fcpl_id, (hsize_t)BASE_ADDR) == FAIL) {
- pass = FALSE;
- failure_mssg = "H5Pset_file_space_page_size() failed.\n";
- H5Pclose(fcpl_id);
- fcpl_id = H5P_DEFAULT;
- }
- }
-
- if(pass)
- saved_fcpl_id = fcpl_id;
- /* setup the file name */
- if(pass) {
- if(NULL == h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))) {
- pass = FALSE;
- failure_mssg = "h5_fixname() failed.\n";
- }
- }
-
- if(show_progress) /* 2 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- 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";
- }
- 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;
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
- } else {
- saved_fapl_id = fapl_id;
- }
- }
-
- if(show_progress) /* 3 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- /* if we either aren't using the core file driver, or a create
- * with the core file driver failed, try again with a regular file.
- * If this fails, we are cooked.
- */
- if(pass && fid < 0) {
- fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- saved_fid = fid;
-
- if(fid < 0) {
- pass = FALSE;
- failure_mssg = "H5Fcreate() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
- } /* end if */
- } /* end if */
-
- if(show_progress) /* 4 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
- HDassert(fid >= 0);
- saved_fid = fid;
- if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) {
- pass = FALSE;
- failure_mssg = "H5Fflush() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
- } else {
- file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE);
- if(file_ptr == NULL) {
- pass = FALSE;
- failure_mssg = "Can't get file_ptr.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
- }
- }
- }
-
- if(show_progress) /* 5 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
-
- /* A bit of fancy footwork here:
- *
- * The call to H5Fcreate() allocates an instance of H5C_t,
- * initializes it, and stores its address in f->shared->cache.
- *
- * We don't want to use this cache, as it has a bunch of extra
- * initialization that may change over time, and in any case
- * it will not in general be configured the way we want it.
- *
- * We used to deal with this problem by storing the file pointer
- * in another instance of H5C_t, and then ignoring the original
- * version. However, this strategy doesn't work any more, as
- * we can't store the file pointer in the instance of H5C_t,
- * and we have modified many cache routines to use a file
- * pointer to look up the target cache.
- *
- * Thus we now make note of the address of the instance of
- * H5C_t created by the call to H5Fcreate(), set
- * file_ptr->shared->cache to NULL, call H5C_create()
- * to allocate a new instance of H5C_t for test purposes,
- * and store than new instance's address in
- * file_ptr->shared->cache.
- *
- * On shut down, we call H5C_dest on our instance of H5C_t,
- * set file_ptr->shared->cache to point to the original
- * instance, and then close the file normally.
- */
-
- HDassert(saved_cache == NULL);
- saved_cache = file_ptr->shared->cache;
- file_ptr->shared->cache = NULL;
-
- cache_ptr = H5C_create(max_cache_size,
- min_clean_size,
- (NUMBER_OF_ENTRY_TYPES - 1),
- types,
- check_write_permitted,
- TRUE,
- NULL,
- NULL);
-
- file_ptr->shared->cache = cache_ptr;
- }
-
- if(show_progress) /* 6 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
- if(cache_ptr == NULL) {
- pass = FALSE;
- failure_mssg = "H5C_create() failed.";
-
- if(verbose)
- HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
- } else if(cache_ptr->magic != H5C__H5C_T_MAGIC) {
- pass = FALSE;
- failure_mssg = "Bad cache_ptr magic.";
-
- if(verbose)
- HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
- }
- }
-
- if(show_progress) /* 7 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) { /* allocate space for test entries */
- actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id,
- (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
-
- if(actual_base_addr == HADDR_UNDEF) {
- pass = FALSE;
- failure_mssg = "H5MF_alloc() failed.";
-
- 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.
- */
- pass = FALSE;
- failure_mssg = "actual_base_addr > BASE_ADDR";
-
- if(verbose)
- HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC);
- }
-
- saved_actual_base_addr = actual_base_addr;
- }
-
- if(show_progress) /* 8 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- if(pass) {
- /* Need to set this else all cache tests will fail */
- cache_ptr->ignore_tags = TRUE;
-
- H5C_stats__reset(cache_ptr);
- ret_val = file_ptr;
- }
-
- if(show_progress) /* 9 */
- HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
- FUNC, mile_stone++, (int)pass);
-
- return(ret_val);
-} /* setup_cache() */
-
-
-/*-------------------------------------------------------------------------
- * Function: takedown_cache()
- *
- * 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.
- *
- * Return: void
- *
- * Programmer: John Mainzer
- * 9/14/07
- *
- *-------------------------------------------------------------------------
- */
-
-void
-takedown_cache(H5F_t * file_ptr,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats)
-{
- char filename[512];
-
- if ( file_ptr != NULL ) {
- H5C_t * cache_ptr = file_ptr->shared->cache;
-
- if ( dump_stats ) {
-
- H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
- }
-
- if ( H5C_prep_for_file_close(file_ptr, H5P_DATASET_XFER_DEFAULT) < 0 ) {
-
- pass = FALSE;
- failure_mssg = "unexpected failure of prep for file close.\n";
- }
-
- flush_cache(file_ptr, TRUE, FALSE, FALSE);
-
- H5C_dest(file_ptr, H5AC_ind_read_dxpl_id);
-
- if ( saved_cache != NULL ) {
-
- file_ptr->shared->cache = saved_cache;
- saved_cache = NULL;
- }
-
- }
-
- if ( saved_fapl_id != H5P_DEFAULT ) {
-
- H5Pclose(saved_fapl_id);
- saved_fapl_id = H5P_DEFAULT;
- }
-
- if ( saved_fcpl_id != H5P_DEFAULT ) {
- H5Pclose(saved_fcpl_id);
- saved_fcpl_id = H5P_DEFAULT;
- }
-
- if ( saved_fid != -1 ) {
-
- if ( H5F_addr_defined(saved_actual_base_addr) ) {
-
- if ( NULL == file_ptr ) {
- file_ptr = (H5F_t *)H5I_object_verify(saved_fid, H5I_FILE);
- HDassert ( file_ptr );
- }
-
- H5MF_xfree(file_ptr, H5FD_MEM_DEFAULT, H5AC_ind_read_dxpl_id, saved_actual_base_addr,
- (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR));
- saved_actual_base_addr = HADDR_UNDEF;
- }
-
- if ( H5Fclose(saved_fid) < 0 ) {
-
- pass = FALSE;
- failure_mssg = "couldn't close test file.";
-
- } else {
-
- saved_fid = -1;
-
- }
-
- if ( ( ! try_core_file_driver ) || ( core_file_driver_failed ) ) {
-
- if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename))
- == NULL ) {
-
- pass = FALSE;
- failure_mssg = "h5_fixname() failed.\n";
- }
-
- if ( HDremove(filename) < 0 ) {
-
- pass = FALSE;
- failure_mssg = "couldn't delete test file.";
-
- }
- }
- }
-
- return;
-
-} /* 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
*
*-------------------------------------------------------------------------
*/
@@ -3574,14 +3083,13 @@ 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, H5AC_ind_read_dxpl_id,
- types[type], entry_ptr->addr, H5C__NO_FLAGS_SET);
+ result = H5C_expunge_entry(file_ptr, types[type], entry_ptr->addr, H5C__NO_FLAGS_SET);
if ( result < 0 ) {
@@ -3590,7 +3098,7 @@ expunge_entry(H5F_t * file_ptr,
} else {
- entry_ptr->expunged = TRUE;
+ entry_ptr->expunged = TRUE;
}
}
@@ -3598,16 +3106,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
*
*-------------------------------------------------------------------------
@@ -3632,12 +3140,10 @@ flush_cache(H5F_t * file_ptr,
cache_ptr = file_ptr->shared->cache;
if(destroy_entries)
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id,
- H5C__FLUSH_INVALIDATE_FLAG);
+ result = H5C_flush_cache(file_ptr, H5C__FLUSH_INVALIDATE_FLAG);
else
- result = H5C_flush_cache(file_ptr, H5AC_ind_read_dxpl_id,
- H5C__NO_FLAGS_SET);
+ result = H5C_flush_cache(file_ptr, H5C__NO_FLAGS_SET);
if(dump_stats)
H5C_stats(cache_ptr, "test cache", dump_detailed_stats);
@@ -3669,18 +3175,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
*
*-------------------------------------------------------------------------
*/
@@ -3705,18 +3211,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
*
*-------------------------------------------------------------------------
*/
@@ -3741,17 +3247,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
*
*-------------------------------------------------------------------------
@@ -3765,7 +3271,6 @@ insert_entry(H5F_t * file_ptr,
{
H5C_t * cache_ptr;
herr_t result;
- hid_t xfer = H5AC_ind_read_dxpl_id;
hbool_t insert_pinned;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@@ -3796,13 +3301,9 @@ insert_entry(H5F_t * file_ptr,
/* Set the base address of the entry type into the property list as tag */
/* Use to cork entries for the object */
- if(H5AC_tag(xfer, baddrs, NULL) < 0) {
- pass = FALSE;
- failure_mssg = "error in H5P_set().";
- }
+ H5AC_tag(baddrs, NULL);
- result = H5C_insert_entry(file_ptr, xfer,
- types[type], entry_ptr->addr, (void *)entry_ptr, flags);
+ result = H5C_insert_entry(file_ptr, types[type], entry_ptr->addr, (void *)entry_ptr, flags);
if ( ( result < 0 ) ||
( entry_ptr->header.is_protected ) ||
@@ -3819,7 +3320,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",
@@ -3852,17 +3353,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
*
*-------------------------------------------------------------------------
@@ -3889,10 +3390,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);
@@ -3920,17 +3421,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
*
*-------------------------------------------------------------------------
@@ -3943,7 +3444,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;
@@ -4003,8 +3504,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().";
@@ -4026,17 +3527,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
*
*-------------------------------------------------------------------------
@@ -4048,7 +3549,6 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx)
test_entry_t * base_addr;
test_entry_t * entry_ptr;
haddr_t baddrs;
- hid_t xfer = H5AC_ind_read_dxpl_id;
H5C_cache_entry_t * cache_entry_ptr;
if(pass) {
@@ -4069,13 +3569,10 @@ protect_entry(H5F_t * file_ptr, int32_t type, int32_t idx)
/* Set the base address of the entry type into the property list as tag */
/* Use to cork entries for the object */
- if(H5AC_tag(xfer, baddrs, NULL) < 0) {
- pass = FALSE;
- failure_mssg = "error in H5P_set().";
- } /* end if */
+ H5AC_tag(baddrs, NULL);
- cache_entry_ptr = (H5C_cache_entry_t *)H5C_protect(file_ptr, xfer,
- 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 ) ||
@@ -4105,7 +3602,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);
@@ -4116,35 +3613,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
*
*-------------------------------------------------------------------------
@@ -4175,10 +3672,10 @@ 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, H5AC_ind_read_dxpl_id,
+ 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 ) ||
@@ -4194,14 +3691,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 );
@@ -4211,17 +3708,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
*
*-------------------------------------------------------------------------
@@ -4248,41 +3745,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
*
*-------------------------------------------------------------------------
@@ -4308,8 +3805,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);
@@ -4327,7 +3824,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 );
@@ -4337,17 +3834,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
*
*-------------------------------------------------------------------------
@@ -4378,12 +3875,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;
@@ -4394,13 +3891,12 @@ unprotect_entry(H5F_t * file_ptr,
mark_flush_dep_dirty(entry_ptr);
} /* end if */
- result = H5C_unprotect(file_ptr, H5AC_ind_read_dxpl_id,
- entry_ptr->addr, (void *)entry_ptr, flags);
+ result = H5C_unprotect(file_ptr, entry_ptr->addr, (void *)entry_ptr, flags);
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 ) ) {
@@ -4411,33 +3907,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;
}
}
@@ -4451,26 +3947,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
*
*-------------------------------------------------------------------------
@@ -4487,7 +3983,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)
{
@@ -4515,7 +4011,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;
@@ -4526,7 +4022,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--;
@@ -4537,7 +4033,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--;
@@ -4548,7 +4044,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) */
@@ -4559,7 +4055,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--;
@@ -4570,7 +4066,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;
@@ -4581,83 +4077,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;
@@ -4668,7 +4164,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--;
@@ -4679,7 +4175,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) {
@@ -4691,7 +4187,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:
@@ -4700,14 +4196,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;
@@ -4716,7 +4212,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:
@@ -4725,14 +4221,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;
@@ -4749,7 +4245,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 */
@@ -4767,17 +4263,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
*
*-------------------------------------------------------------------------
@@ -4872,17 +4368,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
*
*-------------------------------------------------------------------------
@@ -4900,7 +4396,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)
{
@@ -4976,7 +4472,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);
}
@@ -5004,73 +4500,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 ) ) {
@@ -5176,17 +4672,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
*
*-------------------------------------------------------------------------
@@ -5281,17 +4777,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
*
*-------------------------------------------------------------------------
@@ -5299,7 +4795,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,
@@ -5389,17 +4885,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
*
*-------------------------------------------------------------------------
@@ -5505,17 +5001,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
*
*-------------------------------------------------------------------------
@@ -5523,7 +5019,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,
@@ -5583,8 +5079,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);
@@ -5626,17 +5122,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
*
*-------------------------------------------------------------------------
@@ -5741,17 +5237,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
*
*-------------------------------------------------------------------------
@@ -5822,17 +5318,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
*
*-------------------------------------------------------------------------
@@ -5913,7 +5409,7 @@ destroy_flush_dependency(int32_t par_type,
} /* end if */
} /* destroy_flush_dependency() */
-
+
/*-------------------------------------------------------------------------
* Function: mark_flush_dep_dirty()
*
@@ -5956,7 +5452,7 @@ mark_flush_dep_dirty(test_entry_t * entry_ptr)
} /* end if */
} /* end mark_flush_dep_dirty() */
-
+
/*-------------------------------------------------------------------------
* Function: mark_flush_dep_clean()
*
@@ -5999,31 +5495,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
*
*-------------------------------------------------------------------------
@@ -6047,7 +5543,7 @@ check_and_validate_cache_hit_rate(hid_t file_id,
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6138,24 +5634,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
*
*-------------------------------------------------------------------------
@@ -6184,7 +5680,7 @@ check_and_validate_cache_size(hid_t file_id,
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6329,21 +5825,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
*
*-------------------------------------------------------------------------
@@ -6366,7 +5862,7 @@ validate_mdc_config(hid_t file_id,
/* get a pointer to the files internal data structure */
if ( pass ) {
- file_ptr = (H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6397,7 +5893,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;
@@ -6430,7 +5926,7 @@ validate_mdc_config(hid_t file_id,
* the supplied external configuration.
*
* The cache also sets the initial_size field to the current
- * cache max size instead of the value initialy supplied.
+ * cache max size instead of the value initially supplied.
* Depending on circumstances, this may or may not match
* the original. Hence the compare_init parameter.
*/
@@ -6448,12 +5944,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
@@ -6481,7 +5977,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),
@@ -6496,17 +5992,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_common.h b/test/cache_common.h
index 8999e44..785dc21 100644
--- a/test/cache_common.h
+++ b/test/cache_common.h
@@ -14,20 +14,22 @@
/* Programmer: John Mainzer
* 10/27/05
*
- * This file contains common #defines, type definitions, and
- * externs for tests of the cache implemented in H5C.c
+ * This file contains common #defines, type definitions, and
+ * externs for tests of the cache implemented in H5C.c
*/
#ifndef _CACHE_COMMON_H
#define _CACHE_COMMON_H
-#define H5C_FRIEND /*suppress error about including H5Cpkg */
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5C_FRIEND /*suppress error about including H5Cpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
/* Include library header files */
#include "H5ACprivate.h"
+#include "H5MFprivate.h"
#include "H5Cpkg.h"
#include "H5Fpkg.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Include test header files */
#include "h5test.h"
@@ -35,174 +37,174 @@
/* Macro to make error reporting easier */
#define CACHE_ERROR(s) {failure_mssg = "Line #" H5_TOSTRING(__LINE__) ": " s ; pass = FALSE; goto done;}
-#define NO_CHANGE -1
+#define NO_CHANGE -1
/* with apologies for the abuse of terminology... */
-#define PICO_ENTRY_TYPE 0
-#define NANO_ENTRY_TYPE 1
-#define MICRO_ENTRY_TYPE 2
-#define TINY_ENTRY_TYPE 3
-#define SMALL_ENTRY_TYPE 4
-#define MEDIUM_ENTRY_TYPE 5
-#define LARGE_ENTRY_TYPE 6
-#define HUGE_ENTRY_TYPE 7
-#define MONSTER_ENTRY_TYPE 8
-#define VARIABLE_ENTRY_TYPE 9
-#define NOTIFY_ENTRY_TYPE 10
+#define PICO_ENTRY_TYPE 0
+#define NANO_ENTRY_TYPE 1
+#define MICRO_ENTRY_TYPE 2
+#define TINY_ENTRY_TYPE 3
+#define SMALL_ENTRY_TYPE 4
+#define MEDIUM_ENTRY_TYPE 5
+#define LARGE_ENTRY_TYPE 6
+#define HUGE_ENTRY_TYPE 7
+#define MONSTER_ENTRY_TYPE 8
+#define VARIABLE_ENTRY_TYPE 9
+#define NOTIFY_ENTRY_TYPE 10
#define NUMBER_OF_ENTRY_TYPES 11
-#define PICO_ENTRY_SIZE (size_t)1
-#define NANO_ENTRY_SIZE (size_t)4
-#define MICRO_ENTRY_SIZE (size_t)16
-#define TINY_ENTRY_SIZE (size_t)64
-#define SMALL_ENTRY_SIZE (size_t)256
-#define MEDIUM_ENTRY_SIZE (size_t)1024
-#define LARGE_ENTRY_SIZE (size_t)(4 * 1024)
-#define HUGE_ENTRY_SIZE (size_t)(16 * 1024)
-#define MONSTER_ENTRY_SIZE (size_t)(64 * 1024)
-#define VARIABLE_ENTRY_SIZE (size_t)(10 * 1024)
-#define NOTIFY_ENTRY_SIZE (size_t)1
-
-#define NUM_PICO_ENTRIES (10 * 1024)
-#define NUM_NANO_ENTRIES (10 * 1024)
-#define NUM_MICRO_ENTRIES (10 * 1024)
-#define NUM_TINY_ENTRIES (10 * 1024)
-#define NUM_SMALL_ENTRIES (10 * 1024)
-#define NUM_MEDIUM_ENTRIES (10 * 1024)
-#define NUM_LARGE_ENTRIES (10 * 1024)
-#define NUM_HUGE_ENTRIES (10 * 1024)
-#define NUM_MONSTER_ENTRIES (10 * 1024)
-#define NUM_VARIABLE_ENTRIES (10 * 1024)
-#define NUM_NOTIFY_ENTRIES (10 * 1024)
-
-#define MAX_ENTRIES (10 * 1024)
+#define PICO_ENTRY_SIZE (size_t)1
+#define NANO_ENTRY_SIZE (size_t)4
+#define MICRO_ENTRY_SIZE (size_t)16
+#define TINY_ENTRY_SIZE (size_t)64
+#define SMALL_ENTRY_SIZE (size_t)256
+#define MEDIUM_ENTRY_SIZE (size_t)1024
+#define LARGE_ENTRY_SIZE (size_t)(4 * 1024)
+#define HUGE_ENTRY_SIZE (size_t)(16 * 1024)
+#define MONSTER_ENTRY_SIZE (size_t)(64 * 1024)
+#define VARIABLE_ENTRY_SIZE (size_t)(10 * 1024)
+#define NOTIFY_ENTRY_SIZE (size_t)1
+
+#define NUM_PICO_ENTRIES (10 * 1024)
+#define NUM_NANO_ENTRIES (10 * 1024)
+#define NUM_MICRO_ENTRIES (10 * 1024)
+#define NUM_TINY_ENTRIES (10 * 1024)
+#define NUM_SMALL_ENTRIES (10 * 1024)
+#define NUM_MEDIUM_ENTRIES (10 * 1024)
+#define NUM_LARGE_ENTRIES (10 * 1024)
+#define NUM_HUGE_ENTRIES (10 * 1024)
+#define NUM_MONSTER_ENTRIES (10 * 1024)
+#define NUM_VARIABLE_ENTRIES (10 * 1024)
+#define NUM_NOTIFY_ENTRIES (10 * 1024)
+
+#define MAX_ENTRIES (10 * 1024)
/* The choice of the BASE_ADDR below is arbitrary -- it just has to be
* larger than the superblock.
*/
-#define BASE_ADDR (haddr_t)1024
-#define PICO_BASE_ADDR BASE_ADDR
-#define NANO_BASE_ADDR (haddr_t)(PICO_BASE_ADDR + \
+#define BASE_ADDR (haddr_t)1024
+#define PICO_BASE_ADDR BASE_ADDR
+#define NANO_BASE_ADDR (haddr_t)(PICO_BASE_ADDR + \
(PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
-#define MICRO_BASE_ADDR (haddr_t)(NANO_BASE_ADDR + \
+#define MICRO_BASE_ADDR (haddr_t)(NANO_BASE_ADDR + \
(NANO_ENTRY_SIZE * NUM_NANO_ENTRIES))
-#define TINY_BASE_ADDR (haddr_t)(MICRO_BASE_ADDR + \
- (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
-#define SMALL_BASE_ADDR (haddr_t)(TINY_BASE_ADDR + \
+#define TINY_BASE_ADDR (haddr_t)(MICRO_BASE_ADDR + \
+ (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
+#define SMALL_BASE_ADDR (haddr_t)(TINY_BASE_ADDR + \
(TINY_ENTRY_SIZE * NUM_TINY_ENTRIES))
-#define MEDIUM_BASE_ADDR (haddr_t)(SMALL_BASE_ADDR + \
+#define MEDIUM_BASE_ADDR (haddr_t)(SMALL_BASE_ADDR + \
(SMALL_ENTRY_SIZE * NUM_SMALL_ENTRIES))
-#define LARGE_BASE_ADDR (haddr_t)(MEDIUM_BASE_ADDR + \
+#define LARGE_BASE_ADDR (haddr_t)(MEDIUM_BASE_ADDR + \
(MEDIUM_ENTRY_SIZE * NUM_MEDIUM_ENTRIES))
-#define HUGE_BASE_ADDR (haddr_t)(LARGE_BASE_ADDR + \
+#define HUGE_BASE_ADDR (haddr_t)(LARGE_BASE_ADDR + \
(LARGE_ENTRY_SIZE * NUM_LARGE_ENTRIES))
-#define MONSTER_BASE_ADDR (haddr_t)(HUGE_BASE_ADDR + \
+#define MONSTER_BASE_ADDR (haddr_t)(HUGE_BASE_ADDR + \
(HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
-#define VARIABLE_BASE_ADDR (haddr_t)(MONSTER_BASE_ADDR + \
- (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
-#define NOTIFY_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \
- (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
-
-#define PICO_ALT_BASE_ADDR (haddr_t)(NOTIFY_BASE_ADDR + \
- (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
-#define NANO_ALT_BASE_ADDR (haddr_t)(PICO_ALT_BASE_ADDR + \
+#define VARIABLE_BASE_ADDR (haddr_t)(MONSTER_BASE_ADDR + \
+ (MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
+#define NOTIFY_BASE_ADDR (haddr_t)(VARIABLE_BASE_ADDR + \
+ (VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
+
+#define PICO_ALT_BASE_ADDR (haddr_t)(NOTIFY_BASE_ADDR + \
+ (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
+#define NANO_ALT_BASE_ADDR (haddr_t)(PICO_ALT_BASE_ADDR + \
(PICO_ENTRY_SIZE * NUM_PICO_ENTRIES))
-#define MICRO_ALT_BASE_ADDR (haddr_t)(NANO_ALT_BASE_ADDR + \
+#define MICRO_ALT_BASE_ADDR (haddr_t)(NANO_ALT_BASE_ADDR + \
(NANO_ENTRY_SIZE * NUM_NANO_ENTRIES))
-#define TINY_ALT_BASE_ADDR (haddr_t)(MICRO_ALT_BASE_ADDR + \
- (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
-#define SMALL_ALT_BASE_ADDR (haddr_t)(TINY_ALT_BASE_ADDR + \
+#define TINY_ALT_BASE_ADDR (haddr_t)(MICRO_ALT_BASE_ADDR + \
+ (MICRO_ENTRY_SIZE * NUM_MICRO_ENTRIES))
+#define SMALL_ALT_BASE_ADDR (haddr_t)(TINY_ALT_BASE_ADDR + \
(TINY_ENTRY_SIZE * NUM_TINY_ENTRIES))
-#define MEDIUM_ALT_BASE_ADDR (haddr_t)(SMALL_ALT_BASE_ADDR + \
+#define MEDIUM_ALT_BASE_ADDR (haddr_t)(SMALL_ALT_BASE_ADDR + \
(SMALL_ENTRY_SIZE * NUM_SMALL_ENTRIES))
-#define LARGE_ALT_BASE_ADDR (haddr_t)(MEDIUM_ALT_BASE_ADDR + \
+#define LARGE_ALT_BASE_ADDR (haddr_t)(MEDIUM_ALT_BASE_ADDR + \
(MEDIUM_ENTRY_SIZE * NUM_MEDIUM_ENTRIES))
-#define HUGE_ALT_BASE_ADDR (haddr_t)(LARGE_ALT_BASE_ADDR + \
+#define HUGE_ALT_BASE_ADDR (haddr_t)(LARGE_ALT_BASE_ADDR + \
(LARGE_ENTRY_SIZE * NUM_LARGE_ENTRIES))
-#define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \
+#define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \
(HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES))
-#define VARIABLE_ALT_BASE_ADDR (haddr_t)(MONSTER_ALT_BASE_ADDR + \
+#define VARIABLE_ALT_BASE_ADDR (haddr_t)(MONSTER_ALT_BASE_ADDR + \
(MONSTER_ENTRY_SIZE * NUM_MONSTER_ENTRIES))
-#define NOTIFY_ALT_BASE_ADDR (haddr_t)(VARIABLE_ALT_BASE_ADDR + \
+#define NOTIFY_ALT_BASE_ADDR (haddr_t)(VARIABLE_ALT_BASE_ADDR + \
(VARIABLE_ENTRY_SIZE * NUM_VARIABLE_ENTRIES))
-#define MAX_ADDR (haddr_t)(NOTIFY_ALT_BASE_ADDR + \
- (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
-#define ADDR_SPACE_SIZE (haddr_t)(MAX_ADDR - BASE_ADDR)
-
-#define MAX_PINS 8 /* Maximum number of entries that can be
- * directly pinned by a single entry.
- */
-
-#define FLUSH_OP__NO_OP 0
-#define FLUSH_OP__DIRTY 1
-#define FLUSH_OP__RESIZE 2
-#define FLUSH_OP__MOVE 3
-#define FLUSH_OP__ORDER 4
-#define FLUSH_OP__EXPUNGE 5
-#define FLUSH_OP__DEST_FLUSH_DEP 6
-#define FLUSH_OP__MAX_OP 6
-
-#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
- * that can be associated with a
- * cache entry.
- */
+#define MAX_ADDR (haddr_t)(NOTIFY_ALT_BASE_ADDR + \
+ (NOTIFY_ENTRY_SIZE * NUM_NOTIFY_ENTRIES))
+#define ADDR_SPACE_SIZE (haddr_t)(MAX_ADDR - BASE_ADDR)
+
+#define MAX_PINS 8 /* Maximum number of entries that can be
+ * directly pinned by a single entry.
+ */
+
+#define FLUSH_OP__NO_OP 0
+#define FLUSH_OP__DIRTY 1
+#define FLUSH_OP__RESIZE 2
+#define FLUSH_OP__MOVE 3
+#define FLUSH_OP__ORDER 4
+#define FLUSH_OP__EXPUNGE 5
+#define FLUSH_OP__DEST_FLUSH_DEP 6
+#define FLUSH_OP__MAX_OP 6
+
+#define MAX_FLUSH_OPS 10 /* Maximum number of flush operations
+ * that can be associated with a
+ * cache entry.
+ */
#define MAX_FLUSH_DEP_PARS 8 /* Maximum number of flush dependency
* parents in the test */
typedef struct flush_op
{
- int op_code; /* integer op code indicating the
- * operation to be performed. At
- * present it must be one of:
- *
- * FLUSH_OP__NO_OP
- * FLUSH_OP__DIRTY
- * FLUSH_OP__RESIZE
- * FLUSH_OP__MOVE
- * FLUSH_OP__ORDER
- */
- int type; /* type code of the cache entry that
- * is the target of the operation.
- * This value is passed into the
- * function implementing the flush
- * operation.
- */
- int idx; /* index of the cache entry that
- * is the target of the operation.
- * This value is passed into the
+ int op_code; /* integer op code indicating the
+ * operation to be performed. At
+ * present it must be one of:
+ *
+ * FLUSH_OP__NO_OP
+ * FLUSH_OP__DIRTY
+ * FLUSH_OP__RESIZE
+ * FLUSH_OP__MOVE
+ * FLUSH_OP__ORDER
+ */
+ int type; /* type code of the cache entry that
+ * is the target of the operation.
+ * This value is passed into the
+ * function implementing the flush
+ * operation.
+ */
+ int idx; /* index of the cache entry that
+ * is the target of the operation.
+ * This value is passed into the
* function implementing the flush
* operation.
- */
- hbool_t flag; /* boolean flag passed into the
- * function implementing the flush
- * operation. The meaning of the
- * flag is dependant upon the flush
- * operation:
- *
- * FLUSH_OP__DIRTY: TRUE iff the
- * target is pinned, and is to
- * be dirtied via the
- * H5C_mark_entry_dirty()
- * call.
- *
- * FLUSH_OP__RESIZE: TRUE iff the
- * target is pinned, and is to
- * be resized via the
- * H5C_resize_entry()
- * call.
- *
- * FLUSH_OP__MOVE: TRUE iff the
- * target is to be moved to
- * its main address.
- */
- size_t size; /* New target size in the
- * FLUSH_OP__MOVE operation.
- * Unused elsewhere.
- */
+ */
+ hbool_t flag; /* boolean flag passed into the
+ * function implementing the flush
+ * operation. The meaning of the
+ * flag is dependent upon the flush
+ * operation:
+ *
+ * FLUSH_OP__DIRTY: TRUE iff the
+ * target is pinned, and is to
+ * be dirtied via the
+ * H5C_mark_entry_dirty()
+ * call.
+ *
+ * FLUSH_OP__RESIZE: TRUE iff the
+ * target is pinned, and is to
+ * be resized via the
+ * H5C_resize_entry()
+ * call.
+ *
+ * FLUSH_OP__MOVE: TRUE iff the
+ * target is to be moved to
+ * its main address.
+ */
+ size_t size; /* New target size in the
+ * FLUSH_OP__MOVE operation.
+ * Unused elsewhere.
+ */
unsigned * order_ptr; /* Pointer to outside counter for
* recording the order of entries
* flushed.
@@ -216,135 +218,135 @@ typedef enum test_entry_action_t {
typedef struct test_entry_t
{
- H5C_cache_entry_t header; /* entry data used by the cache
- * -- must be first
- */
- struct test_entry_t * self; /* pointer to this entry -- used for
- * sanity checking.
+ H5C_cache_entry_t header; /* entry data used by the cache
+ * -- must be first
+ */
+ struct test_entry_t * self; /* pointer to this entry -- used for
+ * sanity checking.
*/
test_entry_action_t action; /* Action being performed on a test entry */
H5F_t * file_ptr; /* pointer to the file in which the
* entry resides, or NULL if the entry
* is not in a file.
*/
- H5C_t * cache_ptr; /* pointer to the cache in which
- * the entry resides, or NULL if the
- * entry is not in cache.
- */
- hbool_t written_to_main_addr;
- /* Flag indicating whether an image
- * of the entry has been written to
- * its main address. Since we no
- * longer have a flush callback, we
- * set this field to true whenever the
- * entry is serialized while at its
- * main address.
- */
- hbool_t written_to_alt_addr;
+ H5C_t * cache_ptr; /* pointer to the cache in which
+ * the entry resides, or NULL if the
+ * entry is not in cache.
+ */
+ hbool_t written_to_main_addr;
+ /* Flag indicating whether an image
+ * of the entry has been written to
+ * its main address. Since we no
+ * longer have a flush callback, we
+ * set this field to true whenever the
+ * entry is serialized while at its
+ * main address.
+ */
+ hbool_t written_to_alt_addr;
/* Flag indicating whether an image
- * of the entry has been written to
- * its alternate address. Since we no
- * longer have a flush callback, we
- * set this field to true whenever the
- * entry is serialized while at its
- * alternate address.
- */
- haddr_t addr; /* where the cache thinks this entry
+ * of the entry has been written to
+ * its alternate address. Since we no
+ * longer have a flush callback, we
+ * set this field to true whenever the
+ * entry is serialized while at its
+ * alternate address.
+ */
+ haddr_t addr; /* where the cache thinks this entry
* is located
*/
- hbool_t at_main_addr; /* boolean flag indicating whether
- * the entry is supposed to be at
- * either its main or alternate
- * address.
- */
- haddr_t main_addr; /* initial location of the entry
+ hbool_t at_main_addr; /* boolean flag indicating whether
+ * the entry is supposed to be at
+ * either its main or alternate
+ * address.
+ */
+ haddr_t main_addr; /* initial location of the entry
*/
- haddr_t alt_addr; /* location to which the entry
- * can be relocated or "moved"
+ haddr_t alt_addr; /* location to which the entry
+ * can be relocated or "moved"
*/
- size_t size; /* how big the cache thinks this
+ size_t size; /* how big the cache thinks this
* entry is
*/
- int32_t type; /* indicates which entry array this
- * entry is in
+ int32_t type; /* indicates which entry array this
+ * entry is in
*/
- int32_t index; /* index in its entry array
+ int32_t index; /* index in its entry array
*/
- int32_t serializes; /* number of times this entry has
- * been serialized.
+ int32_t serializes; /* number of times this entry has
+ * been serialized.
*/
- int32_t deserializes; /* number of times this entry has
+ int32_t deserializes; /* number of times this entry has
* been deserialized
*/
- hbool_t is_dirty; /* entry has been modified since
+ hbool_t is_dirty; /* entry has been modified since
* last write
*/
- hbool_t is_protected; /* entry should currently be on
- * the cache's protected list.
+ hbool_t is_protected; /* entry should currently be on
+ * the cache's protected list.
*/
- hbool_t is_read_only; /* TRUE iff the entry should be
- * protected read only.
- */
- int ro_ref_count; /* Number of outstanding read only
- * protects on the entry.
- */
- hbool_t is_pinned; /* entry is currently pinned in
- * the cache.
+ hbool_t is_read_only; /* TRUE iff the entry should be
+ * protected read only.
+ */
+ int ro_ref_count; /* Number of outstanding read only
+ * protects on the entry.
+ */
+ hbool_t is_pinned; /* entry is currently pinned in
+ * the cache.
*/
- haddr_t tag; /* the base_addr as tag for corking entries */
- hbool_t is_corked; /* entry is currently corked or not */
- int pinning_ref_count; /* Number of entries that
- * pin this entry in the cache.
- * When this count drops to zero,
- * this entry should be unpinned.
- */
- int num_pins; /* Number of entries that this
- * entry pins in the cache. This
- * value must be in the range
- * [0, MAX_PINS].
- */
- int pin_type[MAX_PINS]; /* array of the types of entries
- * pinned by this entry.
- */
- int pin_idx[MAX_PINS]; /* array of the indicies of
- * entries pinned by this entry.
- */
- int num_flush_ops; /* integer field containing the
- * number of flush operations to
- * be executed when the entry is
- * flushed. This value must lie in
- * the closed interval
- * [0, MAX_FLUSH_OPS].
- */
- struct flush_op flush_ops[MAX_FLUSH_OPS]; /* Array of instances
- * of struct flush_op detailing the
- * flush operations (if any) that
- * are to be executed when the entry
- * is flushed from the cache.
- *
- * num_flush_ops contains the number
- * of valid entries in this array.
- */
- hbool_t flush_op_self_resize_in_progress; /* Boolean flag
- * that is set to TRUE iff this
- * entry is being flushed, it has
- * been resized by a resize flush
- * op, and the flush function has
- * not yet returned, This field is
- * used to turn off overactive santity
- * checking code that would otherwise
- * cause a false test failure.
- */
- hbool_t deserialized; /* entry has been deserialized since
- * the last time it was reset.
+ haddr_t tag; /* the base_addr as tag for corking entries */
+ hbool_t is_corked; /* entry is currently corked or not */
+ int pinning_ref_count; /* Number of entries that
+ * pin this entry in the cache.
+ * When this count drops to zero,
+ * this entry should be unpinned.
+ */
+ int num_pins; /* Number of entries that this
+ * entry pins in the cache. This
+ * value must be in the range
+ * [0, MAX_PINS].
+ */
+ int pin_type[MAX_PINS]; /* array of the types of entries
+ * pinned by this entry.
+ */
+ int pin_idx[MAX_PINS]; /* array of the indicies of
+ * entries pinned by this entry.
+ */
+ int num_flush_ops; /* integer field containing the
+ * number of flush operations to
+ * be executed when the entry is
+ * flushed. This value must lie in
+ * the closed interval
+ * [0, MAX_FLUSH_OPS].
+ */
+ struct flush_op flush_ops[MAX_FLUSH_OPS]; /* Array of instances
+ * of struct flush_op detailing the
+ * flush operations (if any) that
+ * are to be executed when the entry
+ * is flushed from the cache.
+ *
+ * num_flush_ops contains the number
+ * of valid entries in this array.
+ */
+ hbool_t flush_op_self_resize_in_progress; /* Boolean flag
+ * that is set to TRUE iff this
+ * entry is being flushed, it has
+ * been resized by a resize flush
+ * op, and the flush function has
+ * not yet returned, This field is
+ * used to turn off overactive santity
+ * checking code that would otherwise
+ * cause a false test failure.
+ */
+ hbool_t deserialized; /* entry has been deserialized since
+ * the last time it was reset.
*/
- hbool_t serialized; /* entry has been serialized since the
+ hbool_t serialized; /* entry has been serialized since the
* last time it was reset.
*/
hbool_t destroyed; /* entry has been destroyed since the
* last time it was reset.
*/
- hbool_t expunged; /* entry has been expunged since the
+ hbool_t expunged; /* entry has been expunged since the
* last time it was reset.
*/
int flush_dep_par_type[MAX_FLUSH_DEP_PARS]; /* Entry types of flush dependency parents */
@@ -352,15 +354,15 @@ typedef struct test_entry_t
unsigned flush_dep_npar; /* Number of flush dependency parents */
unsigned flush_dep_nchd; /* Number of flush dependency children */
unsigned flush_dep_ndirty_chd; /* Number of dirty flush dependency children (including granchildren, etc.) */
- hbool_t pinned_from_client; /* entry was pinned by client call */
- hbool_t pinned_from_cache; /* entry was pinned by cache internally */
+ hbool_t pinned_from_client; /* entry was pinned by client call */
+ hbool_t pinned_from_cache; /* entry was pinned by cache internally */
unsigned flush_order; /* Order that entry was flushed in */
unsigned notify_after_insert_count; /* Count of times that entry was inserted in cache */
unsigned notify_before_evict_count; /* Count of times that entry was removed in cache */
- size_t actual_len; /* Simulate the entry's actual size for a speculative load */
- unsigned max_verify_ct; /* Maximum # of times to verify an entry's checksum */
- unsigned verify_ct; /* Count the # of checksum verification for an entry */
+ size_t actual_len; /* Simulate the entry's actual size for a speculative load */
+ unsigned max_verify_ct; /* Maximum # of times to verify an entry's checksum */
+ unsigned verify_ct; /* Count the # of checksum verification for an entry */
} test_entry_t;
/* The following are cut down test versions of the hash table manipulation
@@ -508,41 +510,35 @@ if ( ( (cache_ptr) == NULL ) || \
(i).empty_reserve = (e).empty_reserve; \
}
-
+
/* misc type definitions */
struct expected_entry_status
{
- int entry_type;
+ int entry_type;
int entry_index;
size_t size;
- hbool_t in_cache;
+ hbool_t in_cache;
hbool_t at_main_addr;
- hbool_t is_dirty;
- hbool_t is_protected;
- hbool_t is_pinned;
- hbool_t deserialized;
- hbool_t serialized;
- hbool_t destroyed;
+ hbool_t is_dirty;
+ hbool_t is_protected;
+ hbool_t is_pinned;
+ hbool_t deserialized;
+ hbool_t serialized;
+ hbool_t destroyed;
int flush_dep_par_type[MAX_FLUSH_DEP_PARS]; /* Entry types of flush dependency parents */
int flush_dep_par_idx[MAX_FLUSH_DEP_PARS]; /* Indices of flush dependency parents */
unsigned flush_dep_npar; /* Number of flush dependency parents */
unsigned flush_dep_nchd; /* Number of flush dependency children */
unsigned flush_dep_ndirty_chd; /* Number of dirty flush dependency children */
int flush_order; /* flush order of entry */
- unsigned char is_corked; /* cork status of entry */
+ unsigned char is_corked; /* cork status of entry */
};
-
-/* global variable externs: */
-H5TEST_DLLVAR H5C_t * saved_cache;
-
-H5TEST_DLLVAR const char *FILENAME[];
-H5TEST_DLLVAR haddr_t saved_actual_base_addr;
-H5TEST_DLLVAR hbool_t write_permitted;
+/* global variable externs: */
H5TEST_DLLVAR hbool_t pass; /* set to false on error */
H5TEST_DLLVAR const char *failure_mssg;
@@ -556,7 +552,7 @@ H5TEST_DLLVAR const haddr_t alt_base_addrs[NUMBER_OF_ENTRY_TYPES];
H5TEST_DLLVAR const H5C_class_t *types[NUMBER_OF_ENTRY_TYPES];
-
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -641,8 +637,6 @@ H5TEST_DLL void resize_entry(H5F_t * file_ptr,
size_t new_size,
hbool_t in_cache);
-H5TEST_DLL H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged);
-
H5TEST_DLL void row_major_scan_forward(H5F_t * file_ptr,
int32_t max_index,
int32_t lag,
@@ -727,10 +721,6 @@ H5TEST_DLL void hl_col_major_scan_backward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects);
-H5TEST_DLL void takedown_cache(H5F_t * file_ptr,
- hbool_t dump_stats,
- hbool_t dump_detailed_stats);
-
H5TEST_DLL void flush_cache(H5F_t * file_ptr,
hbool_t destroy_entries,
hbool_t dump_stats,
@@ -747,7 +737,7 @@ H5TEST_DLL void unprotect_entry(H5F_t * file_ptr,
H5TEST_DLL void verify_clean(void);
H5TEST_DLL void verify_entry_status(H5C_t * cache_ptr,
- int tag,
+ int tag,
int num_entries,
struct expected_entry_status expected[]);
diff --git a/test/cache_image.c b/test/cache_image.c
index 58b0b8f..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,36 +33,36 @@ 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);
static void verify_datasets(hid_t file_id, int min_dset, int max_dset);
/* local test function declarations */
-static unsigned check_cache_image_ctl_flow_1(void);
-static unsigned check_cache_image_ctl_flow_2(void);
-static unsigned check_cache_image_ctl_flow_3(void);
-static unsigned check_cache_image_ctl_flow_4(void);
-static unsigned check_cache_image_ctl_flow_5(void);
-static unsigned check_cache_image_ctl_flow_6(void);
-
-static unsigned cache_image_smoke_check_1(void);
-static unsigned cache_image_smoke_check_2(void);
-static unsigned cache_image_smoke_check_3(void);
-static unsigned cache_image_smoke_check_4(void);
-static unsigned cache_image_smoke_check_5(void);
-static unsigned cache_image_smoke_check_6(void);
-
-static unsigned cache_image_api_error_check_1(void);
-static unsigned cache_image_api_error_check_2(void);
-static unsigned cache_image_api_error_check_3(void);
-static unsigned cache_image_api_error_check_4(void);
-
-static unsigned get_free_sections_test(void);
-static unsigned evict_on_close_test(void);
-
-
+static unsigned check_cache_image_ctl_flow_1(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_2(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_3(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_4(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_5(hbool_t single_file_vfd);
+static unsigned check_cache_image_ctl_flow_6(hbool_t single_file_vfd);
+
+static unsigned cache_image_smoke_check_1(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_2(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_3(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_4(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_5(hbool_t single_file_vfd);
+static unsigned cache_image_smoke_check_6(hbool_t single_file_vfd);
+
+static unsigned cache_image_api_error_check_1(hbool_t single_file_vfd);
+static unsigned cache_image_api_error_check_2(hbool_t single_file_vfd);
+static unsigned cache_image_api_error_check_3(hbool_t single_file_vfd);
+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(void);
* 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,7 +93,7 @@ static unsigned evict_on_close_test(void);
#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()";
@@ -169,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);
@@ -315,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 ) {
@@ -341,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",
@@ -351,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);
- }
+ }
}
}
}
@@ -361,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++;
@@ -417,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.
@@ -441,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()";
@@ -470,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++;
}
@@ -488,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 persistant 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.
@@ -556,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 ) ||
@@ -586,12 +586,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
/* create a file access propertly list. */
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -600,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;
@@ -625,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;
@@ -654,20 +654,20 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++);
- /* setup the persistant free space manager if indicated */
+ /* 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.";
@@ -693,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 {
@@ -713,6 +713,9 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
file_id = H5Fopen(hdf_file_name, H5F_ACC_RDWR, fapl_id);
}
+ /* tidy up */
+ H5Pclose(fapl_id);
+
if ( file_id < 0 ) {
pass = FALSE;
@@ -720,7 +723,7 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected,
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -776,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 ) ) {
@@ -805,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 ) ) {
@@ -860,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";
- }
+ }
}
}
@@ -888,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.
@@ -910,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;
@@ -928,12 +931,12 @@ attempt_swmr_open_hdf5_file(const hbool_t create_file,
/* create a file access propertly list. */
if ( pass ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
@@ -942,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;
@@ -977,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 {
@@ -992,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++);
@@ -1001,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.
@@ -1026,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()";
@@ -1062,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 ) {
@@ -1154,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 ) {
@@ -1180,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],
@@ -1190,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);
- }
+ }
}
}
}
@@ -1200,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++;
@@ -1256,7 +1259,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
} /* verify_datasets() */
-
+
/****************************************************************************/
/******************************* Test Functions *****************************/
/****************************************************************************/
@@ -1265,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
*
@@ -1329,7 +1332,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset)
*/
static unsigned
-check_cache_image_ctl_flow_1(void)
+check_cache_image_ctl_flow_1(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_1()";
char filename[512];
@@ -1341,9 +1344,16 @@ check_cache_image_ctl_flow_1(void)
TESTING("metadata cache image control flow test 1");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -1358,16 +1368,16 @@ check_cache_image_ctl_flow_1(void)
}
}
- 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 ) {
@@ -1376,8 +1386,8 @@ check_cache_image_ctl_flow_1(void)
/* 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,
@@ -1385,10 +1395,10 @@ check_cache_image_ctl_flow_1(void)
/* 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 ) {
@@ -1396,10 +1406,10 @@ check_cache_image_ctl_flow_1(void)
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 ) {
@@ -1412,26 +1422,26 @@ check_cache_image_ctl_flow_1(void)
}
}
- 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,
@@ -1439,13 +1449,13 @@ check_cache_image_ctl_flow_1(void)
/* 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.
*/
@@ -1461,9 +1471,9 @@ check_cache_image_ctl_flow_1(void)
*/
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -1476,24 +1486,24 @@ check_cache_image_ctl_flow_1(void)
}
}
- 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,
@@ -1501,9 +1511,9 @@ check_cache_image_ctl_flow_1(void)
/* 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. */
@@ -1516,9 +1526,9 @@ check_cache_image_ctl_flow_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 9) Delete the file */
@@ -1541,63 +1551,63 @@ check_cache_image_ctl_flow_1(void)
} /* 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
*
@@ -1608,7 +1618,7 @@ check_cache_image_ctl_flow_1(void)
*/
static unsigned
-check_cache_image_ctl_flow_2(void)
+check_cache_image_ctl_flow_2(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_2()";
char filename[512];
@@ -1620,9 +1630,16 @@ check_cache_image_ctl_flow_2(void)
TESTING("metadata cache image control flow test 2");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the file name */
@@ -1636,16 +1653,16 @@ check_cache_image_ctl_flow_2(void)
}
}
- 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 ) {
@@ -1654,8 +1671,8 @@ check_cache_image_ctl_flow_2(void)
/* 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,
@@ -1663,10 +1680,10 @@ check_cache_image_ctl_flow_2(void)
/* 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 ) {
@@ -1679,26 +1696,26 @@ check_cache_image_ctl_flow_2(void)
}
}
- 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,
@@ -1706,10 +1723,10 @@ check_cache_image_ctl_flow_2(void)
/* 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 ) {
@@ -1721,24 +1738,24 @@ check_cache_image_ctl_flow_2(void)
}
}
- 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,
@@ -1746,9 +1763,9 @@ check_cache_image_ctl_flow_2(void)
/* 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. */
@@ -1761,9 +1778,9 @@ check_cache_image_ctl_flow_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Delete the file */
@@ -1786,81 +1803,81 @@ check_cache_image_ctl_flow_2(void)
} /* 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
*
@@ -1871,7 +1888,7 @@ check_cache_image_ctl_flow_2(void)
*/
static unsigned
-check_cache_image_ctl_flow_3(void)
+check_cache_image_ctl_flow_3(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_3()";
char filename[512];
@@ -1883,6 +1900,13 @@ check_cache_image_ctl_flow_3(void)
TESTING("metadata cache image control flow test 3");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -1901,10 +1925,10 @@ check_cache_image_ctl_flow_3(void)
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.
*/
@@ -1914,8 +1938,8 @@ check_cache_image_ctl_flow_3(void)
/* 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,
@@ -1926,7 +1950,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
if ( pass ) {
@@ -1940,13 +1964,13 @@ check_cache_image_ctl_flow_3(void)
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.
*/
@@ -1956,8 +1980,8 @@ check_cache_image_ctl_flow_3(void)
/* 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,
@@ -1993,13 +2017,13 @@ check_cache_image_ctl_flow_3(void)
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.
*/
@@ -2007,11 +2031,11 @@ check_cache_image_ctl_flow_3(void)
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,
@@ -2021,7 +2045,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Verify the contents of the datasets. */
@@ -2047,13 +2071,13 @@ check_cache_image_ctl_flow_3(void)
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.
*/
@@ -2061,11 +2085,11 @@ check_cache_image_ctl_flow_3(void)
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,
@@ -2087,7 +2111,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Close the file. */
if ( pass ) {
@@ -2102,21 +2126,21 @@ check_cache_image_ctl_flow_3(void)
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,
@@ -2142,7 +2166,7 @@ check_cache_image_ctl_flow_3(void)
if ( show_progress ) /* 14 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 14) Delete the file. */
if ( pass ) {
@@ -2165,73 +2189,73 @@ check_cache_image_ctl_flow_3(void)
} /* 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
*
@@ -2242,7 +2266,7 @@ check_cache_image_ctl_flow_3(void)
*/
static unsigned
-check_cache_image_ctl_flow_4(void)
+check_cache_image_ctl_flow_4(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_4()";
char filename[512];
@@ -2254,6 +2278,13 @@ check_cache_image_ctl_flow_4(void)
TESTING("metadata cache image control flow test 4");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -2272,10 +2303,10 @@ check_cache_image_ctl_flow_4(void)
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.
*/
@@ -2285,8 +2316,8 @@ check_cache_image_ctl_flow_4(void)
/* 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,
@@ -2297,7 +2328,7 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
if ( pass ) {
@@ -2311,13 +2342,13 @@ check_cache_image_ctl_flow_4(void)
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.
*/
@@ -2327,8 +2358,8 @@ check_cache_image_ctl_flow_4(void)
/* 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,
@@ -2353,13 +2384,13 @@ check_cache_image_ctl_flow_4(void)
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.
*/
@@ -2367,11 +2398,11 @@ check_cache_image_ctl_flow_4(void)
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,
@@ -2381,7 +2412,7 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
@@ -2396,13 +2427,13 @@ check_cache_image_ctl_flow_4(void)
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.
*/
@@ -2410,11 +2441,11 @@ check_cache_image_ctl_flow_4(void)
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,
@@ -2440,21 +2471,21 @@ check_cache_image_ctl_flow_4(void)
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,
@@ -2480,7 +2511,7 @@ check_cache_image_ctl_flow_4(void)
if ( show_progress ) /* 11 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 11) Delete the file. */
if ( pass ) {
@@ -2503,66 +2534,66 @@ check_cache_image_ctl_flow_4(void)
} /* 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
*
@@ -2573,7 +2604,7 @@ check_cache_image_ctl_flow_4(void)
*/
static unsigned
-check_cache_image_ctl_flow_5(void)
+check_cache_image_ctl_flow_5(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_5()";
char filename[512];
@@ -2585,6 +2616,13 @@ check_cache_image_ctl_flow_5(void)
TESTING("metadata cache image control flow test 5");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -2604,12 +2642,12 @@ check_cache_image_ctl_flow_5(void)
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.
*/
@@ -2619,8 +2657,8 @@ check_cache_image_ctl_flow_5(void)
/* 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,
@@ -2630,7 +2668,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Create some datasets. */
@@ -2642,7 +2680,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 3) Close the file. */
if ( pass ) {
@@ -2657,30 +2695,30 @@ check_cache_image_ctl_flow_5(void)
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,
@@ -2701,7 +2739,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
if ( pass ) {
@@ -2716,12 +2754,12 @@ check_cache_image_ctl_flow_5(void)
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.
*/
@@ -2729,11 +2767,11 @@ check_cache_image_ctl_flow_5(void)
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,
@@ -2753,8 +2791,8 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 9) Close the file. */
if ( pass ) {
@@ -2769,7 +2807,7 @@ check_cache_image_ctl_flow_5(void)
if ( show_progress ) /* 10 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 10) Delete the file. */
if ( pass ) {
@@ -2792,58 +2830,58 @@ check_cache_image_ctl_flow_5(void)
} /* 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
*
@@ -2854,7 +2892,7 @@ check_cache_image_ctl_flow_5(void)
*/
static unsigned
-check_cache_image_ctl_flow_6(void)
+check_cache_image_ctl_flow_6(hbool_t single_file_vfd)
{
const char * fcn_name = "check_cache_image_ctl_flow_6()";
char filename[512];
@@ -2866,6 +2904,13 @@ check_cache_image_ctl_flow_6(void)
TESTING("metadata cache image control flow test 6");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
if ( show_progress ) /* 0 */
@@ -2885,12 +2930,12 @@ check_cache_image_ctl_flow_6(void)
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.
*/
@@ -2900,8 +2945,8 @@ check_cache_image_ctl_flow_6(void)
/* 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,
@@ -2911,7 +2956,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 2) Close the file. */
@@ -2927,30 +2972,30 @@ check_cache_image_ctl_flow_6(void)
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,
@@ -2961,7 +3006,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 5) Close the file. */
if ( pass ) {
@@ -2976,12 +3021,12 @@ check_cache_image_ctl_flow_6(void)
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.
*/
@@ -2989,11 +3034,11 @@ check_cache_image_ctl_flow_6(void)
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,
@@ -3004,7 +3049,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 6) Close the file. */
if ( pass ) {
@@ -3019,7 +3064,7 @@ check_cache_image_ctl_flow_6(void)
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 7) Delete the file. */
if ( pass ) {
@@ -3042,93 +3087,93 @@ check_cache_image_ctl_flow_6(void)
} /* 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
*
@@ -3139,7 +3184,7 @@ check_cache_image_ctl_flow_6(void)
*/
static unsigned
-cache_image_smoke_check_1(void)
+cache_image_smoke_check_1(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_1()";
char filename[512];
@@ -3151,9 +3196,16 @@ cache_image_smoke_check_1(void)
TESTING("metadata cache image smoke check 1");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3168,13 +3220,13 @@ cache_image_smoke_check_1(void)
}
}
- 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.
*/
@@ -3185,8 +3237,8 @@ cache_image_smoke_check_1(void)
/* 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,
@@ -3194,10 +3246,10 @@ cache_image_smoke_check_1(void)
/* 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 ) {
@@ -3218,10 +3270,10 @@ cache_image_smoke_check_1(void)
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -3234,26 +3286,26 @@ cache_image_smoke_check_1(void)
}
}
- 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,
@@ -3261,13 +3313,13 @@ cache_image_smoke_check_1(void)
/* 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.
*/
@@ -3287,9 +3339,9 @@ cache_image_smoke_check_1(void)
}
#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. */
@@ -3302,24 +3354,24 @@ cache_image_smoke_check_1(void)
}
}
- 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,
@@ -3327,13 +3379,13 @@ cache_image_smoke_check_1(void)
/* 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.
*/
@@ -3354,7 +3406,7 @@ cache_image_smoke_check_1(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3369,24 +3421,24 @@ cache_image_smoke_check_1(void)
}
}
- 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,
@@ -3394,13 +3446,13 @@ cache_image_smoke_check_1(void)
/* 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 ) {
@@ -3412,24 +3464,24 @@ cache_image_smoke_check_1(void)
}
}
- 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,
@@ -3437,13 +3489,13 @@ cache_image_smoke_check_1(void)
/* 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 ) {
@@ -3463,10 +3515,10 @@ cache_image_smoke_check_1(void)
#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 ) {
@@ -3478,9 +3530,9 @@ cache_image_smoke_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 15) Delete the file */
@@ -3503,55 +3555,55 @@ cache_image_smoke_check_1(void)
} /* 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
*
@@ -3562,7 +3614,7 @@ cache_image_smoke_check_1(void)
*/
static unsigned
-cache_image_smoke_check_2(void)
+cache_image_smoke_check_2(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_2()";
char filename[512];
@@ -3574,9 +3626,16 @@ cache_image_smoke_check_2(void)
TESTING("metadata cache image smoke check 2");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3591,13 +3650,13 @@ cache_image_smoke_check_2(void)
}
}
- 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.
*/
@@ -3608,8 +3667,8 @@ cache_image_smoke_check_2(void)
/* 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,
@@ -3617,10 +3676,10 @@ cache_image_smoke_check_2(void)
/* 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 ) {
@@ -3640,10 +3699,10 @@ cache_image_smoke_check_2(void)
#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 ) {
@@ -3656,24 +3715,23 @@ cache_image_smoke_check_2(void)
}
}
- 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,
@@ -3682,15 +3740,15 @@ cache_image_smoke_check_2(void)
}
/* 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 ) {
@@ -3702,24 +3760,24 @@ cache_image_smoke_check_2(void)
}
}
- 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,
@@ -3727,13 +3785,13 @@ cache_image_smoke_check_2(void)
/* 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.
*/
@@ -3742,7 +3800,7 @@ cache_image_smoke_check_2(void)
verify_datasets(file_id, 0, 5);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3757,9 +3815,9 @@ cache_image_smoke_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 9) Delete the file */
@@ -3782,77 +3840,77 @@ cache_image_smoke_check_2(void)
} /* 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
*
@@ -3863,7 +3921,7 @@ cache_image_smoke_check_2(void)
*/
static unsigned
-cache_image_smoke_check_3(void)
+cache_image_smoke_check_3(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_3()";
char filename[512];
@@ -3875,9 +3933,16 @@ cache_image_smoke_check_3(void)
TESTING("metadata cache image smoke check 3");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -3892,13 +3957,13 @@ cache_image_smoke_check_3(void)
}
}
- 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.
*/
@@ -3909,8 +3974,8 @@ cache_image_smoke_check_3(void)
/* 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,
@@ -3918,10 +3983,10 @@ cache_image_smoke_check_3(void)
/* 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 ) {
@@ -3940,10 +4005,10 @@ cache_image_smoke_check_3(void)
}
#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 ) {
@@ -3956,24 +4021,24 @@ cache_image_smoke_check_3(void)
}
}
- 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,
@@ -3981,13 +4046,13 @@ cache_image_smoke_check_3(void)
/* 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.
*/
@@ -4007,10 +4072,10 @@ cache_image_smoke_check_3(void)
}
#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 ) {
@@ -4022,24 +4087,24 @@ cache_image_smoke_check_3(void)
}
}
- 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,
@@ -4047,13 +4112,13 @@ cache_image_smoke_check_3(void)
/* 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.
*/
@@ -4074,7 +4139,7 @@ cache_image_smoke_check_3(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4088,22 +4153,22 @@ cache_image_smoke_check_3(void)
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,
@@ -4111,13 +4176,13 @@ cache_image_smoke_check_3(void)
/* 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.
*/
@@ -4138,7 +4203,7 @@ cache_image_smoke_check_3(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4153,9 +4218,9 @@ cache_image_smoke_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Delete the file */
@@ -4178,66 +4243,66 @@ cache_image_smoke_check_3(void)
} /* 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
*
@@ -4248,7 +4313,7 @@ cache_image_smoke_check_3(void)
*/
static unsigned
-cache_image_smoke_check_4(void)
+cache_image_smoke_check_4(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_4()";
char filename[512];
@@ -4262,9 +4327,16 @@ cache_image_smoke_check_4(void)
TESTING("metadata cache image smoke check 4");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4279,13 +4351,13 @@ cache_image_smoke_check_4(void)
}
}
- 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.
*/
@@ -4296,8 +4368,8 @@ cache_image_smoke_check_4(void)
/* 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,
@@ -4305,10 +4377,10 @@ cache_image_smoke_check_4(void)
/* 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 ) {
@@ -4327,10 +4399,10 @@ cache_image_smoke_check_4(void)
}
#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 ) {
@@ -4343,26 +4415,26 @@ cache_image_smoke_check_4(void)
}
}
- 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,
@@ -4370,11 +4442,11 @@ cache_image_smoke_check_4(void)
/* 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 ) {
@@ -4393,11 +4465,11 @@ cache_image_smoke_check_4(void)
}
#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 ) {
@@ -4410,27 +4482,27 @@ cache_image_smoke_check_4(void)
}
}
- 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,
@@ -4438,13 +4510,13 @@ cache_image_smoke_check_4(void)
/* 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.
*/
@@ -4465,7 +4537,7 @@ cache_image_smoke_check_4(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4479,22 +4551,22 @@ cache_image_smoke_check_4(void)
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,
@@ -4502,13 +4574,13 @@ cache_image_smoke_check_4(void)
/* 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.
*/
@@ -4529,7 +4601,7 @@ cache_image_smoke_check_4(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4544,7 +4616,7 @@ cache_image_smoke_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 13) Delete the file */
@@ -4565,82 +4637,81 @@ cache_image_smoke_check_4(void)
FUNC, failure_mssg);
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
*
@@ -4650,10 +4721,10 @@ cache_image_smoke_check_4(void)
*-------------------------------------------------------------------------
*/
-#define MAX_NUM_GROUPS 128
+#define MAX_NUM_GROUPS 64
static unsigned
-cache_image_smoke_check_5(void)
+cache_image_smoke_check_5(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_5()";
char filename[512];
@@ -4670,30 +4741,41 @@ cache_image_smoke_check_5(void)
TESTING("metadata cache image smoke check 5");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* setup the file name */
if ( pass ) {
- if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, filename, sizeof(filename))
+ hid_t fapl_id = h5_fileaccess();
+
+ if ( h5_fixname(FILENAMES[0], fapl_id, filename, sizeof(filename))
== NULL ) {
pass = FALSE;
failure_mssg = "h5_fixname() failed.\n";
}
+
+ 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.
*/
@@ -4704,8 +4786,8 @@ cache_image_smoke_check_5(void)
/* 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,
@@ -4713,31 +4795,31 @@ cache_image_smoke_check_5(void)
/* 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
@@ -4751,16 +4833,16 @@ cache_image_smoke_check_5(void)
}
#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)";
}
@@ -4776,26 +4858,26 @@ cache_image_smoke_check_5(void)
}
}
- 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,
@@ -4803,13 +4885,13 @@ cache_image_smoke_check_5(void)
/* 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
@@ -4823,47 +4905,47 @@ cache_image_smoke_check_5(void)
}
#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)";
}
@@ -4879,24 +4961,24 @@ cache_image_smoke_check_5(void)
}
}
- 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,
@@ -4911,10 +4993,10 @@ cache_image_smoke_check_5(void)
/* 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) {
@@ -4935,20 +5017,20 @@ cache_image_smoke_check_5(void)
}
}
- /* 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,
@@ -4956,7 +5038,7 @@ cache_image_smoke_check_5(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4964,10 +5046,10 @@ cache_image_smoke_check_5(void)
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 ) {
@@ -4980,7 +5062,7 @@ cache_image_smoke_check_5(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -4994,22 +5076,22 @@ cache_image_smoke_check_5(void)
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,
@@ -5017,22 +5099,21 @@ cache_image_smoke_check_5(void)
/* 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);
+ HDsprintf(process_group_name, "/process_%d", i);
validate_zoo(file_id, process_group_name, i++);
}
-
+
#if H5C_COLLECT_CACHE_STATS
if ( pass ) {
@@ -5045,7 +5126,7 @@ cache_image_smoke_check_5(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5060,9 +5141,9 @@ cache_image_smoke_check_5(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 19) Delete the file */
@@ -5086,78 +5167,78 @@ cache_image_smoke_check_5(void)
} /* 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 persistant free
- * space managers, size size is about 167 MB, so this
- * is sufficient to verify that the persistant 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
*
@@ -5168,7 +5249,7 @@ cache_image_smoke_check_5(void)
*/
static unsigned
-cache_image_smoke_check_6(void)
+cache_image_smoke_check_6(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_smoke_check_6()";
char filename[512];
@@ -5183,9 +5264,16 @@ cache_image_smoke_check_6(void)
TESTING("metadata cache image smoke check 6");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5200,13 +5288,13 @@ cache_image_smoke_check_6(void)
}
}
- 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.
*/
@@ -5217,8 +5305,8 @@ cache_image_smoke_check_6(void)
/* 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,
@@ -5226,10 +5314,10 @@ cache_image_smoke_check_6(void)
/* 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 ) {
@@ -5248,10 +5336,10 @@ cache_image_smoke_check_6(void)
}
#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 ) {
@@ -5264,26 +5352,26 @@ cache_image_smoke_check_6(void)
}
}
- 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,
@@ -5291,11 +5379,11 @@ cache_image_smoke_check_6(void)
/* 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 ) {
@@ -5314,22 +5402,22 @@ cache_image_smoke_check_6(void)
}
#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 ) {
@@ -5342,27 +5430,27 @@ cache_image_smoke_check_6(void)
}
}
- 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,
@@ -5370,10 +5458,10 @@ cache_image_smoke_check_6(void)
/* 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 ) {
@@ -5393,7 +5481,7 @@ cache_image_smoke_check_6(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5407,22 +5495,22 @@ cache_image_smoke_check_6(void)
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,
@@ -5430,13 +5518,13 @@ cache_image_smoke_check_6(void)
/* 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 ) {
@@ -5455,7 +5543,7 @@ cache_image_smoke_check_6(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
-
+
/* 13) Close the file. */
@@ -5468,18 +5556,18 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
/* 14) Get the size of the file. Verify that it is less
- * than 20 KB. Without deletions and persistant free
+ * than 20 KB. Without deletions and persistent free
* space managers, size size is about 167 MB, so this
- * is sufficient to verify that the persistant free
+ * 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, 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.
*/
@@ -5493,9 +5581,9 @@ cache_image_smoke_check_6(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 15) Delete the file */
if ( pass ) {
@@ -5518,56 +5606,56 @@ cache_image_smoke_check_6(void)
} /* 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
*
@@ -5578,7 +5666,7 @@ cache_image_smoke_check_6(void)
*/
static unsigned
-cache_image_api_error_check_1(void)
+cache_image_api_error_check_1(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_1()";
char filename[512];
@@ -5590,9 +5678,16 @@ cache_image_api_error_check_1(void)
TESTING("metadata cache image api error check 1");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5607,7 +5702,7 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5619,8 +5714,8 @@ cache_image_api_error_check_1(void)
/* 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,
@@ -5628,10 +5723,10 @@ cache_image_api_error_check_1(void)
/* 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 ) {
@@ -5652,10 +5747,10 @@ cache_image_api_error_check_1(void)
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -5668,20 +5763,20 @@ cache_image_api_error_check_1(void)
}
}
- 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,
@@ -5689,10 +5784,10 @@ cache_image_api_error_check_1(void)
/* 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.
@@ -5716,9 +5811,9 @@ cache_image_api_error_check_1(void)
}
#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. */
@@ -5731,20 +5826,20 @@ cache_image_api_error_check_1(void)
}
}
- 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,
@@ -5752,10 +5847,10 @@ cache_image_api_error_check_1(void)
/* 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.
@@ -5780,7 +5875,7 @@ cache_image_api_error_check_1(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5795,20 +5890,20 @@ cache_image_api_error_check_1(void)
}
}
- 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,
@@ -5816,9 +5911,9 @@ cache_image_api_error_check_1(void)
/* 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.
@@ -5842,9 +5937,9 @@ cache_image_api_error_check_1(void)
}
#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. */
@@ -5857,9 +5952,9 @@ cache_image_api_error_check_1(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Delete the file */
@@ -5882,68 +5977,68 @@ cache_image_api_error_check_1(void)
} /* 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
*
@@ -5954,7 +6049,7 @@ cache_image_api_error_check_1(void)
*/
static unsigned
-cache_image_api_error_check_2(void)
+cache_image_api_error_check_2(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_2()";
char filename[512];
@@ -5966,9 +6061,16 @@ cache_image_api_error_check_2(void)
TESTING("metadata cache image api error check 2");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5983,7 +6085,7 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -5995,8 +6097,8 @@ cache_image_api_error_check_2(void)
/* 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,
@@ -6004,10 +6106,10 @@ cache_image_api_error_check_2(void)
/* 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 ) {
@@ -6028,10 +6130,10 @@ cache_image_api_error_check_2(void)
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
-
+
+
/* 3) Close the file. */
if ( pass ) {
@@ -6044,20 +6146,20 @@ cache_image_api_error_check_2(void)
}
}
- 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,
@@ -6065,10 +6167,10 @@ cache_image_api_error_check_2(void)
/* 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.
@@ -6092,9 +6194,9 @@ cache_image_api_error_check_2(void)
}
#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. */
@@ -6107,20 +6209,20 @@ cache_image_api_error_check_2(void)
}
}
- 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,
@@ -6128,10 +6230,10 @@ cache_image_api_error_check_2(void)
/* 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.
@@ -6156,7 +6258,7 @@ cache_image_api_error_check_2(void)
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6171,20 +6273,20 @@ cache_image_api_error_check_2(void)
}
}
- 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,
@@ -6192,9 +6294,9 @@ cache_image_api_error_check_2(void)
/* 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.
@@ -6218,9 +6320,9 @@ cache_image_api_error_check_2(void)
}
#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. */
@@ -6233,7 +6335,7 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6242,11 +6344,11 @@ cache_image_api_error_check_2(void)
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,
@@ -6254,9 +6356,9 @@ cache_image_api_error_check_2(void)
/* 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.
@@ -6280,9 +6382,9 @@ cache_image_api_error_check_2(void)
}
#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. */
@@ -6295,9 +6397,9 @@ cache_image_api_error_check_2(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 13) Delete the file */
@@ -6320,36 +6422,36 @@ cache_image_api_error_check_2(void)
} /* 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.
@@ -6365,7 +6467,7 @@ cache_image_api_error_check_2(void)
*/
static unsigned
-cache_image_api_error_check_3(void)
+cache_image_api_error_check_3(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_3()";
char filename[512];
@@ -6377,9 +6479,16 @@ cache_image_api_error_check_3(void)
TESTING("metadata cache image api error check 3");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6394,7 +6503,7 @@ cache_image_api_error_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6406,8 +6515,8 @@ cache_image_api_error_check_3(void)
/* 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,
@@ -6415,9 +6524,9 @@ cache_image_api_error_check_3(void)
/* 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. */
@@ -6432,9 +6541,9 @@ cache_image_api_error_check_3(void)
} 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 */
@@ -6454,19 +6563,19 @@ cache_image_api_error_check_3(void)
}
}
- 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);
@@ -6474,16 +6583,16 @@ cache_image_api_error_check_3(void)
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 ) {
@@ -6492,8 +6601,8 @@ cache_image_api_error_check_3(void)
/* 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,
@@ -6501,10 +6610,10 @@ cache_image_api_error_check_3(void)
/* 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 ) {
@@ -6523,9 +6632,9 @@ cache_image_api_error_check_3(void)
}
#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. */
@@ -6539,20 +6648,20 @@ cache_image_api_error_check_3(void)
}
}
- 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 ) {
@@ -6564,7 +6673,7 @@ cache_image_api_error_check_3(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6578,67 +6687,67 @@ cache_image_api_error_check_3(void)
} /* 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
*
@@ -6649,7 +6758,7 @@ cache_image_api_error_check_3(void)
*/
static unsigned
-cache_image_api_error_check_4(void)
+cache_image_api_error_check_4(hbool_t single_file_vfd)
{
const char * fcn_name = "cache_image_api_error_check_4()";
char filename[512];
@@ -6663,9 +6772,16 @@ cache_image_api_error_check_4(void)
TESTING("metadata cache image api error check 4");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6680,24 +6796,24 @@ cache_image_api_error_check_4(void)
}
}
- 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 ) {
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ fapl_id = h5_fileaccess();
if ( fapl_id < 0 ) {
pass = FALSE;
- failure_mssg = "H5Pcreate() failed.\n";
+ failure_mssg = "h5_fileaccess() failed.\n";
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -6715,7 +6831,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6732,7 +6848,7 @@ cache_image_api_error_check_4(void)
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6743,7 +6859,7 @@ cache_image_api_error_check_4(void)
}
}
- 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
@@ -6762,10 +6878,10 @@ cache_image_api_error_check_4(void)
}
}
- 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 ) {
@@ -6786,10 +6902,10 @@ cache_image_api_error_check_4(void)
}
#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 ) {
@@ -6802,20 +6918,20 @@ cache_image_api_error_check_4(void)
}
}
- 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,
@@ -6823,11 +6939,11 @@ cache_image_api_error_check_4(void)
/* 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
*/
@@ -6847,9 +6963,9 @@ cache_image_api_error_check_4(void)
}
#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. */
@@ -6862,11 +6978,11 @@ cache_image_api_error_check_4(void)
}
}
- 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.
*/
@@ -6882,7 +6998,7 @@ cache_image_api_error_check_4(void)
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6893,7 +7009,7 @@ cache_image_api_error_check_4(void)
}
}
- 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
@@ -6912,7 +7028,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -6925,7 +7041,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -6940,9 +7056,9 @@ cache_image_api_error_check_4(void)
}
}
- 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.
@@ -6960,7 +7076,7 @@ cache_image_api_error_check_4(void)
} else {
- file_ptr = (struct H5F_t *)H5I_object_verify(file_id, H5I_FILE);
+ file_ptr = (struct H5F_t *)H5VL_object_verify(file_id, H5I_FILE);
if ( file_ptr == NULL ) {
@@ -6971,7 +7087,7 @@ cache_image_api_error_check_4(void)
}
}
- 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
@@ -6990,7 +7106,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) {
@@ -7003,7 +7119,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7028,7 +7144,7 @@ cache_image_api_error_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7039,7 +7155,7 @@ cache_image_api_error_check_4(void)
create_datasets(file_id, 6, 10);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7054,23 +7170,23 @@ cache_image_api_error_check_4(void)
}
}
- 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,
@@ -7078,10 +7194,10 @@ cache_image_api_error_check_4(void)
/* 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.
@@ -7103,7 +7219,7 @@ cache_image_api_error_check_4(void)
}
#endif /* H5C_COLLECT_CACHE_STATS */
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7118,9 +7234,9 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 17) Delete the file */
@@ -7133,7 +7249,7 @@ cache_image_api_error_check_4(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7152,36 +7268,36 @@ cache_image_api_error_check_4(void)
} /* 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 persistant 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 persistant 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.
@@ -7192,12 +7308,12 @@ cache_image_api_error_check_4(void)
* 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
@@ -7211,12 +7327,12 @@ cache_image_api_error_check_4(void)
* 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
@@ -7224,7 +7340,7 @@ cache_image_api_error_check_4(void)
*
* 17) Delete the remaining data sets.
*
- * 18) Close the file.
+ * 18) Close the file.
*
* 19) Verify that file space has been reclaimed.
*
@@ -7238,7 +7354,7 @@ cache_image_api_error_check_4(void)
*-------------------------------------------------------------------------
*/
static unsigned
-get_free_sections_test(void)
+get_free_sections_test(hbool_t single_file_vfd)
{
const char * fcn_name = "get_free_sections_test()";
char filename[512];
@@ -7251,9 +7367,16 @@ get_free_sections_test(void)
TESTING("Cache image / H5Fget_free_sections() interaction");
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7268,12 +7391,12 @@ get_free_sections_test(void)
}
}
- 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 persistant free space managers enabled.
+ * and persistent free space managers enabled.
*/
if ( pass ) {
@@ -7282,8 +7405,8 @@ get_free_sections_test(void)
/* 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,
@@ -7291,11 +7414,11 @@ get_free_sections_test(void)
/* 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.
*/
@@ -7304,7 +7427,7 @@ get_free_sections_test(void)
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 ) {
@@ -7312,7 +7435,7 @@ get_free_sections_test(void)
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 ) {
@@ -7320,10 +7443,10 @@ get_free_sections_test(void)
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 ) {
@@ -7336,10 +7459,10 @@ get_free_sections_test(void)
}
}
- 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 ) {
@@ -7348,8 +7471,8 @@ get_free_sections_test(void)
/* 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,
@@ -7357,10 +7480,10 @@ get_free_sections_test(void)
/* 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 ) {
@@ -7373,24 +7496,23 @@ get_free_sections_test(void)
}
}
- 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 ( ( file_ptr->shared->first_alloc_dealloc ) ||
- ( ! H5F_addr_defined(file_ptr->shared->eoa_pre_fsm_fsalloc) ) ||
+ if ( ( ! H5F_addr_defined(file_ptr->shared->eoa_fsm_fsalloc) ) ||
( ! H5F_addr_defined(file_ptr->shared->cache->image_addr) ) ||
- ( H5F_addr_gt(file_ptr->shared->eoa_pre_fsm_fsalloc,
+ ( H5F_addr_gt(file_ptr->shared->eoa_fsm_fsalloc,
file_ptr->shared->cache->image_addr) ) ) {
pass = FALSE;
@@ -7398,15 +7520,15 @@ get_free_sections_test(void)
}
}
- 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;
@@ -7414,11 +7536,11 @@ get_free_sections_test(void)
}
}
- 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 ) {
@@ -7428,14 +7550,11 @@ get_free_sections_test(void)
pass = FALSE;
failure_mssg = "cache image not loaded (1).\n";
- } else if ( file_ptr->shared->first_alloc_dealloc ) {
-
- pass = FALSE;
- failure_mssg = "self referential FSMs not floated (1).\n";
}
+
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7446,10 +7565,10 @@ get_free_sections_test(void)
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 ) {
@@ -7461,10 +7580,10 @@ get_free_sections_test(void)
}
}
- 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 ) {
@@ -7473,8 +7592,8 @@ get_free_sections_test(void)
/* 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,
@@ -7482,10 +7601,10 @@ get_free_sections_test(void)
/* 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 ) {
@@ -7498,20 +7617,19 @@ get_free_sections_test(void)
}
}
- 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 ) {
- if ( ( ! file_ptr->shared->first_alloc_dealloc ) ||
- ( ! H5F_addr_defined(file_ptr->shared->eoa_pre_fsm_fsalloc) ) ||
+ if ( ( ! H5F_addr_defined(file_ptr->shared->eoa_fsm_fsalloc) ) ||
( ! H5F_addr_defined(file_ptr->shared->cache->image_addr) ) ||
- ( H5F_addr_gt(file_ptr->shared->eoa_pre_fsm_fsalloc,
+ ( H5F_addr_gt(file_ptr->shared->eoa_fsm_fsalloc,
file_ptr->shared->cache->image_addr) ) ) {
pass = FALSE;
@@ -7519,15 +7637,15 @@ get_free_sections_test(void)
}
}
- 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;
@@ -7535,11 +7653,11 @@ get_free_sections_test(void)
}
}
- 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 ) {
@@ -7549,14 +7667,11 @@ get_free_sections_test(void)
pass = FALSE;
failure_mssg = "cache image not loaded (2).\n";
- } else if ( file_ptr->shared->first_alloc_dealloc ) {
-
- pass = FALSE;
- failure_mssg = "self referential FSMs not floated (2).\n";
}
+
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7567,10 +7682,10 @@ get_free_sections_test(void)
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 ) {
@@ -7578,10 +7693,10 @@ get_free_sections_test(void)
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 ) {
@@ -7593,7 +7708,7 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7613,10 +7728,10 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
-
+
/* 20) Discard the file. */
if ( pass ) {
@@ -7628,7 +7743,7 @@ get_free_sections_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
@@ -7641,40 +7756,40 @@ get_free_sections_test(void)
} /* 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 persistant 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 persistant 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.
*
@@ -7710,7 +7825,7 @@ get_free_sections_test(void)
*-------------------------------------------------------------------------
*/
static unsigned
-evict_on_close_test(void)
+evict_on_close_test(hbool_t single_file_vfd)
{
#ifndef H5_HAVE_PARALLEL
const char * fcn_name = "evict_on_close_test()";
@@ -7731,9 +7846,16 @@ evict_on_close_test(void)
return 0;
#else
+ /* Check for VFD that is a single file */
+ if(!single_file_vfd) {
+ SKIPPED();
+ HDputs(" Cache image not supported with the current VFD.");
+ return 0;
+ }
+
pass = TRUE;
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7748,12 +7870,12 @@ evict_on_close_test(void)
}
}
- 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 persistant free space managers enabled.
+ * and persistent free space managers enabled.
*/
if ( pass ) {
@@ -7761,8 +7883,8 @@ evict_on_close_test(void)
/* 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,
@@ -7770,7 +7892,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7781,7 +7903,7 @@ evict_on_close_test(void)
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 ) {
@@ -7789,10 +7911,10 @@ evict_on_close_test(void)
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 ) {
@@ -7805,10 +7927,10 @@ evict_on_close_test(void)
}
}
- 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 ) {
@@ -7817,8 +7939,8 @@ evict_on_close_test(void)
/* 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,
@@ -7826,7 +7948,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7840,10 +7962,10 @@ evict_on_close_test(void)
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 ) {
@@ -7851,7 +7973,7 @@ evict_on_close_test(void)
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 ) {
@@ -7864,15 +7986,15 @@ evict_on_close_test(void)
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 ) {
@@ -7884,10 +8006,10 @@ evict_on_close_test(void)
}
}
- 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 ) {
@@ -7896,8 +8018,8 @@ evict_on_close_test(void)
/* 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,
@@ -7905,7 +8027,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7916,7 +8038,7 @@ evict_on_close_test(void)
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 ) {
@@ -7924,7 +8046,7 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7939,10 +8061,10 @@ evict_on_close_test(void)
}
}
- 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 ) {
@@ -7951,8 +8073,8 @@ evict_on_close_test(void)
/* 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,
@@ -7960,7 +8082,7 @@ evict_on_close_test(void)
/* cache_ptr_ptr */ &cache_ptr);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7971,7 +8093,7 @@ evict_on_close_test(void)
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 ) {
@@ -7979,7 +8101,7 @@ evict_on_close_test(void)
verify_datasets(file_id, 1, 20);
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -7994,7 +8116,7 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
@@ -8009,7 +8131,7 @@ evict_on_close_test(void)
}
}
- if ( show_progress )
+ if ( show_progress )
HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass);
if ( pass ) { PASSED(); } else { H5_FAILED(); }
@@ -8023,7 +8145,7 @@ evict_on_close_test(void)
} /* evict_on_close_test() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -8041,39 +8163,49 @@ evict_on_close_test(void)
int
main(void)
{
+ const char *env_h5_drvr; /* File driver value from environment */
+ hbool_t single_file_vfd; /* Whether VFD used stores data in a single file */
unsigned nerrs = 0;
int express_test;
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if(env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
H5open();
express_test = GetTestExpress();
- printf("=========================================\n");
- printf("Cache image tests\n");
- printf(" express_test = %d\n", express_test);
- printf("=========================================\n");
-
- nerrs += check_cache_image_ctl_flow_1();
- nerrs += check_cache_image_ctl_flow_2();
- nerrs += check_cache_image_ctl_flow_3();
- nerrs += check_cache_image_ctl_flow_4();
- nerrs += check_cache_image_ctl_flow_5();
- nerrs += check_cache_image_ctl_flow_6();
-
- nerrs += cache_image_smoke_check_1();
- nerrs += cache_image_smoke_check_2();
- nerrs += cache_image_smoke_check_3();
- nerrs += cache_image_smoke_check_4();
- nerrs += cache_image_smoke_check_5();
- nerrs += cache_image_smoke_check_6();
-
- nerrs += cache_image_api_error_check_1();
- nerrs += cache_image_api_error_check_2();
- nerrs += cache_image_api_error_check_3();
- nerrs += cache_image_api_error_check_4();
-
- nerrs += get_free_sections_test();
- nerrs += evict_on_close_test();
+ 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"));
+
+ nerrs += check_cache_image_ctl_flow_1(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_2(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_3(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_4(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_5(single_file_vfd);
+ nerrs += check_cache_image_ctl_flow_6(single_file_vfd);
+
+ nerrs += cache_image_smoke_check_1(single_file_vfd);
+ nerrs += cache_image_smoke_check_2(single_file_vfd);
+ nerrs += cache_image_smoke_check_3(single_file_vfd);
+ nerrs += cache_image_smoke_check_4(single_file_vfd);
+ nerrs += cache_image_smoke_check_5(single_file_vfd);
+ nerrs += cache_image_smoke_check_6(single_file_vfd);
+
+ nerrs += cache_image_api_error_check_1(single_file_vfd);
+ nerrs += cache_image_api_error_check_2(single_file_vfd);
+ nerrs += cache_image_api_error_check_3(single_file_vfd);
+ nerrs += cache_image_api_error_check_4(single_file_vfd);
+
+ nerrs += get_free_sections_test(single_file_vfd);
+ nerrs += evict_on_close_test(single_file_vfd);
return(nerrs > 0);
diff --git a/test/cache_logging.c b/test/cache_logging.c
index b4ed53b..c43609b 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -40,10 +40,10 @@ test_logging_api(void)
char *location = NULL;
size_t size;
- hid_t fid;
- hid_t gid;
+ hid_t fid = -1;
+ hid_t gid = -1;
hbool_t is_currently_logging;
- char group_name[8];
+ char group_name[12];
char filename[1024];
int i;
@@ -65,16 +65,16 @@ test_logging_api(void)
start_on_access_out = TRUE;
location = NULL;
size = 999;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
- if(size != strlen(LOG_LOCATION) + 1)
+ if(size != HDstrlen(LOG_LOCATION) + 1)
TEST_ERROR;
/* Check to make sure that the property list getter works */
if(NULL == (location = (char *)HDcalloc(size, sizeof(char))))
TEST_ERROR;
- if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
+ if(H5Pget_mdc_log_options(fapl, &is_enabled_out, location, &size,
&start_on_access_out) < 0)
TEST_ERROR;
if((is_enabled != is_enabled_out)
@@ -111,8 +111,8 @@ test_logging_api(void)
/* Perform some manipulations */
for(i = 0; i < N_GROUPS; i++) {
- HDmemset(group_name, 0, 8);
- HDsnprintf(group_name, 8, "%d", i);
+ HDmemset(group_name, 0, sizeof(group_name));
+ HDsnprintf(group_name, sizeof(group_name), "%d", i);
if((gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if(H5Gclose(gid) < 0)
@@ -159,17 +159,18 @@ main(void)
/* Reset library */
h5_reset();
- printf("Testing basic metadata cache logging functionality.\n");
+ HDprintf("Testing basic metadata cache logging functionality.\n");
nerrors += test_logging_api();
if(nerrors) {
- printf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
+ HDprintf("***** %d Metadata cache logging TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
- return 1;
+ HDexit(EXIT_FAILURE);
}
- printf("All Metadata Cache Logging tests passed.\n");
- return 0;
+ HDprintf("All Metadata Cache Logging tests passed.\n");
+
+ HDexit(EXIT_SUCCESS);
}
diff --git a/test/cache_tagging.c b/test/cache_tagging.c
index 99ab49c..cf0cd8d 100644
--- a/test/cache_tagging.c
+++ b/test/cache_tagging.c
@@ -15,14 +15,16 @@
*
* 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"
#include "testhdf5.h"
#include "cache_common.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5HLprivate.h"
+#include "H5VLnative_private.h" /* Native VOL connector */
/* ============ */
/* Test Defines */
@@ -46,7 +48,7 @@
#define TEST_DEFAULT 0
#define TEST_SHMESG 1
#define NUM_TEST_TYPES 2
-
+
/* ===================== */
/* Function Declarations */
/* ===================== */
@@ -97,7 +99,7 @@ static unsigned check_invalid_tag_application(void);
#ifndef NDEBUG
-
+
/*-------------------------------------------------------------------------
* Function: dump_cache()
*
@@ -118,7 +120,7 @@ static int dump_cache(hid_t fid)
H5F_t *f; /* File Pointer */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
/* Dump the cache */
@@ -126,19 +128,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.
*
@@ -158,7 +160,7 @@ verify_no_unknown_tags(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -180,7 +182,7 @@ error:
return -1;
} /* verify_no_unknown_tags */
-
+
/*-------------------------------------------------------------------------
* Function: mark_all_entries_investigated()
*
@@ -206,7 +208,7 @@ mark_all_entries_investigated(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -228,7 +230,7 @@ error:
return -1;
} /* mark_all_entries_investigated */
-
+
/*-------------------------------------------------------------------------
* Function: reset_all_entries_investigated()
*
@@ -252,7 +254,7 @@ reset_all_entries_investigated(hid_t fid)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -274,15 +276,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
@@ -300,7 +302,7 @@ verify_tag(hid_t fid, int id, haddr_t tag)
int i; /* Iterator */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
cache_ptr = f->shared->cache;
@@ -326,7 +328,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;
@@ -340,7 +342,7 @@ evict_entries(hid_t fid)
H5F_t *f; /* File Pointer */
/* Get Internal File / Cache Pointers */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR;
/* Mark all entries investigated */
@@ -349,7 +351,7 @@ evict_entries(hid_t fid)
/* Evict all we can from the cache to examine full tag creation tree */
/* This function will likely return failure since the root group
* is still protected. Thus, don't check its return value. */
- H5C_flush_cache(f, H5P_DEFAULT, H5C__FLUSH_INVALIDATE_FLAG);
+ H5C_flush_cache(f, H5C__FLUSH_INVALIDATE_FLAG);
return 0;
@@ -357,7 +359,7 @@ error:
return -1;
} /* evict entries */
-
+
/*-------------------------------------------------------------------------
* Function: get_object_header_tag()
*
@@ -373,14 +375,15 @@ error:
static int
get_object_header_tag(hid_t loc_id, haddr_t *tag)
{
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
/* Retrieve the info for the object */
- if(H5Oget_info(loc_id, &oinfo) < 0)
+ if(H5Oget_info3(loc_id, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR;
/* Set the tag to return */
- *tag = oinfo.addr;
+ if(H5VLnative_token_to_addr(loc_id, oinfo.token, tag) < 0)
+ TEST_ERROR;
return 0;
@@ -388,12 +391,12 @@ error:
return -1;
} /* get_object_header_tag */
-
+
/*-------------------------------------------------------------------------
* Function: get_sbe_tag()
*
* Purpose: This function retrieves the tag associated with the superblock
- * extension (the object header address stored in the superblock)
+ * extension (the object header address stored in the superblock)
*
* Return: 0 on Success; 1 on Failure
*
@@ -406,7 +409,7 @@ static int
get_sbe_tag(hid_t fid, haddr_t *tag)
{
/* Retrieve the superblock extension's object header address for the file */
- if(H5F_get_sbe_addr_test(fid, tag) < 0)
+ if(H5F__get_sbe_addr_test(fid, tag) < 0)
TEST_ERROR;
return 0;
@@ -419,7 +422,7 @@ error:
/* Test Functions */
/* ============== */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_creation_tags
*
@@ -433,20 +436,28 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_file_creation_tags(hid_t fcpl_id, int type)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose test outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t sbe_tag = 0;
/* Testing Macro */
TESTING("tag application during file creation");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
#ifndef NDEBUG
/* if verbose, print cache index to screen before verification . */
@@ -500,7 +511,7 @@ error:
return 1;
} /* check_file_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_file_open_tags
*
@@ -514,12 +525,15 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_file_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag; /* Root Group Tag */
haddr_t sbe_tag; /* Sblock Extension Tag */
@@ -530,20 +544,25 @@ check_file_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* 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;
@@ -606,7 +625,7 @@ error:
return 1;
} /* check_file_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_group_creation_tags
*
@@ -620,25 +639,33 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_group_creation_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF; /* Root Group Tag */
haddr_t g_tag; /* Group Tag */
/* Testing Macro */
TESTING("tag application during group creation");
-
+
/* ===== */
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -664,7 +691,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;
@@ -701,7 +728,7 @@ error:
return 1;
} /* check_group_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_multi_group_creation_tags
*
@@ -715,14 +742,16 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_multi_group_creation_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
- char gname[10]; /* group name buffer */
+#endif /* NDEBUG */ /* end debugging functions */
+ char gname[16]; /* group name buffer */
int i = 0; /* iterator */
hid_t fapl = -1; /* File access prop list */
haddr_t g_tag = 0; /* Group tag value */
@@ -732,7 +761,7 @@ check_multi_group_creation_tags(void)
TESTING("tag application during multiple group creation");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
/* Set latest version of library */
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
@@ -755,7 +784,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;
@@ -774,7 +803,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 */
@@ -815,6 +844,7 @@ check_multi_group_creation_tags(void)
/* Close open objects and file */
/* =========================== */
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -828,7 +858,7 @@ error:
return 1;
} /* check_multi_group_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_iteration_tags
*
@@ -842,27 +872,35 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_iteration_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t sid = -1; /* Group Identifier */
hid_t did = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
int i = 0; /* iterator */
haddr_t root_tag = 0; /* Root Group Tag Value */
char dsetname[500]; /* Name of dataset */
H5G_info_t ginfo; /* Group Info Struct */
+ hid_t fapl = -1; /* File access prop list */
hid_t root_group = -1; /* Root Group Identifier */
/* Testing Macro */
TESTING("tag application during iteration over links in a group");
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* =========== */
/* Create File */
/* =========== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Get root group tag */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -873,7 +911,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;
}
@@ -940,7 +978,7 @@ error:
return 1;
} /* check_link_iteration_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dense_attribute_tags
*
@@ -954,7 +992,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dense_attribute_tags(void)
{
/* Variable Declarations */
@@ -963,18 +1001,20 @@ check_dense_attribute_tags(void)
hid_t sid = -1; /* Group Identifier */
hid_t did = -1; /* Group Identifier */
hid_t dcpl = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
int i = 0; /* iterator */
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");
/* Create Fapl */
- if ( (fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0 ) TEST_ERROR;
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR;
/* Create Dcpl */
@@ -985,6 +1025,8 @@ check_dense_attribute_tags(void)
/* =========== */
if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
+
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -994,10 +1036,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);
@@ -1007,7 +1049,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;
@@ -1123,7 +1165,7 @@ error:
return 1;
} /* check_dense_attribute_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_group_open_tags
*
@@ -1137,25 +1179,33 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_group_open_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file output */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
/* Testing Macro */
TESTING("tag application during group open");
-
+
/* ===== */
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1224,7 +1274,7 @@ error:
return 1;
} /* check_group_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_creation_tags
*
@@ -1238,7 +1288,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1246,7 +1296,10 @@ check_attribute_creation_tags(hid_t fcpl, int type)
hid_t aid = -1; /* Attribute Identifier */
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0; /* Root group tag */
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1259,8 +1312,11 @@ check_attribute_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1311,7 +1367,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;
@@ -1330,7 +1386,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;
@@ -1340,6 +1396,7 @@ check_attribute_creation_tags(hid_t fcpl, int type)
if ( H5Aclose(aid) < 0 ) TEST_ERROR;
if ( H5Gclose(gid) < 0 ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
/* ========================================== */
@@ -1353,7 +1410,7 @@ error:
return 1;
} /* check_attribute_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_open_tags
*
@@ -1367,7 +1424,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_open_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1375,7 +1432,10 @@ check_attribute_open_tags(hid_t fcpl, int type)
hid_t aid = -1; /* Attribute Identifier */
hid_t gid = -1; /* Group Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1388,8 +1448,13 @@ check_attribute_open_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1438,7 +1503,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 */
@@ -1484,7 +1549,7 @@ error:
return 1;
} /* check_attribute_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_rename_tags
*
@@ -1498,7 +1563,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_rename_tags(hid_t fcpl, int type)
{
/* Variable declarations */
@@ -1506,14 +1571,17 @@ check_attribute_rename_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t aid = -1; /* Attribute Identifier */
hid_t sid = -1; /* Dataset Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* dimensions */
- hbool_t persistant_fsms = FALSE;
+ hbool_t persistent_fsms = FALSE;
/* Testing Macro */
TESTING("tag application during attribute renaming");
@@ -1522,15 +1590,20 @@ check_attribute_rename_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- /* check to see if the FCPL specified persistant free space managers */
- if(H5Pget_file_space_strategy(fcpl, NULL, &persistant_fsms, NULL) < 0)
+ /* check to see if the FCPL specified persistent free space managers */
+ if(H5Pget_file_space_strategy(fcpl, NULL, &persistent_fsms, NULL) < 0)
TEST_ERROR;
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1546,7 +1619,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++)
@@ -1612,22 +1685,12 @@ 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;
- /*
- * 3 calls to verify_tag() for verifying free space:
- * one freespace header tag for H5FD_MEM_DRAW manager,
- * one freespace header tag for H5FD_MEM_SUPER manager
- * one freespace section info 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 the free space managers are persistant, 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
- * cache.
- */
- if(!persistant_fsms && verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0) TEST_ERROR;
- if(!persistant_fsms && 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 ) TEST_ERROR;
/* verify btree header and leaf node belonging to group */
if ( verify_tag(fid, H5AC_BT2_HDR_ID, g_tag) < 0 ) TEST_ERROR;
@@ -1663,7 +1726,7 @@ error:
return 1;
} /* check_attribute_rename_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_delete_tags
*
@@ -1677,7 +1740,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_delete_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -1685,14 +1748,17 @@ check_attribute_delete_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t aid = -1; /* Attribute Identifier */
hid_t sid = -1; /* Dataset Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* dimensions */
- hbool_t persistant_fsms = FALSE;
+ hbool_t persistent_fsms = FALSE;
/* Testing Macro */
TESTING("tag application during attribute delete");
@@ -1701,15 +1767,20 @@ check_attribute_delete_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- /* check to see if the FCPL specified persistant free space managers */
- if ( H5Pget_file_space_strategy(fcpl, NULL, &persistant_fsms, NULL) < 0 )
+ /* check to see if the FCPL specified persistent free space managers */
+ if ( H5Pget_file_space_strategy(fcpl, NULL, &persistent_fsms, NULL) < 0 )
TEST_ERROR;
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1725,7 +1796,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++)
@@ -1763,30 +1834,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:
- * one freespace header tag for free-space header,
- * one freespace header tag for free-space section info
+ /*
+ * 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 )
TEST_ERROR;
- if ( verify_tag(fid, H5AC_FSPACE_SINFO_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 persistant, 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 ( ( ! persistant_fsms ) &&
+ if ( ( ! persistent_fsms ) &&
( verify_tag(fid, H5AC_FSPACE_HDR_ID, H5AC__FREESPACE_TAG) < 0 ) )
TEST_ERROR;
#endif
@@ -1821,7 +1895,7 @@ error:
return 1;
} /* check_attribute_delete_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_tags
*
@@ -1835,17 +1909,20 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_creation_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1858,7 +1935,12 @@ check_dataset_creation_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -1873,10 +1955,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;
@@ -1918,7 +2000,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;
@@ -1948,7 +2030,7 @@ error:
return 1;
} /* check_dataset_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_creation_earlyalloc_tags
*
@@ -1962,17 +2044,20 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -1986,7 +2071,12 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type)
/* Setup */
/* ===== */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2045,7 +2135,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;
@@ -2079,7 +2169,7 @@ error:
return 1;
} /* check_dataset_creation_earlyalloc_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_open_tags
*
@@ -2093,17 +2183,20 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_open_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2116,15 +2209,20 @@ check_dataset_open_tags(void)
/* Open File */
/* ========= */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2154,7 +2252,7 @@ check_dataset_open_tags(void)
/* ========================== */
/* Open Dataset in Root Group */
/* ========================== */
-
+
if (( did = H5Dopen2(fid, DATASETNAME, H5P_DEFAULT)) < 0 ) TEST_ERROR;
/* =================================== */
@@ -2199,7 +2297,7 @@ error:
return 1;
} /* check_dataset_open_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_write_tags
*
@@ -2213,17 +2311,20 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_write_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2241,15 +2342,20 @@ check_dataset_write_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2298,7 +2404,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;
@@ -2334,7 +2440,7 @@ error:
return 1;
} /* check_dataset_write_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_attribute_write_tags
*
@@ -2348,7 +2454,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_attribute_write_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -2356,9 +2462,12 @@ check_attribute_write_tags(hid_t fcpl, int type)
hid_t gid = -1; /* Group Identifier */
hid_t aid = -1; /* Attribute Identifier */
hid_t sid = -1; /* Dataset Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
int *data = NULL; /* data buffer */
int i,j,k = 0; /* iterators */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t g_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2374,8 +2483,13 @@ check_attribute_write_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file with provided fcpl_t */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2423,7 +2537,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;
@@ -2482,7 +2596,7 @@ error:
return 1;
} /* check_attribute_write_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_read_tags
*
@@ -2496,17 +2610,20 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_read_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2524,15 +2641,20 @@ check_dataset_read_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2580,7 +2702,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;
@@ -2613,7 +2735,7 @@ error:
return 1;
} /* check_dataset_read_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_size_retrieval
*
@@ -2627,17 +2749,20 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_size_retrieval(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2656,15 +2781,20 @@ check_dataset_size_retrieval(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2745,7 +2875,7 @@ error:
return 1;
} /* check_dataset_size_retrieval */
-
+
/*-------------------------------------------------------------------------
* Function: check_dataset_extend_tags
*
@@ -2759,7 +2889,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_dataset_extend_tags(void)
{
@@ -2767,10 +2897,13 @@ check_dataset_extend_tags(void)
hid_t fid = -1; /* File Identifier */
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
hsize_t dims1[2] = {DIMS, DIMS}; /* dimensions */
@@ -2789,15 +2922,20 @@ check_dataset_extend_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Set up creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
-
+
/* Enable chunking */
if ( H5Pset_chunk(dcpl, RANK, cdims) < 0 ) TEST_ERROR;
@@ -2878,7 +3016,7 @@ error:
return 1;
} /* check_dataset_extend_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_object_info_tags
*
@@ -2892,16 +3030,19 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_object_info_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file output */
+#endif /* NDEBUG */ /* end debugging functions */
+ 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_native_info_t ninfo; /* Native object info struct */
/* Testing Macro */
TESTING("tag application during object info retrieval");
@@ -2910,8 +3051,13 @@ check_object_info_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -2936,7 +3082,10 @@ check_object_info_tags(void)
/* Get information on an object by name */
/* ===================================== */
- if ( H5Oget_info_by_name(fid, GROUPNAME, &oinfo, H5P_DEFAULT) < 0 ) TEST_ERROR;
+ /* Even though we do nothing with this, touching the internal
+ * data structures is needed for the test to pass.
+ */
+ if ( H5Oget_native_info_by_name(fid, GROUPNAME, &ninfo, H5O_NATIVE_INFO_ALL, H5P_DEFAULT) < 0 ) TEST_ERROR;
/* =================================== */
/* Verification of Metadata Tag Values */
@@ -2981,7 +3130,7 @@ error:
return 1;
} /* check_object_info_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_object_copy_tags
*
@@ -2995,13 +3144,16 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_object_copy_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t gid = -1; /* Group Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file output */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = HADDR_UNDEF;
haddr_t g_tag;
haddr_t copy_tag;
@@ -3013,8 +3165,13 @@ check_object_copy_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3045,7 +3202,7 @@ check_object_copy_tags(void)
if ( (gid = H5Gopen2(fid, GROUPNAMECOPY, H5P_DEFAULT)) < 0 ) TEST_ERROR;
if ( get_object_header_tag(gid, &copy_tag) < 0 ) TEST_ERROR;
if (H5Gclose(gid) < 0) TEST_ERROR;
-
+
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -3094,7 +3251,7 @@ error:
return 1;
} /* check_object_copy_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_removal_tags
*
@@ -3108,7 +3265,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_removal_tags(hid_t fcpl, int type)
{
/* Variable Declarations */
@@ -3116,10 +3273,13 @@ check_link_removal_tags(hid_t fcpl, int type)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
hid_t gid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3138,8 +3298,13 @@ check_link_removal_tags(hid_t fcpl, int type)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3155,7 +3320,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;
@@ -3218,7 +3383,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;
@@ -3246,7 +3411,7 @@ error:
return 1;
} /* check_link_removal_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_link_getname_tags
*
@@ -3260,7 +3425,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_link_getname_tags(void)
{
/* Variable Declarations */
@@ -3269,10 +3434,13 @@ check_link_getname_tags(void)
hid_t did = -1; /* Dataset Identifier */
hid_t sid = -1; /* Dataspace Identifier */
hid_t gid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
hid_t dcpl = -1; /* dataset creation pl */
hsize_t cdims[2] = {1,1}; /* chunk dimensions */
int fillval = 0;
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t d_tag = 0;
haddr_t g_tag = 0;
@@ -3291,8 +3459,13 @@ check_link_getname_tags(void)
/* Allocate array */
if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR;
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
@@ -3308,7 +3481,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;
@@ -3391,7 +3564,7 @@ error:
return 1;
} /* check_link_getname_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_external_link_creation_tags
*
@@ -3405,14 +3578,17 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_external_link_creation_tags(void)
{
/* Variable Declarations */
hid_t fid = -1; /* File Identifier */
hid_t fid2 = -1; /* File Identifier */
hid_t gid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
/* Testing Macro */
@@ -3422,21 +3598,26 @@ check_external_link_creation_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Close and Reopen the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
- if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR;
/* Evict as much as we can from the cache so we can track full tag path */
if ( evict_entries(fid) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Create group in second file */
if ( (gid = H5Gcreate2(fid2, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
@@ -3448,7 +3629,7 @@ check_external_link_creation_tags(void)
/* ==================== */
/* Create External Link */
/* ==================== */
-
+
if (H5Lcreate_external(FILENAME2, GROUPNAMEPATH, fid, LINKNAME, H5P_DEFAULT, H5P_DEFAULT) < 0 ) TEST_ERROR;
/* =================================== */
@@ -3459,7 +3640,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;
@@ -3489,7 +3670,7 @@ error:
return 1;
} /* check_external_link_creation_tags */
-
+
/*-------------------------------------------------------------------------
* Function: check_external_link_open_tags
*
@@ -3503,7 +3684,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static unsigned
check_external_link_open_tags(void)
{
/* Variable Declarations */
@@ -3512,7 +3693,11 @@ check_external_link_open_tags(void)
hid_t fid2 = -1; /* File Identifier */
hid_t gid = -1; /* Dataspace Identifier */
hid_t xid = -1; /* Dataspace Identifier */
+#ifndef NDEBUG
int verbose = FALSE; /* verbose file outout */
+#endif /* NDEBUG */ /* end debugging functions */
+ H5O_native_info_t ninfo; /* Native object info struct */
+ hid_t fapl = -1; /* File access prop list */
haddr_t root_tag = 0;
haddr_t root2_tag = 0;
@@ -3523,14 +3708,17 @@ check_external_link_open_tags(void)
/* Setup */
/* ===== */
+ /* Create Fapl */
+ if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid, &root_tag) < 0 ) TEST_ERROR;
/* Create a second file */
- if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
/* determine tag value of root group's object header */
if ( get_object_header_tag(fid2, &root2_tag) < 0 ) TEST_ERROR;
@@ -3547,7 +3735,9 @@ check_external_link_open_tags(void)
/* Close and Reopen the file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
- if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR;
+
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
/* Evict as much as we can from the cache so we can track full tag path */
if ( evict_entries(fid) < 0 ) TEST_ERROR;
@@ -3555,11 +3745,16 @@ 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;
-
+
+ /* Even though we do nothing with this, touching the internal
+ * data structures is needed for the test to pass.
+ */
+ if ( H5Oget_native_info(xid, &ninfo, H5O_NATIVE_INFO_ALL) < 0 ) TEST_ERROR;
+
/* =================================== */
/* Verification of Metadata Tag Values */
/* =================================== */
@@ -3598,7 +3793,7 @@ check_external_link_open_tags(void)
/* =========================== */
/* Close open objects and file */
/* =========================== */
- if ( (H5Gclose(xid)) < 0 ) TEST_ERROR;
+ if ( H5Gclose(xid) < 0 ) TEST_ERROR;
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
if ( H5Fclose(fid2) < 0 ) TEST_ERROR;
@@ -3613,12 +3808,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
@@ -3631,51 +3826,65 @@ error:
static unsigned
check_invalid_tag_application(void)
{
+#if H5C_DO_TAGGING_SANITY_CHECKS
/* Variables */
H5F_t * f = NULL;
- hid_t fid, dxpl_id = -1;
+ hid_t fid = -1;
haddr_t addr;
H5HL_t * lheap = NULL;
+ hid_t fapl = -1; /* File access prop list */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
/* 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;
+
/* Create a test file */
- if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0 ) TEST_ERROR;
+ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR;
- /* Get internal file pointer*/
- if ( NULL == (f = (H5F_t *)H5I_object(fid)) ) TEST_ERROR;
+ if ( H5Pclose(fapl) < 0 ) TEST_ERROR;
+
+ /* Push API context */
+ if(H5CX_push() < 0) TEST_ERROR
+ api_ctx_pushed = TRUE;
- /* Create dxpl */
- if ( (dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+ /* Get internal file pointer*/
+ if ( NULL == (f = (H5F_t *)H5VL_object(fid)) ) TEST_ERROR;
/* Call H5HL_create, an internal function that calls H5AC_insert_entry without setting up a tag */
/* Ensure this returns FAILURE, as a tag has not been set up. */
- if ( H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)1024, &addr) >= 0) TEST_ERROR;
+ if ( H5HL_create(f, (size_t)1024, &addr) >= 0) TEST_ERROR;
- /* Now set up a tag in the dxpl */
- if ( H5AC_tag(H5AC_ind_read_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR;
+ /* Now set up a tag in the API context */
+ H5AC_tag((haddr_t)25, NULL);
/* Verify the same call to H5HL_create now works as intended, with a tag set up. */
- if ( H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)1024, &addr) < 0) TEST_ERROR;
+ if ( H5HL_create(f, (size_t)1024, &addr) < 0) TEST_ERROR;
- /* Reset dxpl to use invalid tag. */
- if ( H5AC_tag(H5AC_ind_read_dxpl_id, H5AC__INVALID_TAG, NULL) < 0) TEST_ERROR;
+ /* Reset API context to use invalid tag. */
+ H5AC_tag(H5AC__INVALID_TAG, NULL);
/* Call H5HL_protect to protect the local heap created above. */
/* This should fail as no tag is set up during the protect call */
- if (( lheap = H5HL_protect(f, H5AC_ind_read_dxpl_id, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR;
+ if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) != NULL ) TEST_ERROR;
- /* Again, set up a valid tag in the DXPL */
- if ( H5AC_tag(H5AC_ind_read_dxpl_id, (haddr_t)25, NULL) < 0) TEST_ERROR;
+ /* Again, set up a valid tag in the API context */
+ H5AC_tag((haddr_t)25, NULL);
/* Call H5HL_protect again to protect the local heap. This should succeed. */
- if (( lheap = H5HL_protect(f, H5AC_ind_read_dxpl_id, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR;
+ if (( lheap = H5HL_protect(f, addr, H5AC__NO_FLAGS_SET)) == NULL ) TEST_ERROR;
/* Now unprotect the heap, as we're done with the test. */
if ( H5HL_unprotect(lheap) < 0 ) TEST_ERROR;
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) TEST_ERROR
+ api_ctx_pushed = FALSE;
+
/* Close open objects and file */
if ( H5Fclose(fid) < 0 ) TEST_ERROR;
@@ -3683,32 +3892,35 @@ check_invalid_tag_application(void)
PASSED();
#else
SKIPPED();
- printf(" test skipped because sanity checking on tag value is disabled.\n");
-#endif
+ HDprintf(" test skipped because sanity checking on tag value is disabled.\n");
+#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
return 0;
+#if H5C_DO_TAGGING_SANITY_CHECKS
error:
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
+#endif /* H5C_DO_TAGGING_SANITY_CHECKS */
+
} /* check_invalid_tag_application */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
* Purpose: Run tests on library's ability to tag metadata entries.
*
- * Return: Success:
- *
- * Failure:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Mike McGreevy
* January 15, 2009
*
*-------------------------------------------------------------------------
*/
-int
-main(void)
+int
+main(void)
{
/* Variable Declarations */
hid_t fcpl_default = -1; /* file creation prop list */
@@ -3716,13 +3928,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);
@@ -3738,16 +3950,16 @@ 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) printf("Testing standard tag application cases w/ default fcpl:\n");
+ if (!nerrs) HDprintf("Testing standard tag application cases w/ default fcpl:\n");
fcpl = fcpl_default;
-
+
} else if (test_type == TEST_SHMESG) {
- if (!nerrs) printf("Testing standard tag application cases w/ shared messages:\n");
+ if (!nerrs) HDprintf("Testing standard tag application cases w/ shared messages:\n");
fcpl = fcpl_shmesg_all;
} else {
@@ -3767,7 +3979,7 @@ main(void)
if (!nerrs) nerrs += check_link_removal_tags(fcpl, test_type);
} /* end for */
- if (!nerrs) printf("Testing other specific tag application cases:\n");
+ if (!nerrs) HDprintf("Testing other specific tag application cases:\n");
if (!nerrs) nerrs += check_group_creation_tags();
if (!nerrs) nerrs += check_multi_group_creation_tags();
if (!nerrs) nerrs += check_group_open_tags();
@@ -3781,7 +3993,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();
@@ -3791,10 +4003,13 @@ main(void)
HDremove(FILENAME2);
/* Return Errors */
- return(nerrs > 0);
+ if (nerrs > 0)
+ return EXIT_FAILURE;
+ else
+ return EXIT_SUCCESS;
error:
/* Return with Error */
- return(1);
+ return EXIT_FAILURE;
} /* main */
diff --git a/test/chunk_info.c b/test/chunk_info.c
index 1f19963..0afff66 100644
--- a/test/chunk_info.c
+++ b/test/chunk_info.c
@@ -10,142 +10,1983 @@
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
/*
- * Programmer: Pedro Vicente <pvn@hdfgroup.edu>
- * April 7, 2008
*
- * Purpose: Tests the H5Dget_chunk_info API function
- * This program writes a 4x4 dataset by iterating on 2x2 chunks
- * at a time
+ * 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"
+#ifdef H5_HAVE_FILTER_DEFLATE
+#include "zlib.h"
+#endif
+
+/* Test file names, using H5F_libver_t as indices */
+const char *FILENAME[] = {
+ "tchunk_info_earliest",
+ "tchunk_info_v18",
+ "tchunk_info_v110",
+ "tchunk_info_v112",
+ "tchunk_info_v114",
+ 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))
-#include "hdf5.h"
-#include "h5test.h"
+/* Size of a chunk */
+#define CHK_SIZE (CHUNK_NX*CHUNK_NY*sizeof(int))
-#define PRINT_DATA
-#define H5FILE_NAME "chunk_info.h5"
-#define DATASETNAME "2d"
-#define RANK 2
+/* 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))
-int main( void )
+/* 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.0)
+
+/* 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;
+}
- hid_t fid; /* file ID */
- hid_t did; /* dataset ID */
- hid_t f_sid; /* file space ID */
- hid_t m_sid; /* memory space ID */
- hid_t pid; /* property list ID */
- hsize_t start[2]; /* chunk location to start writing */
- hsize_t dims[2] = { 4, 4};
- hsize_t chunk_dims[2] = { 2, 2 };
- int chunk_data[2][2] = { {1, 1}, {1, 1} };
- int buf[4][4];
- int fillvalue = 0;
- int i, j, ii, jj;
+/*-------------------------------------------------------------------------
+ * 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 */
- /* create a new file using default properties. */
- if ((fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- /* create the file space */
- if ((f_sid = H5Screate_simple(RANK, dims, dims)) < 0) TEST_ERROR;
- /* create the memory space with chunk dimensions */
- if ((m_sid = H5Screate_simple(RANK, chunk_dims, chunk_dims)) < 0) TEST_ERROR;
- start[0] = 0;
- start[1] = 0;
- if (H5Sselect_hyperslab(m_sid, H5S_SELECT_SET, start, NULL, chunk_dims, NULL) < 0) TEST_ERROR;
+ 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;
- TESTING("chunk info");
+error:
+ return FAIL;
+}
- /*-------------------------------------------------------------------------
- * create a dataset
- *-------------------------------------------------------------------------
- */
+/*-------------------------------------------------------------------------
+ * 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 */
- /* modify dataset creation properties, i.e. enable chunking. */
- if ((pid = H5Pcreate (H5P_DATASET_CREATE)) < 0) TEST_ERROR;
- if (H5Pset_chunk(pid, RANK, chunk_dims) < 0) TEST_ERROR;
- if (H5Pset_fill_value(pid, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR;
+ /* 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;
- /* create a new dataset */
- if((did = H5Dcreate2(fid , DATASETNAME, H5T_NATIVE_INT, f_sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR;
+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 */
- /*-------------------------------------------------------------------------
- * write the dataset in 2x2 chunks
- *-------------------------------------------------------------------------
- */
+ /* 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;
- /* iterate in dim 0 */
- for (j = 0; j < chunk_dims[0]; j++)
- {
+error:
+ return FAIL;
+}
- /* reset start in dim 1 */
- start[1] = 0;
+/*-------------------------------------------------------------------------
+ * 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 */
- /* iterate in dim 1 */
- for (i = 0; i < chunk_dims[1]; i++)
- {
+/*-------------------------------------------------------------------------
+ * 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;
- /* select file hyperslab to save a 2x2 chunk */
- if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, chunk_dims, NULL) < 0) TEST_ERROR;
+ HDmemset(&read_buf, 0, sizeof(read_buf));
- /* write the data to the hyperslab. */
- if (H5Dwrite(did, H5T_NATIVE_INT, m_sid, f_sid, H5P_DEFAULT, chunk_data) < 0) TEST_ERROR;
+ /* 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 back and display complete dataset 4x4 */
- if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR;
+ /* 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
-#if defined (PRINT_DATA)
- printf("\n");
- printf("dataset: \n");
- for (jj = 0; jj < dims[0]; jj++) {
- for (ii = 0; ii < dims[1]; ii++) printf("%d ", buf[jj][ii]);
- printf("\n");
+ /* 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;
}
-#endif
+ }
+ return SUCCEED;
- /* increment start in dim 1 */
- start[1] += 2;
+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
}
- /* increment start in dim 0 */
- start[0] += 2;
+ 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[CHUNK_NX][CHUNK_NY]; /* Data chunk */
+ 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 */
+#ifdef H5_HAVE_FILTER_DEFLATE
+ 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;
+#endif /* end H5_HAVE_FILTER_DEFLATE */
+ void *inbuf = 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
- /*-------------------------------------------------------------------------
- * close
- *-------------------------------------------------------------------------
- */
+ /* 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
- if (H5Dclose(did) < 0) TEST_ERROR
- if (H5Sclose(f_sid) < 0) TEST_ERROR
- if (H5Sclose(m_sid) < 0) TEST_ERROR
- if (H5Pclose(pid) < 0) TEST_ERROR
- if (H5Fclose(fid) < 0) TEST_ERROR
+ /* Initialize a chunk of data */
+ for(ii = 0; ii < CHUNK_NX; ii++)
+ for(jj = 0; jj < CHUNK_NY; jj++)
+ direct_buf[ii][jj] = (int)(ii*jj) + 1;
+
+#ifdef H5_HAVE_FILTER_DEFLATE
+ /* Allocate input (compressed) buffer */
+ inbuf = malloc(z_dst_nbytes);
+
+ /* Set chunk size to the compressed chunk size and the chunk point
+ to the compressed data chunk */
+ chunk_size = (hsize_t)z_dst_nbytes;
+ z_dst = (Bytef *)inbuf;
+
+ /* 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
+ }
+#else
+ /* Allocate input (non-compressed) buffer */
+ inbuf = malloc(CHK_SIZE);
+ HDmemcpy(inbuf, direct_buf, CHK_SIZE);
+#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++) {
+ offset[0] = ii * CHUNK_NX;
+ offset[1] = jj * CHUNK_NY;
+ ret = H5Dwrite_chunk(dset, H5P_DEFAULT, flt_msk, offset, chunk_size, (void*)inbuf);
+ if(ret < 0) TEST_ERROR
+ }
+
+ /* Free the input buffer */
+ if(inbuf)
+ HDfree(inbuf);
+
+ 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");
- puts("All chunk info tests passed.");
- return 0;
+ /* 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:
- H5Dclose( did );
- H5Sclose( f_sid );
- H5Sclose( m_sid );
- H5Pclose( pid );
- H5Fclose( fid );
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(dspace);
+ H5Pclose(cparms);
+ H5Fclose(chunkfile);
+ } H5E_END_TRY;
+
H5_FAILED();
- return 1;
-}
+ 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 5d6cfc7..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 *)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 *)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 *)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 *)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:
@@ -1808,7 +1808,7 @@ test_pack_ooo(void)
unsigned free_order[PACK_NMEMBS]; /* Index of remaining free slots in order */
unsigned num_free; /* Number of free slots in order */
unsigned sub_cmpd_order; /* Order to insert the inner compound */
- char name[6]; /* Member name */
+ char name[16]; /* Member name */
unsigned extra_space; /* Whether to add extra space to the end of
* the compound */
unsigned i, j; /* Indices */
@@ -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,32 +2007,32 @@ 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:
*-------------------------------------------------------------------------
*/
static unsigned
-test_ooo_order(char *filename)
+test_ooo_order(char *filename, hid_t fapl_id)
{
hid_t file = -1; /* File ID */
hid_t dtype = -1; /* Datatype IDs */
@@ -2042,7 +2042,7 @@ test_ooo_order(char *filename)
TESTING("that compound member insertion order is preserved")
/* Create the file */
- if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
TEST_ERROR
/* Create the compound */
@@ -2070,7 +2070,7 @@ test_ooo_order(char *filename)
/* Close and reopen the file */
if(H5Tclose(dtype)) TEST_ERROR
if(H5Fclose(file)) TEST_ERROR
- if((file = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR
/* Open the type */
if((dtype_tmp = H5Topen2(file, "dtype", H5P_DEFAULT)) < 0) TEST_ERROR
@@ -2123,7 +2123,7 @@ test_ooo_order(char *filename)
if(H5Tclose(dtype_tmp)) TEST_ERROR
if(H5Tclose(dtype)) TEST_ERROR
if(H5Fclose(file)) TEST_ERROR
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id)) < 0) TEST_ERROR
/* Open the type, and verify status */
if((dtype_tmp = H5Topen2(file, "dtype2", H5P_DEFAULT)) < 0) TEST_ERROR
@@ -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_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:");
- nerrors += test_ooo_order(fname);
+ 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 8c685ee..125c53e 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
*
@@ -99,9 +99,10 @@ verify_old_dset_cork(void)
hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
- int buf[100][20]; /* Data buffer */
- int i = 0, j = 0; /* Local index variable */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ int **buf = NULL; /* Data bufer (pointers to fake 2D array) */
+ int *buf_data = NULL; /* Data buffer (actual data) */
+ int i = 0, j = 0; /* Local index variables */
+ H5O_info2_t oinfo, oinfo2, oinfo3; /* Object metadata information */
hsize_t dims2[2] = {8, 16}; /* Dataset dimension sizes */
/* Testing Macro */
@@ -120,34 +121,42 @@ 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_info(did, &oinfo) < 0)
+ if(H5Oget_info3(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_BT1 */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
/* Verify cork status */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0)
TEST_ERROR
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(100 * 20, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(100, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < 100; i++)
+ buf[i] = buf_data + (i * 20);
+
/* Initialize data buffer */
for(i = 0; i < (int)dims[0]; i++)
for(j = 0; j < (int)dims[1]; j++)
buf[i][j] = (i + 1) * (j + 1);
/* Write to the dataset: DSET_BT1 */
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR
/* Verify the cork status for DSET_BT1 */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0)
TEST_ERROR
/* Create compact dataset: DSET_COMPACT */
@@ -159,19 +168,19 @@ 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_info(did2, &oinfo2) < 0)
+ if(H5Oget_info3(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_COMPACT */
if(H5Odisable_mdc_flushes(did2) < 0)
TEST_ERROR
/* Verify cork status */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -196,11 +205,6 @@ verify_old_dset_cork(void)
if((fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
TEST_ERROR
- /* Initialize data buffer */
- for(i = 0; i < (int)dims[0]; i++)
- for(j = 0; j < (int)dims[1]; j++)
- buf[i][j] = (i + 1) * (j + 1);
-
/* Open and write to the dataset: DSET_BT1 */
if((did = H5Dopen2(fid, DSET_BT1, H5P_DEFAULT)) < 0)
TEST_ERROR
@@ -212,11 +216,11 @@ 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 */
- if(H5Oget_info(did3, &oinfo3) < 0)
+ if(H5Oget_info3(did3, &oinfo3, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_CONTIG */
@@ -224,11 +228,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.token, 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.token, FALSE) < 0)
TEST_ERROR
/* Un-cork the dataset: DSET_CONTIG */
@@ -236,7 +240,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.token, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -249,6 +253,9 @@ verify_old_dset_cork(void)
if(H5Fclose(fid) < 0)
TEST_ERROR
+ HDfree(buf);
+ HDfree(buf_data);
+
PASSED();
return 0;
@@ -265,10 +272,14 @@ error:
H5Pclose(dcpl3);
H5Fclose(fid);
} H5E_END_TRY;
+
+ HDfree(buf);
+ HDfree(buf_data);
+
return 1;
} /* verify_old_dset_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_obj_dset_cork
*
@@ -286,19 +297,19 @@ static unsigned
verify_obj_dset_cork(hbool_t swmr)
{
/* Variable Declarations */
- hid_t fid = -1; /* File ID */
+ hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
hid_t aid = -1; /* Attribute ID */
hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
hid_t did = -1, did2 = -1; /* Dataset IDs */
hid_t oid = -1; /* Object ID */
- hid_t dcpl2; /* Dataset creation property list */
+ hid_t dcpl2; /* Dataset creation property list */
int i = 0; /* Local index variable */
- hsize_t dim[1] = {100}; /* Dataset dimension size */
+ hsize_t dim[1] = {100}; /* Dataset dimension size */
hsize_t chunk_dim[1] = {7}; /* Dataset chunk dimension size */
- H5O_info_t oinfo, oinfo2; /* Object metadata information */
+ H5O_info2_t oinfo, oinfo2; /* Object metadata information */
char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
+ unsigned flags; /* File access flags */
if(swmr) {
TESTING("cork status for dataset objects with attributes (SWMR)");
@@ -325,54 +336,54 @@ 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_info(did, &oinfo) < 0)
+ if(H5Oget_info3(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)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, 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_UINT, 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 */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0)
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)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, 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
/* Get dataset object header address */
- if(H5Oget_info(did2, &oinfo2) < 0)
+ if(H5Oget_info3(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_NONE */
@@ -380,18 +391,18 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* Attach 8 attributes to the dataset */
- for(i = 0;i < 8; i++) {
- sprintf(attrname, "attr %d", i);
- if((aid = H5Acreate2(did2, attrname, H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ for(i = 0; i < 8; i++) {
+ HDsprintf(attrname, "attr %d", i);
+ if((aid = H5Acreate2(did2, attrname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
- if(H5Awrite(aid, H5T_NATIVE_UINT, &i) < 0)
+ if(H5Awrite(aid, H5T_NATIVE_INT, &i) < 0)
TEST_ERROR
if(H5Aclose(aid) < 0)
TEST_ERROR
} /* 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.token, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -412,15 +423,15 @@ 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 */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0)
TEST_ERROR
/* Open the attribute attached to the dataset object: DSET_NONE */
@@ -432,7 +443,7 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* 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.token, TRUE) < 0)
TEST_ERROR
/* Close the attribute */
@@ -440,7 +451,7 @@ verify_obj_dset_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the dataset: DSET */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -469,7 +480,7 @@ error:
return 1;
} /* verify_obj_dset_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_dset_cork
*
@@ -496,9 +507,11 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
hsize_t dims[2] = {100, 20}; /* Dataset dimension sizes */
hsize_t max_dims[2] = {100, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
- int buf[100][20]; int i = 0, j = 0; /* Data buffer */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
- unsigned flags; /* File access flags */
+ int **buf = NULL; /* Data bufer (pointers to fake 2D array) */
+ int *buf_data = NULL; /* Data buffer (actual data) */
+ int i = 0, j = 0; /* Local index variables */
+ H5O_info2_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ unsigned flags; /* File access flags */
/* Testing Macro */
if(swmr) {
@@ -540,33 +553,33 @@ 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_info(did, &oinfo) < 0)
+ if(H5Oget_info3(did, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_EA */
if(H5Odisable_mdc_flushes(did) < 0)
TEST_ERROR
/* Verify cork status */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, TRUE) < 0)
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
/* Get dataset object header address: DSET_FA */
- if(H5Oget_info(did2, &oinfo2) < 0)
+ if(H5Oget_info3(did2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
-
+
/* Cork the dataset: DSET_FA */
if(H5Odisable_mdc_flushes(did2) < 0)
TEST_ERROR
@@ -576,22 +589,22 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Verify the cork status for DSET_FA */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0)
TEST_ERROR
/* Verify the cork status for DSET_EA */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0)
TEST_ERROR
/* 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
/* Get dataset object header address: DSET_BT2 */
- if(H5Oget_info(did3, &oinfo3) < 0)
+ if(H5Oget_info3(did3, &oinfo3, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET_BT2 */
@@ -599,7 +612,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Verify the cork status for DSET_BT2 */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -630,6 +643,14 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
if((fid = H5Fopen(FILENAME, flags, fapl)) < 0)
TEST_ERROR
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(100 * 20, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(100, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < 100; i++)
+ buf[i] = buf_data + (i * 20);
+
/* Initialize data buffer */
for(i = 0; i < (int)dims[0]; i++)
for(j = 0; j < (int)dims[1]; j++)
@@ -638,17 +659,17 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
/* Open and write to the dataset: DSET_EA */
if((did = H5Dopen2(fid, DSET_EA, H5P_DEFAULT)) < 0)
TEST_ERROR
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR
/* Verify the cork status for DSET_EA */
- if(H5C__verify_cork_tag_test(fid, oinfo.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo.token, FALSE) < 0)
TEST_ERROR
/* Open and write to the dataset: DSET_FA */
if((did2 = H5Dopen2(fid, DSET_FA, H5P_DEFAULT)) < 0)
TEST_ERROR
- if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR
/* Cork the dataset: DSET_FA */
@@ -656,17 +677,17 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Verify the cork status for DSET_FA */
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0)
TEST_ERROR
/* Open and write to the dataset: DSET_BT2 */
if((did3 = H5Dopen2(fid, DSET_BT2, H5P_DEFAULT)) < 0)
TEST_ERROR
- if(H5Dwrite(did3, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(did3, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR
/* Verify the cork status for DSET_BT2 */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0)
TEST_ERROR
/* Cork the dataset: DSET_BT2 */
@@ -674,7 +695,7 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Verify the cork status for DSET_BT2 */
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -689,6 +710,9 @@ verify_dset_cork(hbool_t swmr, hbool_t new_format)
if(H5Fclose(fid) < 0)
TEST_ERROR
+ HDfree(buf);
+ HDfree(buf_data);
+
PASSED();
return 0;
@@ -704,11 +728,15 @@ error:
H5Pclose(fapl);
H5Fclose(fid);
} H5E_END_TRY;
+
+ HDfree(buf);
+ HDfree(buf_data);
+
return 1;
} /* verify_dset_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_group_cork
*
@@ -729,11 +757,11 @@ verify_group_cork(hbool_t swmr)
hid_t fid = -1; /* File ID */
hid_t fapl = -1; /* File access property list */
hid_t gid = -1, gid2 = -1, gid3 = -1; /* Group IDs */
- H5O_info_t oinfo, oinfo2, oinfo3; /* Object metadata information */
- hid_t aid; /* Attribute ID */
- hid_t sid; /* Dataspace ID */
+ H5O_info2_t oinfo, oinfo2, oinfo3; /* Object metadata information */
+ hid_t aid; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
+ unsigned flags; /* File access flags */
int i = 0; /* Local index variable */
/* Testing Macro */
@@ -758,11 +786,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 */
@@ -770,31 +798,31 @@ verify_group_cork(hbool_t swmr)
TEST_ERROR
/* Get group object header addresses */
- if(H5Oget_info(gid, &oinfo) < 0)
+ if(H5Oget_info3(gid, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5Oget_info(gid2, &oinfo2) < 0)
+ if(H5Oget_info3(gid2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5Oget_info(gid3, &oinfo3) < 0)
+ if(H5Oget_info3(gid3, &oinfo3, H5O_INFO_BASIC) < 0)
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.token, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, TRUE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.token, 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.token, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -813,11 +841,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 +854,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 +863,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.token, TRUE) < 0)
TEST_ERROR
}
if(H5Aclose(aid) < 0)
@@ -843,7 +871,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.token, TRUE) < 0)
TEST_ERROR
/* Closing */
@@ -875,7 +903,7 @@ error:
return 1;
} /* verify_group_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_named_cork
*
@@ -897,12 +925,12 @@ verify_named_cork(hbool_t swmr)
hid_t fapl = -1; /* File access property list */
hid_t tid = -1, tid2 = -1, tid3 = -1; /* Datatype IDs */
hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5O_info_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */
- hid_t aid = -1; /* Attribute ID */
- hid_t sid; /* Dataspace ID */
- hid_t did; /* Dataset ID */
+ H5O_info2_t oinfo, oinfo2, oinfo3, oinfo4; /* Object metadata information */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t did; /* Dataset ID */
char attrname[500]; /* Name of attribute */
- unsigned flags; /* File access flags */
+ unsigned flags; /* File access flags */
int i = 0; /* Local index variable */
/* Testing Macro */
@@ -935,21 +963,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 */
@@ -959,19 +987,19 @@ verify_named_cork(hbool_t swmr)
TEST_ERROR
/* Get named datatype object header addresses */
- if(H5Oget_info(tid, &oinfo) < 0)
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5Oget_info(tid2, &oinfo2) < 0)
+ if(H5Oget_info3(tid2, &oinfo2, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5Oget_info(tid3, &oinfo3) < 0)
+ if(H5Oget_info3(tid3, &oinfo3, H5O_INFO_BASIC) < 0)
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.token, TRUE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, TRUE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.token, TRUE) < 0)
TEST_ERROR
/* Close the datatypes */
@@ -983,19 +1011,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.token, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo2.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo2.token, FALSE) < 0)
TEST_ERROR
- if(H5C__verify_cork_tag_test(fid, oinfo3.addr, FALSE) < 0)
+ if(H5C__verify_cork_tag_test(fid, oinfo3.token, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -1019,17 +1047,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 +1070,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 +1079,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.token, TRUE) < 0)
TEST_ERROR
}
if(H5Aclose(aid) < 0)
@@ -1059,11 +1087,11 @@ 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 */
- if(H5Oget_info(did, &oinfo4) < 0)
+ if(H5Oget_info3(did, &oinfo4, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Cork the dataset: DSET */
@@ -1071,20 +1099,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.token, 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.token, 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.token, 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.token, FALSE) < 0)
TEST_ERROR
/* Cork the datatype: DT */
@@ -1092,14 +1120,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.token, 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.token, 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.token, TRUE) < 0)
TEST_ERROR
/* Close the dataset */
@@ -1107,11 +1135,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.token, 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.token, FALSE) < 0)
TEST_ERROR
/* Closing */
@@ -1149,7 +1177,7 @@ error:
return 1;
} /* verify_named_cork */
-
+
/*-------------------------------------------------------------------------
* Function: verify_multiple_cork
*
@@ -1178,10 +1206,10 @@ verify_multiple_cork(hbool_t swmr)
hid_t aidd1 = -1, aidd2 = -1; /* Attribute ID */
hid_t aidt1 = -1, aidt2 = -1; /* Attribute ID */
hid_t sid = -1; /* Dataspace ID */
- H5O_info_t oinfo1, oinfo2, oinfo3; /* Object metadata information */
- hsize_t dim[1] = {5}; /* Dimension sizes */
- unsigned flags; /* File access flags */
- hbool_t corked; /* Cork status */
+ H5O_info2_t oinfo1, oinfo2, oinfo3; /* Object metadata information */
+ hsize_t dim[1] = {5}; /* Dimension sizes */
+ unsigned flags; /* File access flags */
+ hbool_t corked; /* Cork status */
herr_t ret; /* Return value */
/* Testing Macro */
@@ -1277,9 +1305,9 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the group: gid2 */
- if(H5Oget_info(gid2, &oinfo1) < 0)
+ if(H5Oget_info3(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.token, TRUE) < 0)
TEST_ERROR
/* Check cork status of the group: gid1 */
@@ -1305,9 +1333,9 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the dataset: did1 */
- if(H5Oget_info(did1, &oinfo2) < 0)
+ if(H5Oget_info3(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.token, TRUE) < 0)
TEST_ERROR
/* Check cork status of the dataset: did2 */
@@ -1333,9 +1361,9 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the datatype: tid2 */
- if(H5Oget_info(tid2, &oinfo3) < 0)
+ if(H5Oget_info3(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.token, TRUE) < 0)
TEST_ERROR
/* Check cork status of the datatype: tid1 */
@@ -1349,9 +1377,9 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the group: gid1 */
- if(H5Oget_info(gid1, &oinfo1) < 0)
+ if(H5Oget_info3(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.token, FALSE) < 0)
TEST_ERROR
/* Check cork status of the group: gid2 */
@@ -1371,7 +1399,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.token, FALSE) < 0)
TEST_ERROR
/* Close the group: gid1 */
@@ -1383,9 +1411,9 @@ verify_multiple_cork(hbool_t swmr)
TEST_ERROR
/* Verify cork status of the dataset: did2 */
- if(H5Oget_info(did2, &oinfo2) < 0)
+ if(H5Oget_info3(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.token, FALSE) < 0)
TEST_ERROR
/* Check cork status of the dataset: did1 */
@@ -1405,7 +1433,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.token, FALSE) < 0)
TEST_ERROR
/* Close the dataset: did1 */
@@ -1517,7 +1545,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
@@ -1529,11 +1557,13 @@ error:
static unsigned
test_objs_cork(hbool_t swmr, hbool_t new_format)
{
- hid_t fid; /* HDF5 File ID */
- hid_t fapl; /* File access property list */
- hid_t gid, did, tid; /* Object IDs */
- hid_t sid; /* Dataspace ID */
- hid_t aid; /* Attribute ID */
+ hid_t fid = H5I_INVALID_HID; /* HDF5 File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t gid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID; /* Object IDs */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
hsize_t dims[RANK]; /* Dataset dimension sizes */
hbool_t corked; /* Cork status of an object */
unsigned flags; /* File access flags */
@@ -1723,7 +1753,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 +1826,7 @@ error:
return 1;
} /* test_objs_cork() */
-
+
/*-------------------------------------------------------------------------
* Function: test_dset_cork
*
@@ -1824,8 +1854,9 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
hsize_t cdims[RANK] = {2,2}; /* Chunk dimensions */
int fillval = 0; /* Fill value */
int i, j, k = 0; /* Local index variables */
- int data[DIMS0][DIMS1]; /* Data buffer */
- int rbuf[DIMS0][DIMS1]; /* Data buffer */
+ int **wbuf = NULL; /* Data buffer for writes (pointers to fake 2D array) */
+ int *wbuf_data = NULL; /* Data buffer for writes (real data) */
+ int *rbuf_data = NULL; /* Data buffer for reads (real data) */
hbool_t corked; /* Cork status of an object */
unsigned flags; /* File access flags */
@@ -1847,7 +1878,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 +1911,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
@@ -1921,13 +1952,21 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
if(corked)
TEST_ERROR
+ /* Set up data array */
+ if(NULL == (wbuf_data = (int *)HDcalloc(DIMS0 * DIMS1, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (wbuf = (int **)HDcalloc(DIMS0, sizeof(wbuf_data))))
+ TEST_ERROR;
+ for (i = 0; i < DIMS0; i++)
+ wbuf[i] = wbuf_data + (i * DIMS1);
+
/* Initialize the buffer */
for(i = 0; i < DIMS0;i++)
for(j = 0;j < DIMS1;j++)
- data[i][j] = k++;
+ wbuf[i][j] = k++;
/* Write to the dataset */
- if(H5Dwrite(did1, tid1, sid, sid, H5P_DEFAULT, data) < 0)
+ if(H5Dwrite(did1, tid1, sid, sid, H5P_DEFAULT, wbuf_data) < 0)
TEST_ERROR
/* Flush the dataset */
@@ -1960,8 +1999,12 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
if(corked)
TEST_ERROR
+ /* Set up data array */
+ if(NULL == (rbuf_data = (int *)HDcalloc(DIMS0 * DIMS1, sizeof(int))))
+ TEST_ERROR;
+
/* Read from the dataset */
- if(H5Dread(did1, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ if(H5Dread(did1, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_data) < 0)
TEST_ERROR
/* Cork the dataset */
@@ -1991,7 +2034,7 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
TEST_ERROR
/* Write to the dataset */
- if(H5Dwrite(did1, tid1, sid, sid, H5P_DEFAULT, data) < 0)
+ if(H5Dwrite(did1, tid1, sid, sid, H5P_DEFAULT, wbuf_data) < 0)
TEST_ERROR
/* Refresh the dataset */
@@ -2003,7 +2046,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 +2096,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 */
@@ -2104,6 +2147,10 @@ test_dset_cork(hbool_t swmr, hbool_t new_format)
if(H5Pclose(dcpl) < 0)
TEST_ERROR
+ HDfree(wbuf);
+ HDfree(wbuf_data);
+ HDfree(rbuf_data);
+
PASSED();
return 0;
@@ -2119,12 +2166,17 @@ error:
H5Pclose(fapl);
H5Fclose(fid);
} H5E_END_TRY;
+
+ HDfree(wbuf);
+ HDfree(wbuf_data);
+ HDfree(rbuf_data);
+
return 1;
} /* test_dset_cork() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -2138,12 +2190,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 +2210,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 5d5ef07..c16ddbc 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 */
@@ -213,7 +213,7 @@ error:
* Purpose: Handle each dataset from the data file.
*
* Return: Success: 0
- * Failure: Number of failures
+ * Failure: Number of failures
*
* Programmer: Raymond Lu
* 21 January 2011
@@ -226,7 +226,9 @@ check_file(char *filename)
const char *pathname = H5_get_srcdir_filename(filename); /* Corrected test file name */
hid_t fid = -1; /* file ID */
int nerrors = 0; /* # of datasets with errors */
+#if !defined(H5_HAVE_FILTER_DEFLATE) || !defined(H5_HAVE_FILTER_SZIP)
const char *not_supported= " filter is not enabled."; /* no filter message */
+#endif
/* Open the file. */
if((fid = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
@@ -240,46 +242,46 @@ check_file(char *filename)
TESTING("dataset of LE FLOAT with scale-offset filter");
nerrors += check_data_f(DATASETNAME2, fid);
-
+
TESTING("dataset of BE FLOAT with scale-offset filter");
nerrors += check_data_f(DATASETNAME3, fid);
TESTING("dataset of LE DOUBLE with scale-offset filter");
nerrors += check_data_f(DATASETNAME4, fid);
-
+
TESTING("dataset of BE DOUBLE with scale-offset filter");
nerrors += check_data_f(DATASETNAME5, fid);
-
+
TESTING("dataset of LE CHAR with scale-offset filter");
nerrors += check_data_i(DATASETNAME6, fid);
-
+
TESTING("dataset of BE CHAR with scale-offset filter");
nerrors += check_data_i(DATASETNAME7, fid);
-
+
TESTING("dataset of LE SHORT with scale-offset filter");
nerrors += check_data_i(DATASETNAME8, fid);
-
+
TESTING("dataset of BE SHORT with scale-offset filter");
nerrors += check_data_i(DATASETNAME9, fid);
TESTING("dataset of LE INT with scale-offset filter");
nerrors += check_data_i(DATASETNAME10, fid);
-
+
TESTING("dataset of BE INT with scale-offset filter");
nerrors += check_data_i(DATASETNAME11, fid);
TESTING("dataset of LE LONG LONG with scale-offset filter");
nerrors += check_data_i(DATASETNAME12, fid);
-
+
TESTING("dataset of BE LONG LONG with scale-offset filter");
nerrors += check_data_i(DATASETNAME13, fid);
TESTING("dataset of LE FLOAT with Fletcher32 filter");
nerrors += check_data_f(DATASETNAME14, fid);
-
+
TESTING("dataset of BE FLOAT with Fletcher32 filter");
nerrors += check_data_f(DATASETNAME15, fid);
-
+
TESTING("dataset of LE FLOAT with Deflate filter");
#ifdef H5_HAVE_FILTER_DEFLATE
nerrors += check_data_f(DATASETNAME16, fid);
@@ -367,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/dangle.c b/test/dangle.c
index 1717d12..9f30f10 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -15,10 +15,9 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, May 13, 2003
*
- * Purpose: Test dangling IDs
+ * Purpose: Test dangling IDs
*/
#include "h5test.h"
-#include "H5private.h"
const char *FILENAME[] = {
"dangle",
@@ -32,17 +31,17 @@ const char *FILENAME[] = {
#define TYPENAME "Type"
#define ATTRNAME "Attribute"
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_dataset
+ * Function: test_dangle_dataset
*
- * Purpose: Check for dangling dataset IDs causing problems on library
+ * Purpose: Check for dangling dataset IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -52,7 +51,7 @@ const char *FILENAME[] = {
static int
test_dangle_dataset(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t dsid; /* Dataset ID */
@@ -128,17 +127,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_group
+ * Function: test_dangle_group
*
- * Purpose: Check for dangling group IDs causing problems on library
+ * Purpose: Check for dangling group IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -148,7 +147,7 @@ error:
static int
test_dangle_group(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t gid; /* Group ID */
@@ -219,17 +218,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_datatype1
+ * Function: test_dangle_datatype1
*
- * Purpose: Check for dangling datatype IDs causing problems on library
+ * Purpose: Check for dangling datatype IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -239,7 +238,7 @@ error:
static int
test_dangle_datatype1(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t tid; /* Datatype ID */
@@ -315,17 +314,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_datatype2
+ * Function: test_dangle_datatype2
*
- * Purpose: Check for dangling datatype IDs causing problems on library
+ * Purpose: Check for dangling datatype IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, August 25, 2005
*
* Modifications:
@@ -335,7 +334,7 @@ error:
static int
test_dangle_datatype2(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t did; /* Dataset ID */
@@ -402,17 +401,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_attribute
+ * Function: test_dangle_attribute
*
- * Purpose: Check for dangling attribute IDs causing problems on library
+ * Purpose: Check for dangling attribute IDs causing problems on library
* shutdown
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, June 18, 2003
*
* Modifications:
@@ -422,7 +421,7 @@ error:
static int
test_dangle_attribute(H5F_close_degree_t degree)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t fapl; /* File access property list */
hid_t dsid; /* Dataset ID */
@@ -509,17 +508,17 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_dangle_force
+ * Function: test_dangle_force
*
- * Purpose: Shut down all danging IDs with generic file & ID routines,
+ * Purpose: Shut down all danging IDs with generic file & ID routines,
* instead of letting library shut then down.
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, October 29, 2010
*
*-------------------------------------------------------------------------
@@ -527,7 +526,7 @@ error:
static int
test_dangle_force(void)
{
- char filename[1024];
+ char filename[1024];
hid_t fid; /* File ID */
hid_t gid, gid2; /* Group IDs */
hid_t dsid, dsid2; /* Dataset IDs */
@@ -603,7 +602,8 @@ test_dangle_force(void)
TEST_ERROR;
/* Allocate the array of object IDs */
- objs = (hid_t*)HDmalloc(sizeof(hid_t) * (size_t)count);
+ if(NULL == (objs = (hid_t *)HDcalloc((size_t)count, sizeof(hid_t))))
+ TEST_ERROR;
/* Get the list of open IDs */
if(H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)count, objs) < 0)
@@ -625,7 +625,7 @@ test_dangle_force(void)
/* Release object ID array */
HDfree(objs);
-
+
PASSED();
return 0;
@@ -635,16 +635,16 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Executes dangling ID tests
+ * Purpose: Executes dangling ID tests
*
- * Return: Success: zero
- * Failure: non-zero
+ * Return: Success: zero
+ * Failure: non-zero
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Tuesday, May 13, 2003
*
* Modifications:
@@ -654,7 +654,7 @@ error:
int
main(void)
{
- int nerrors=0;
+ int nerrors=0;
/* Run tests w/weak file close */
puts("Testing dangling objects with weak file close:");
diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c
new file mode 100644
index 0000000..6f48901
--- /dev/null
+++ b/test/del_many_dense_attrs.c
@@ -0,0 +1,203 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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: Test to verify that the infinite loop closing library/abort failure
+ * is fixed when the application creates and removes dense attributes
+ * (See HDFFV-10659).
+ */
+
+
+#include "h5test.h"
+
+/* The test file name */
+const char *FILENAME[] = {
+ "del_many_dense_attrs",
+ NULL
+};
+
+#define ATTR_COUNT 64 /* The number of attributes */
+
+/*-------------------------------------------------------------------------
+ * Function: catch_signal
+ *
+ * Purpose: The signal handler to catch the SIGABRT signal.
+ *
+ * Return: No return
+ *
+ * Programmer: Vailin Choi
+ *
+ *-------------------------------------------------------------------------
+ */
+static void catch_signal(int H5_ATTR_UNUSED signo)
+{
+ HDexit(EXIT_FAILURE);
+} /* catch_signal() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Test to verify that the infinite loop closing library/abort failure
+ * is fixed when the application creates and removes dense attributes
+ * (See HDFFV-10659).
+ *
+ * Return: Success: exit(EXIT_SUCCESS)
+ * Failure: exit(EXIT_FAILURE)
+ *
+ * Programmer: Vailin Choi; Dec 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ hid_t fid = -1; /* HDF5 File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t fapl = -1; /* File access property lists */
+ hid_t gcpl = -1; /* Group creation property list */
+ char aname[50]; /* Name of attribute */
+ const char *basename="attr"; /* Name prefix for attribute */
+ char filename[100]; /* File name */
+ int i; /* Local index variable */
+
+ /* Testing setup */
+ h5_reset();
+
+ /* To exit from the file for SIGABRT signal */
+ if(HDsignal(SIGABRT, catch_signal) == SIG_ERR)
+ TEST_ERROR
+
+ fapl = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
+
+ /* Set to latest format */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR
+
+ /* Create the file */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR
+
+ /* Re-open the file */
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create the group creation property list */
+ if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set to use dense storage for all attributes on the group */
+ if(H5Pset_attr_phase_change(gcpl, 0, 0) < 0)
+ TEST_ERROR
+
+ /* Create the group in the file */
+ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create dataspace */
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
+ TEST_ERROR
+
+ /* Get a copy of the datatype */
+ if((tid = H5Tcopy(H5T_NATIVE_FLOAT)) < 0)
+ TEST_ERROR
+
+ /* Create attributes in the group */
+ for(i = ATTR_COUNT; i >= 0; i--) {
+ /* Set up the attribute name */
+ HDsprintf(aname, "%s%d", basename, i);
+
+ /* Create the attribute */
+ if((aid = H5Acreate2(gid, aname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Write to the attribute */
+ if(H5Awrite(aid, tid, &i) < 0)
+ TEST_ERROR
+
+ /* Close the attribute */
+ if(H5Aclose(aid) < 0)
+ TEST_ERROR
+ }
+
+ /* Close the datatype */
+ if(H5Tclose(tid) < 0)
+ TEST_ERROR
+
+ /* Close the dataspace */
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR
+
+ /* Close the group */
+ if(H5Gclose(gid) < 0)
+ TEST_ERROR
+
+ /* Close the group creation property list */
+ if(H5Pclose(gcpl) < 0)
+ TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR
+
+ /* Re-open the file */
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+
+ /* Open the group */
+ if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Delete the attributes */
+ for (i = 0; i <= ATTR_COUNT; i++) {
+ /* Set up the attribute name */
+ HDsprintf(aname, "%s%d", basename, i);
+
+ /* Delete the attribute */
+ if(H5Adelete(gid, aname) < 0)
+ TEST_ERROR
+ } /* end for */
+
+ /* Close the group */
+ if(H5Gclose(gid) < 0)
+ TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR
+
+ h5_cleanup(FILENAME, fapl);
+
+ return(EXIT_SUCCESS);
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(gid);
+ H5Sclose(sid);
+ H5Tclose(tid);
+ H5Aclose(aid);
+ H5Fclose(fid);
+ H5Pclose(gcpl);
+ H5Pclose(fapl);
+ } H5E_END_TRY
+
+ return EXIT_FAILURE;
+}
diff --git a/test/direct_chunk.c b/test/direct_chunk.c
new file mode 100644
index 0000000..2e6cc68
--- /dev/null
+++ b/test/direct_chunk.c
@@ -0,0 +1,2248 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+* 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. *
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#include "h5test.h"
+
+#if defined(H5_HAVE_ZLIB_H) && !defined(H5_ZLIB_HEADER)
+# define H5_ZLIB_HEADER "zlib.h"
+#endif
+#if defined(H5_ZLIB_HEADER)
+# include H5_ZLIB_HEADER /* "zlib.h" */
+#endif
+
+#define FILE_NAME "direct_chunk.h5"
+
+/* Datasets for Direct Write tests */
+#define DATASETNAME1 "direct_write"
+#define DATASETNAME2 "skip_one_filter"
+#define DATASETNAME3 "skip_two_filters"
+#define DATASETNAME4 "data_conv"
+#define DATASETNAME5 "contiguous_dset"
+#define DATASETNAME6 "invalid_argue"
+#define DATASETNAME7 "overwrite_chunk"
+/* Datasets for Direct Read tests */
+#define DATASETNAME8 "disabled_chunk_cache"
+#define DATASETNAME9 "flush_chunk_cache"
+#define DATASETNAME10 "read_w_valid_cache"
+#define DATASETNAME11 "unallocated_chunk"
+#define DATASETNAME12 "unfiltered_data"
+
+#define RANK 2
+#define NX 16
+#define NY 16
+#define CHUNK_NX 4
+#define CHUNK_NY 4
+
+#define DEFLATE_SIZE_ADJUST(s) (HDceil(((double)(s))*1.001)+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
+
+/* Constants for the overwrite test */
+#define OVERWRITE_NDIMS 3
+#define OVERWRITE_CHUNK_NX 3
+#define OVERWRITE_CHUNK_2NX 6
+#define OVERWRITE_CHUNK_NY 2
+#define OVERWRITE_VALUE 42
+
+/* Test configurations */
+#define CONFIG_LATEST 0x01
+#define CONFIG_REOPEN_FILE 0x02
+#define CONFIG_REOPEN_DSET 0x04
+#define CONFIG_DIRECT_WRITE 0x08
+#define CONFIG_DIRECT_READ 0x10
+#define CONFIG_END 0x20
+
+/* Defines used in test_single_chunk_latest() */
+#define FILE "single_latest.h5"
+#define DATASET "dataset"
+#define DIM0 4
+#define DIM1 32
+#define CHUNK0 DIM0
+#define CHUNK1 DIM1
+
+/* Local prototypes for filter functions */
+static size_t filter_bogus1(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* 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 */
+ 1, 1, /* Encoding and decoding enabled */
+ "bogus1", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ 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 */
+ 1, 1, /* Encoding and decoding enabled */
+ "bogus2", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ filter_bogus2, /* The actual filter function */
+}};
+
+/*-------------------------------------------------------------------------
+ * Function: test_direct_chunk_write
+ *
+ * Purpose: Test the basic functionality of H5Dwrite_chunk
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_FILTER_DEFLATE
+static int
+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 maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY};
+ herr_t status;
+ int ret;
+ int data[NX][NY];
+ int i, j, n;
+
+ unsigned filter_mask = 0;
+ int direct_buf[CHUNK_NX][CHUNK_NY];
+ int check_chunk[CHUNK_NX][CHUNK_NY];
+ hsize_t offset[2] = {0, 0};
+ 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;
+ int aggression = 9; /* Compression aggression setting */
+ void *outbuf = NULL; /* Pointer to new buffer */
+
+ 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 */
+
+ TESTING("basic functionality of H5Dwrite_chunk");
+
+ /*
+ * Create the data space with unlimited dimensions.
+ */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /*
+ * Modify dataset creation properties, i.e. enable chunking and compression
+ */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ if((status = H5Pset_deflate( cparms, (unsigned) aggression)) < 0)
+ goto error;
+
+ /*
+ * Create a new dataset within the file using cparms
+ * creation properties.
+ */
+ if((dataset = H5Dcreate2(file, DATASETNAME1, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ 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++;
+
+ 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.
+ */
+ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ 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++;
+
+ /* Allocate output (compressed) buffer */
+ outbuf = HDmalloc(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) {
+ HDfprintf(stderr, "overflow");
+ goto error;
+ } else if(Z_MEM_ERROR == ret) {
+ HDfprintf(stderr, "deflate memory error");
+ goto error;
+ } else if(Z_OK != ret) {
+ HDfprintf(stderr, "other deflate error");
+ goto error;
+ }
+
+ /* 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);
+ offset[1] += CHUNK_NY;
+ }
+ offset[0] += CHUNK_NX;
+ offset[1] = 0;
+ }
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+ if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /*
+ * Select hyperslab for one chunk 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((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ 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]);
+ goto error;
+ }
+ }
+ }
+
+ /* 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;
+
+ /* Allocate output (compressed) buffer */
+ outbuf = HDmalloc(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) {
+ HDfprintf(stderr, "overflow");
+ goto error;
+ } else if(Z_MEM_ERROR == ret) {
+ HDfprintf(stderr, "deflate memory error");
+ goto error;
+ } else if(Z_OK != ret) {
+ HDfprintf(stderr, "other deflate error");
+ goto error;
+ }
+
+ /* 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++) {
+ status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, z_dst_nbytes, outbuf);
+ offset[1] += CHUNK_NY;
+ }
+ offset[0] += CHUNK_NX;
+ offset[1] = 0;
+ }
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+ if((dataset = H5Dopen2(file, DATASETNAME1, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ 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]);
+ goto error;
+ }
+ }
+ }
+
+ /*
+ * Close/release resources.
+ */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ H5_FAILED();
+ return 1;
+} /* test_direct_chunk_write() */
+#endif /* H5_HAVE_FILTER_DEFLATE */
+
+/*-------------------------------------------------------------------------
+ * Function: test_direct_chunk_overwrite_data
+ *
+ * Purpose: Test overwriting a chunk with new data.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Dana Robinson
+ * Spring 2017
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_direct_chunk_overwrite_data(hid_t fid)
+{
+ size_t buf_size = OVERWRITE_CHUNK_NX * OVERWRITE_CHUNK_NY * sizeof(int16_t);
+ int16_t data_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX];
+ int16_t overwrite_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_NX];
+ uint32_t filter_mask = 0;
+ hid_t tid = H5T_NATIVE_UINT16;
+ hid_t dcpl_id = -1;
+ hid_t sid = -1;
+ hid_t did = -1;
+ uint16_t fill_value = 0;
+ hsize_t dset_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX};
+ hsize_t dset_max_dims[] = {H5S_UNLIMITED, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_2NX};
+ hsize_t chunk_dims[] = {1, OVERWRITE_CHUNK_NY, OVERWRITE_CHUNK_NX};
+ hsize_t offset[] = {0, 0, 0};
+ hsize_t i, j;
+ int16_t n;
+ int16_t read_buf[OVERWRITE_CHUNK_NY][OVERWRITE_CHUNK_2NX];
+
+ TESTING("overwriting existing data with H5Dwrite_chunk");
+
+ /* Create the dataset's data space */
+ if ((sid = H5Screate_simple(OVERWRITE_NDIMS, dset_dims, dset_max_dims)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Set chunk size and filll value */
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+ if (H5Pset_fill_value(dcpl_id, tid, &fill_value) < 0)
+ FAIL_STACK_ERROR
+ if (H5Pset_chunk(dcpl_id, OVERWRITE_NDIMS, chunk_dims) < 0)
+ FAIL_STACK_ERROR
+
+ /* Create dataset */
+ if ((did = H5Dcreate2(fid, DATASETNAME7, tid, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Initialize data buffers */
+ n = 0;
+ for (i = 0; i < OVERWRITE_CHUNK_NY; i++) {
+ for (j = 0; j < OVERWRITE_CHUNK_NX; j++) {
+ data_buf[i][j] = n++;
+ overwrite_buf[i][j] = OVERWRITE_VALUE;
+ }
+ }
+
+ /* Write chunk data using the direct write function. */
+ if (H5Dwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Write second chunk. */
+ offset[2] = OVERWRITE_CHUNK_NX;
+ if (H5Dwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, data_buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Overwrite first chunk. */
+ offset[2] = 0;
+ if (H5Dwrite_chunk(did, H5P_DEFAULT, filter_mask, offset, buf_size, overwrite_buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Read the data back out */
+ if (H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0)
+ FAIL_STACK_ERROR
+
+ /* Ensure that the data are correct in chunk 1 */
+ for (i = 0; i < OVERWRITE_CHUNK_NY; i++)
+ for (j = 0; j < OVERWRITE_CHUNK_NX; j++) {
+ if (read_buf[i][j] != OVERWRITE_VALUE)
+ TEST_ERROR
+ }
+
+ if (H5Pclose(dcpl_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(sid) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(did) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(dcpl_id);
+ H5Sclose(sid);
+ H5Dclose(did);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* end test_direct_chunk_overwrite_data() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_skip_compress_write1
+ *
+ * Purpose: Test skipping compression filter when it is the only filter
+ * for the dataset
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_skip_compress_write1(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 maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY};
+ herr_t status;
+ int i, j, n;
+
+ unsigned filter_mask = 0;
+ int direct_buf[CHUNK_NX][CHUNK_NY];
+ int check_chunk[CHUNK_NX][CHUNK_NY];
+ hsize_t offset[2] = {0, 0};
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+ int aggression = 9; /* Compression aggression setting */
+
+ unsigned read_filter_mask = 0; /* filter mask after direct read */
+ int read_direct_buf[CHUNK_NX][CHUNK_NY];
+ hsize_t read_buf_size = 0; /* buf size */
+
+ 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 */
+
+ TESTING("skipping compression filter for H5Dwrite_chunk/H5Dread_chunk");
+
+ /*
+ * Create the data space with unlimited dimensions.
+ */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /*
+ * Modify dataset creation properties, i.e. enable chunking and compression
+ */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ if((status = H5Pset_deflate( cparms, (unsigned ) aggression)) < 0)
+ goto error;
+
+ /*
+ * Create a new dataset within the file using cparms
+ * creation properties.
+ */
+ if((dataset = H5Dcreate2(file, DATASETNAME2, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 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++;
+ }
+
+ /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function.
+ * Indicate skipping the compression filter. */
+ offset[0] = CHUNK_NX;
+ offset[1] = CHUNK_NY;
+
+ filter_mask = 0x00000001;
+
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) < 0)
+ goto error;
+
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+ if((dataset = H5Dopen2(file, DATASETNAME2, H5P_DEFAULT)) < 0)
+ goto 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((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ 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]);
+ goto error;
+ }
+ }
+ }
+
+ /* Query chunk storage size */
+ if((status = H5Dget_chunk_storage_size(dataset, offset, &read_buf_size)) < 0)
+ goto error;
+ if(read_buf_size != buf_size)
+ goto error;
+
+ /* Read the raw chunk back */
+ HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf));
+ if((status = H5Dread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, read_direct_buf)) < 0)
+ goto error;
+ if(read_filter_mask != filter_mask)
+ goto error;
+
+ /* Check that the direct chunk read is the same as the chunk written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ if(direct_buf[i][j] != read_direct_buf[i][j]) {
+ HDprintf(" 1. Read different values than written.");
+ HDprintf(" At index %d,%d\n", i, j);
+ HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]);
+ goto error;
+ }
+ }
+ }
+
+ /*
+ * Close/release resources.
+ */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_skip_compress_write1() */
+
+/*-------------------------------------------------------------------------
+ * Function: filter_bogus1
+ *
+ * Purpose: A bogus filter that adds ADD_ON to the original value
+ *
+ * Return: Success: Data chunk size
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+filter_bogus1(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
+ const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf)
+{
+ int *int_ptr=(int *)*buf; /* Pointer to the data values */
+ size_t buf_left=*buf_size; /* Amount of data buffer left to process */
+
+ if(flags & H5Z_FLAG_REVERSE) { /* read */
+ /* Substract the "add on" value to all the data values */
+ while(buf_left>0) {
+ *int_ptr++ -= (int)ADD_ON;
+ buf_left -= sizeof(int);
+ } /* end while */
+ } /* end if */
+ else { /* write */
+ /* Add the "add on" value to all the data values */
+ while(buf_left>0) {
+ *int_ptr++ += (int)ADD_ON;
+ buf_left -= sizeof(int);
+ } /* end while */
+ } /* end else */
+
+ return nbytes;
+} /* filter_bogus1() */
+
+/*-------------------------------------------------------------------------
+ * Function: filter_bogus2
+ *
+ * Purpose: A bogus filter that multiplies the original value by FACTOR.
+ *
+ * Return: Success: Data chunk size
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *-------------------------------------------------------------------------
+ */
+static size_t
+filter_bogus2(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
+ const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf)
+{
+ int *int_ptr=(int *)*buf; /* Pointer to the data values */
+ size_t buf_left=*buf_size; /* Amount of data buffer left to process */
+
+ if(flags & H5Z_FLAG_REVERSE) { /* read */
+ /* Substract the "add on" value to all the data values */
+ while(buf_left>0) {
+ *int_ptr++ /= (int)FACTOR;
+ buf_left -= sizeof(int);
+ } /* end while */
+ } /* end if */
+ else { /* write */
+ /* Add the "add on" value to all the data values */
+ while(buf_left>0) {
+ *int_ptr++ *= (int)FACTOR;
+ buf_left -= sizeof(int);
+ } /* end while */
+ } /* end else */
+
+ return nbytes;
+} /* filter_bogus2() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_skip_compress_write2
+ *
+ * Purpose: Test skipping compression filter when there are three filters
+ * for the dataset
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_skip_compress_write2(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 maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY};
+ herr_t status;
+ int i, j, n;
+
+ unsigned filter_mask = 0; /* orig filter mask */
+ int origin_direct_buf[CHUNK_NX][CHUNK_NY];
+ int direct_buf[CHUNK_NX][CHUNK_NY];
+ int check_chunk[CHUNK_NX][CHUNK_NY];
+ hsize_t offset[2] = {0, 0};
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+ int aggression = 9; /* Compression aggression setting */
+
+ unsigned read_filter_mask = 0; /* filter mask after direct read */
+ int read_direct_buf[CHUNK_NX][CHUNK_NY];
+ hsize_t read_buf_size = 0; /* buf size */
+
+ 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 */
+
+ TESTING("skipping compression filters but keep two other filters");
+
+ /*
+ * Create the data space with unlimited dimensions.
+ */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /*
+ * Modify dataset creation properties, i.e. enable chunking and compression.
+ * The order of filters is bogus 1 + deflate + bogus 2.
+ */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ /* Register and enable first bogus filter */
+ if(H5Zregister (H5Z_BOGUS1) < 0)
+ goto error;
+
+ if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS1, 0, (size_t)0, NULL) < 0)
+ goto error;
+
+ /* Enable compression filter */
+ if((status = H5Pset_deflate( cparms, (unsigned) aggression)) < 0)
+ goto error;
+
+ /* Register and enable second bogus filter */
+ if(H5Zregister (H5Z_BOGUS2) < 0)
+ goto error;
+
+ if(H5Pset_filter(cparms, H5Z_FILTER_BOGUS2, 0, (size_t)0, NULL) < 0)
+ goto error;
+
+ /*
+ * Create a new dataset within the file using cparms
+ * creation properties.
+ */
+ if((dataset = H5Dcreate2(file, DATASETNAME3, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+
+ /* Initialize data for one chunk. Apply operations of two bogus filters to the chunk */
+ for(i = n = 0; i < CHUNK_NX; i++)
+ for(j = 0; j < CHUNK_NY; j++) {
+ origin_direct_buf[i][j] = n++;
+ direct_buf[i][j] = (origin_direct_buf[i][j] + ADD_ON) * FACTOR;
+ }
+
+ /* write the uncompressed chunk data repeatedly to dataset, using the direct writing function.
+ * Indicate skipping the compression filter but keep the other two bogus filters */
+ offset[0] = CHUNK_NX;
+ offset[1] = CHUNK_NY;
+
+ /* compression filter is the middle one to be skipped */
+ filter_mask = 0x00000002;
+
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) < 0)
+ goto error;
+
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+ if((dataset = H5Dopen2(file, DATASETNAME3, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /*
+ * Select hyperslab for one chunk 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((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ if(origin_direct_buf[i][j] != check_chunk[i][j]) {
+ HDprintf(" 1. Read different values than written.");
+ HDprintf(" At index %d,%d\n", i, j);
+ HDprintf(" origin_direct_buf=%d, check_chunk=%d\n", origin_direct_buf[i][j], check_chunk[i][j]);
+ goto error;
+ }
+ }
+ }
+
+ /* Query chunk storage size */
+ if((status = H5Dget_chunk_storage_size(dataset, offset, &read_buf_size)) < 0)
+ goto error;
+ if(read_buf_size != buf_size)
+ goto error;
+
+ /* Read the raw chunk back */
+ HDmemset(&read_direct_buf, 0, sizeof(read_direct_buf));
+ if((status = H5Dread_chunk(dataset, H5P_DEFAULT, offset, &read_filter_mask, read_direct_buf)) < 0)
+ goto error;
+ if(read_filter_mask != filter_mask)
+ goto error;
+
+ /* Check that the direct chunk read is the same as the chunk written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ if(direct_buf[i][j] != read_direct_buf[i][j]) {
+ HDprintf(" 1. Read different values than written.");
+ HDprintf(" At index %d,%d\n", i, j);
+ HDprintf(" direct_buf=%d, read_direct_buf=%d\n", direct_buf[i][j], read_direct_buf[i][j]);
+ goto error;
+ }
+ }
+ }
+
+ /*
+ * Close/release resources.
+ */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_skip_compress_write2() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_data_conv
+ *
+ * Purpose: Test data conversion
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_data_conv(hid_t file)
+{
+ typedef struct {
+ int a, b, c[4], d, e;
+ } src_type_t;
+ typedef struct {
+ int a, c[4], e;
+ } dst_type_t;
+
+ 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 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;
+ hid_t array_dt;
+
+ unsigned filter_mask = 0;
+ src_type_t direct_buf[CHUNK_NX][CHUNK_NY];
+ dst_type_t check_chunk[CHUNK_NX][CHUNK_NY];
+ src_type_t read_chunk[CHUNK_NX][CHUNK_NY]; /* For H5Dread_chunk */
+
+ hsize_t offset[2] = {0, 0};
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(src_type_t);
+
+ 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 */
+
+ TESTING("data conversion for H5Dwrite_chunk/H5Dread_chunk");
+
+ /*
+ * Create the data space with unlimited dimensions.
+ */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /*
+ * Modify dataset creation properties, i.e. enable chunking
+ */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ /* Build hdf5 datatypes */
+ array_dt = H5Tarray_create2(H5T_NATIVE_INT, 1, &four);
+ if((st = H5Tcreate(H5T_COMPOUND, sizeof(src_type_t))) < 0 ||
+ H5Tinsert(st, "a", HOFFSET(src_type_t, a), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(st, "b", HOFFSET(src_type_t, b), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(st, "c", HOFFSET(src_type_t, c), array_dt) < 0 ||
+ H5Tinsert(st, "d", HOFFSET(src_type_t, d), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(st, "e", HOFFSET(src_type_t, e), H5T_NATIVE_INT) < 0)
+ goto error;
+
+ if(H5Tclose(array_dt) < 0)
+ goto error;
+
+ array_dt = H5Tarray_create2(H5T_NATIVE_INT, 1, &four);
+ if((dt = H5Tcreate(H5T_COMPOUND, sizeof(dst_type_t))) < 0 ||
+ H5Tinsert(dt, "a", HOFFSET(dst_type_t, a), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(dt, "c", HOFFSET(dst_type_t, c), array_dt) < 0 ||
+ H5Tinsert(dt, "e", HOFFSET(dst_type_t, e), H5T_NATIVE_INT) < 0)
+ goto error;
+
+ if(H5Tclose(array_dt) < 0)
+ goto error;
+
+ /*
+ * Create a new dataset within the file using cparms
+ * creation properties.
+ */
+ if((dataset = H5Dcreate2(file, DATASETNAME4, st, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 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]).a = i*j+0;
+ (direct_buf[i][j]).b = i*j+1;
+ (direct_buf[i][j]).c[0] = i*j+2;
+ (direct_buf[i][j]).c[1] = i*j+3;
+ (direct_buf[i][j]).c[2] = i*j+4;
+ (direct_buf[i][j]).c[3] = i*j+5;
+ (direct_buf[i][j]).d = i*j+6;
+ (direct_buf[i][j]).e = i*j+7;
+ }
+ }
+
+ /* 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;
+
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) < 0)
+ goto error;
+
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+ if((dataset = H5Dopen2(file, DATASETNAME4, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Use H5Dread_chunk() to read the uncompressed data */
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, read_chunk)) < 0)
+ goto error;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ if ((direct_buf[i][j]).a != (read_chunk[i][j]).a ||
+ (direct_buf[i][j]).b != (read_chunk[i][j]).b ||
+ (direct_buf[i][j]).c[0] != (read_chunk[i][j]).c[0] ||
+ (direct_buf[i][j]).c[1] != (read_chunk[i][j]).c[1] ||
+ (direct_buf[i][j]).c[2] != (read_chunk[i][j]).c[2] ||
+ (direct_buf[i][j]).c[3] != (read_chunk[i][j]).c[3] ||
+ (direct_buf[i][j]).d != (read_chunk[i][j]).d ||
+ (direct_buf[i][j]).e != (read_chunk[i][j]).e) {
+ 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]).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]).c[2], (read_chunk[i][j]).c[3], (read_chunk[i][j]).d, (read_chunk[i][j]).e);
+
+ goto 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((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back. Data should be converted */
+ if((status = H5Dread(dataset, dt, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < CHUNK_NX; i++) {
+ for(j = 0; j < CHUNK_NY; j++) {
+ if ((direct_buf[i][j]).a != (check_chunk[i][j]).a ||
+ (direct_buf[i][j]).c[0] != (check_chunk[i][j]).c[0] ||
+ (direct_buf[i][j]).c[1] != (check_chunk[i][j]).c[1] ||
+ (direct_buf[i][j]).c[2] != (check_chunk[i][j]).c[2] ||
+ (direct_buf[i][j]).c[3] != (check_chunk[i][j]).c[3] ||
+ (direct_buf[i][j]).e != (check_chunk[i][j]).e) {
+ 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]).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]).c[3], (check_chunk[i][j]).e);
+
+ goto error;
+ }
+ }
+ }
+
+ /*
+ * Close/release resources.
+ */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ H5Tclose(st);
+ H5Tclose(dt);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ H5Tclose(st);
+ H5Tclose(dt);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_data_conv() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_invalid_parameters
+ *
+ * Purpose: Test invalid parameters for H5Dwrite_chunk and H5Dread_chunk
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+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 chunk_dims[2] ={CHUNK_NX, CHUNK_NY};
+ herr_t status;
+ int i, j, n;
+
+ unsigned filter_mask = 0;
+ int direct_buf[CHUNK_NX][CHUNK_NY];
+ hsize_t offset[2] = {0, 0};
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+ int aggression = 9; /* Compression aggression setting */
+
+ hsize_t chunk_nbytes; /* Chunk size */
+
+ TESTING("invalid parameters for H5Dwrite_chunk/H5Dread_chunk");
+
+ /*
+ * Create the data space with unlimited dimensions.
+ */
+ if((dataspace = H5Screate_simple(RANK, dims, NULL)) < 0)
+ goto error;
+
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /*
+ * Modify dataset creation properties
+ */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+
+ /*
+ * 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)
+ goto error;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 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++;
+ }
+
+ /* Try to write the chunk data to contiguous dataset. It should fail */
+ offset[0] = CHUNK_NX;
+ offset[1] = CHUNK_NY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Try to get chunk size for a contiguous dataset. It should fail */
+ H5E_BEGIN_TRY {
+ if((status = H5Dget_chunk_storage_size(dataset, offset, &chunk_nbytes)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Try to H5Dread_chunk from the contiguous dataset. It should fail */
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+
+ /* Create a chunked dataset with compression filter */
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ if((status = H5Pset_deflate( cparms, (unsigned ) aggression)) < 0)
+ goto error;
+
+ /*
+ * Create a new dataset within the file using cparms
+ * creation properties.
+ */
+ if((dataset = H5Dcreate2(file, DATASETNAME6, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* 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;
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk((hid_t)-1, dxpl, offset, &filter_mask, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Check invalid DXPL ID for H5Dwrite_chunk and H5Dread_chunk */
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, (hid_t)-1, filter_mask, offset, buf_size, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk(dataset, (hid_t)-1, offset, &filter_mask, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Check invalid OFFSET for H5Dwrite_chunk and H5Dread_chunk */
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, NULL, buf_size, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk(dataset, dxpl, NULL, &filter_mask, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Check when OFFSET is out of dataset range for H5Dwrite_chunk and H5Dread_chunk */
+ offset[0] = NX + 1;
+ offset[1] = NY;
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Check when OFFSET is not on chunk boundary for H5Dwrite_chunk and H5Dread_chunk */
+ offset[0] = CHUNK_NX;
+ offset[1] = CHUNK_NY + 1;
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Check invalid buffer size for H5Dwrite_chunk only */
+ offset[0] = CHUNK_NX;
+ offset[1] = CHUNK_NY;
+ buf_size = 0;
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, direct_buf)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ /* Check invalid data buffer for H5Dwrite_chunk and H5Dread_chunk */
+ buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+ H5E_BEGIN_TRY {
+ if((status = H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, buf_size, NULL)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ H5E_BEGIN_TRY {
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, NULL)) != FAIL)
+ goto error;
+ } H5E_END_TRY;
+
+ if(H5Dclose(dataset) < 0)
+ goto error;
+
+ /*
+ * Close/release resources.
+ */
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_invalid_parameters() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_direct_chunk_read_no_cache
+ *
+ * Purpose: Test the basic functionality of H5Dread_chunk with the
+ * chunk cache diabled.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Matthew Strong (GE Healthcare)
+ * 14 February 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_FILTER_DEFLATE
+static int
+test_direct_chunk_read_no_cache (hid_t file)
+{
+ hid_t dataspace = -1, dataset = -1;
+ hid_t mem_space = -1;
+ hid_t cparms = -1, dxpl = -1, dapl = -1;
+ 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; /* status from H5 function calls */
+ int ret; /* deflate return status */
+ int data[NX][NY];
+ int i, j, k, l, n; /* local index variables */
+
+ unsigned filter_mask = 0; /* filter mask returned from H5Dread_chunk */
+ int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread and manually decompressed */
+ int check_chunk[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread */
+ hsize_t offset[2]; /* chunk offset used for H5Dread_chunk */
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+
+ Bytef *z_src = NULL; /* source buffer */
+ uLongf z_src_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size);
+ Bytef *z_dst = (Bytef*)(direct_buf);
+ uLong z_dst_nbytes = (uLong)buf_size;
+ int aggression = 9; /* Compression aggression setting */
+ void *outbuf = NULL; /* Pointer to new buffer */
+
+ 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 */
+
+ TESTING("basic functionality of H5Dread_chunk (chunk cache disabled)");
+
+ /* Create the data space with unlimited dimensions. */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /* Modify dataset creation properties, i.e. enable chunking and compression */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+ if((status = H5Pset_deflate( cparms, (unsigned) aggression)) < 0)
+ goto error;
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ goto error;
+
+ /* Disable chunk cache by setting number of slots to 0 */
+ if((status = H5Pset_chunk_cache(dapl, 0, H5D_CHUNK_CACHE_NBYTES_DEFAULT, H5D_CHUNK_CACHE_W0_DEFAULT)) < 0)
+ goto error;
+
+ /* Create a new dataset within the file using cparms creation properties. */
+ if((dataset = H5Dcreate2(file, DATASETNAME8, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, dapl)) < 0)
+ goto error;
+
+ /* Initialize the dataset */
+ for(i = n = 0; i < NX; i++)
+ for(j = 0; j < NY; j++)
+ data[i][j] = n++;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+
+ /* Write the data for the dataset.
+ * Data will skip chunk cache and go directly to disk. */
+ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl, data)) < 0)
+ goto error;
+
+ /* Allocate output (compressed) buffer */
+ outbuf = HDmalloc(z_src_nbytes);
+ z_src = (Bytef *)outbuf;
+
+ /* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */
+ for(i=0; i<NX/CHUNK_NX; i++) {
+ for(j=0; j<NY/CHUNK_NY; j++) {
+ /* Select hyperslab for one chunk in the file */
+ start[0] = (hsize_t)i * CHUNK_NX; start[1] = (hsize_t)j * CHUNK_NY;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = CHUNK_NX; block[1] = CHUNK_NY;
+
+ /* Hyperslab selection equals single chunk */
+ if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ offset[0] = (hsize_t)i * CHUNK_NX; offset[1] = (hsize_t)j * CHUNK_NY;
+ /* Read the compressed chunk back using the direct read function. */
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, outbuf)) < 0)
+ goto error;
+
+ /* Check filter mask return value */
+ if(filter_mask != 0)
+ goto error;
+
+ /* Perform decompression from the source to the destination buffer */
+ ret = uncompress(z_dst, &z_dst_nbytes, z_src, z_src_nbytes);
+
+ /* Check for various zlib errors */
+ if(Z_BUF_ERROR == ret) {
+ HDfprintf(stderr, "overflow\n");
+ goto error;
+ } else if(Z_MEM_ERROR == ret) {
+ HDfprintf(stderr, "deflate memory error\n");
+ goto error;
+ } else if(Z_DATA_ERROR == ret) {
+ HDfprintf(stderr, "corrupted data\n");
+ goto error;
+ } else if(Z_OK != ret) {
+ HDfprintf(stderr, "other deflate error\n");
+ goto error;
+ }
+
+ /* Check that the decompressed values match those read from H5Dread */
+ for(k = 0; k < CHUNK_NX; k++) {
+ for(l = 0; l < CHUNK_NY; l++) {
+ if(direct_buf[k][l] != check_chunk[k][l]) {
+ HDprintf("\n 1. Read different values than written.");
+ HDprintf(" At index %d,%d\n", k, l);
+ HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
+ goto error;
+ }
+ }
+ }
+ }
+ }
+
+ /* Close/release resources. */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ H5Pclose(dapl);
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ H5Pclose(dapl);
+ } H5E_END_TRY;
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ H5_FAILED();
+ return 1;
+} /* test_direct_chunk_read_no_cache() */
+#endif /* H5_HAVE_FILTER_DEFLATE */
+
+#ifdef H5_HAVE_FILTER_DEFLATE
+static int
+test_direct_chunk_read_cache (hid_t file, hbool_t flush)
+{
+ 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 maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY};
+ herr_t status; /* status from H5 function calls */
+ int ret; /* deflate return status */
+ int data[NX][NY];
+ int i, j, k, l, n; /* local index variables */
+
+ unsigned filter_mask = 0; /* filter mask returned from H5Dread_chunk */
+ int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread and manually decompressed */
+ int check_chunk[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread */
+ hsize_t offset[2]; /* chunk offset used for H5Dread_chunk */
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+
+ Bytef *z_src = NULL; /* source buffer */
+ uLongf z_src_nbytes = (uLongf)DEFLATE_SIZE_ADJUST(buf_size);
+ Bytef *z_dst = (Bytef*)(direct_buf);
+ uLong z_dst_nbytes = (uLong)buf_size;
+ int aggression = 9; /* Compression aggression setting */
+ void *outbuf = NULL; /* Pointer to new buffer */
+ hsize_t read_buf_size = 0;
+
+ 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 */
+
+ if(flush) {
+ TESTING("basic functionality of H5Dread_chunk (flush chunk cache)");
+ } else {
+ TESTING("basic functionality of H5Dread_chunk (does not flush chunk cache)");
+ }
+
+ /* Create the data space with unlimited dimensions. */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /* Modify dataset creation properties, i.e. enable chunking and compression */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+ if((status = H5Pset_deflate( cparms, (unsigned) aggression)) < 0)
+ goto error;
+
+ /* Create a new dataset within the file using cparms creation properties. */
+ if((dataset = H5Dcreate2(file, flush?DATASETNAME9:DATASETNAME10, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ 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++;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+
+ /* Write the data for the dataset.
+ * It should stay in the chunk cache. */
+ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl, data)) < 0)
+ goto error;
+
+ if(flush) {
+ /* Flush the chunk cache to disk. Cache entry is not evicted. */
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+ }
+
+ /* Allocate output (compressed) buffer */
+ outbuf = HDmalloc(z_src_nbytes);
+ z_src = (Bytef *)outbuf;
+
+ /* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */
+ for(i=0; i<NX/CHUNK_NX; i++) {
+ for(j=0; j<NY/CHUNK_NY; j++) {
+ /* Select hyperslab for one chunk in the file */
+ start[0] = (hsize_t)i * CHUNK_NX; start[1] = (hsize_t)j * CHUNK_NY;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = CHUNK_NX; block[1] = CHUNK_NY;
+
+ /* Hyperslab selection equals single chunk */
+ if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ offset[0] = (hsize_t)i * CHUNK_NX; offset[1] = (hsize_t)j * CHUNK_NY;
+
+ /* Query chunk storage size */
+ if((status = H5Dget_chunk_storage_size(dataset, offset, &read_buf_size)) < 0)
+ 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;
+
+ /* Check filter mask return value */
+ if(filter_mask != 0)
+ goto error;
+
+ /* Perform decompression from the source to the destination buffer */
+ ret = uncompress(z_dst, &z_dst_nbytes, z_src, z_src_nbytes);
+
+ /* Check for various zlib errors */
+ if(Z_BUF_ERROR == ret) {
+ HDfprintf(stderr, "overflow\n");
+ goto error;
+ } else if(Z_MEM_ERROR == ret) {
+ HDfprintf(stderr, "deflate memory error\n");
+ goto error;
+ } else if(Z_DATA_ERROR == ret) {
+ HDfprintf(stderr, "corrupted data\n");
+ goto error;
+ } else if(Z_OK != ret) {
+ HDfprintf(stderr, "other deflate error\n");
+ goto error;
+ }
+
+ /* Check that the decompressed values match those read from H5Dread */
+ for(k = 0; k < CHUNK_NX; k++) {
+ for(l = 0; l < CHUNK_NY; l++) {
+ if(direct_buf[k][l] != check_chunk[k][l]) {
+ HDprintf("\n 1. Read different values than written.");
+ HDprintf(" At index %d,%d\n", k, l);
+ HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
+ goto error;
+ }
+ }
+ }
+ }
+ }
+
+ /* Close/release resources. */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ if(outbuf)
+ HDfree(outbuf);
+
+ H5_FAILED();
+ return 1;
+} /* test_direct_chunk_read_cache() */
+#endif /* H5_HAVE_FILTER_DEFLATE */
+
+/*-------------------------------------------------------------------------
+ * Function: test_read_unfiltered_dset
+ *
+ * Purpose: Test the basic functionality of H5Dread_chunk on a dataset
+ * without no filters applied.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Matthew Strong (GE Healthcare)
+ * 30 November 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_read_unfiltered_dset(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 maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] ={CHUNK_NX, CHUNK_NY};
+ herr_t status;
+ int data[NX][NY];
+ int i, j, k, l, n;
+
+ unsigned filter_mask = 0;
+ int direct_buf[CHUNK_NX][CHUNK_NY];
+ int check_chunk[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread */
+ hsize_t offset[2] = {0, 0};
+ size_t buf_size = CHUNK_NX*CHUNK_NY*sizeof(int);
+ hsize_t read_buf_size = 0;
+
+ 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 */
+
+ TESTING("basic functionality of H5Dread_chunk on unfiltered datasets");
+
+ /* Create the data space with unlimited dimensions. */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /* Modify dataset creation properties, i.e. enable chunking, no compression */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ /* Create a new dataset within the file using cparms creation properties. */
+ if((dataset = H5Dcreate2(file, DATASETNAME12, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ 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++;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+
+ /* Write the data for the dataset.
+ * It should stay in the chunk cache and will be evicted/flushed by
+ * the H5Dread_chunk function call. */
+ if((status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ dxpl, data)) < 0)
+ goto error;
+
+ if(H5Fflush(dataset, H5F_SCOPE_LOCAL) < 0)
+ goto error;
+
+ /* For each chunk in the dataset, compare the result of H5Dread and H5Dread_chunk. */
+ for(i=0; i<NX/CHUNK_NX; i++) {
+ for(j=0; j<NY/CHUNK_NY; j++) {
+ /* Select hyperslab for one chunk in the file */
+ start[0] = (hsize_t)i * CHUNK_NX; start[1] = (hsize_t)j * CHUNK_NY;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = CHUNK_NX; block[1] = CHUNK_NY;
+
+ /* Hyperslab selection equals single chunk */
+ if((status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block)) < 0)
+ goto error;
+
+ /* Read the chunk back */
+ if((status = H5Dread(dataset, H5T_NATIVE_INT, mem_space, dataspace, H5P_DEFAULT, check_chunk)) < 0)
+ goto error;
+
+ /* Query chunk storage size */
+ if((status = H5Dget_chunk_storage_size(dataset, offset, &read_buf_size)) < 0)
+ goto error;
+
+ if(read_buf_size != buf_size )
+ goto error;
+
+ offset[0] = (hsize_t)i * CHUNK_NX; offset[1] = (hsize_t)j * CHUNK_NY;
+ /* Read the raw chunk back */
+ HDmemset(&direct_buf, 0, sizeof(direct_buf));
+ filter_mask = UINT_MAX;
+ if((status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, direct_buf)) < 0)
+ goto error;
+
+ /* Check filter mask return value */
+ if(filter_mask != 0)
+ goto error;
+
+ /* Check that the decompressed values match those read from H5Dread */
+ for(k = 0; k < CHUNK_NX; k++) {
+ for(l = 0; l < CHUNK_NY; l++) {
+ if(direct_buf[k][l] != check_chunk[k][l]) {
+ HDprintf("\n 1. Read different values than written.");
+ HDprintf(" At index %d,%d\n", k, l);
+ HDprintf(" direct_buf=%d, check_chunk=%d\n", direct_buf[k][l], check_chunk[k][l]);
+ goto error;
+ }
+ }
+ }
+ }
+ }
+
+ /* Close/release resources. */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_read_unfiltered_dset() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_read_unallocated_chunk
+ *
+ * Purpose: Tests the H5Dread_chunk and H5Dget_chunk_storage_size with valid
+ * offets to chunks that have not been written to the dataset and are
+ * not allocated in the chunk storage on disk.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Matthew Strong (GE Healthcare)
+ * 30 November 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_read_unallocated_chunk (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 maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] = {CHUNK_NX, CHUNK_NY};
+ hsize_t chunk_nbytes = CHUNK_NX*CHUNK_NY*sizeof(int);
+ hsize_t direct_chunk_nbytes = 0; /* size (bytes) of the on-disk chunk */
+ herr_t status; /* status from H5 function calls */
+ hsize_t i, j; /* local index variables */
+
+ unsigned filter_mask = 0; /* filter mask returned from H5Dread_chunk */
+ int direct_buf[CHUNK_NX][CHUNK_NY]; /* chunk read with H5Dread and manually decompressed */
+ hsize_t offset[2]; /* chunk offset used for H5Dread_chunk */
+
+ TESTING("H5Dread_chunk with unallocated chunks");
+
+ /* Create the data space with unlimited dimensions. */
+ if((dataspace = H5Screate_simple(RANK, dims, maxdims)) < 0)
+ goto error;
+ if((mem_space = H5Screate_simple(RANK, chunk_dims, NULL)) < 0)
+ goto error;
+
+ /* Modify dataset creation properties, i.e. enable chunking, no compression */
+ if((cparms = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if((status = H5Pset_chunk( cparms, RANK, chunk_dims)) < 0)
+ goto error;
+
+ /* Create a new dataset within the file using cparms creation properties. */
+ if((dataset = H5Dcreate2(file, DATASETNAME11, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ goto error;
+
+ /* Write a single chunk to intialize the chunk storage */
+ HDmemset(direct_buf, 0, CHUNK_NX * CHUNK_NY * sizeof(int));
+ offset[0] = 0; offset[1] = 0;
+
+ if(H5Dwrite_chunk(dataset, dxpl, filter_mask, offset, chunk_nbytes, direct_buf) < 0)
+ goto error;
+
+ /* Attempt to read each chunk in the dataset. Chunks are not allocated,
+ * therefore we expect the result of H5Dread_chunk to fail. Chunk idx starts
+ * at 1, since one chunk was written to init the chunk storage. */
+ for(i=1; i<NX/CHUNK_NX; i++) {
+ for(j=0; j<NY/CHUNK_NY; j++) {
+
+ offset[0] = i * CHUNK_NX;
+ offset[1] = j * CHUNK_NY;
+
+ /* Read a non-existant chunk using the direct read function. */
+ H5E_BEGIN_TRY {
+ status = H5Dread_chunk(dataset, dxpl, offset, &filter_mask, &direct_buf);
+ } H5E_END_TRY;
+
+ /* Check that the chunk read call does not succeed. */
+ if(status != -1)
+ goto error;
+
+ /* Query the size of the non-existant chunk */
+ direct_chunk_nbytes = ULONG_MAX;
+ H5E_BEGIN_TRY {
+ status = H5Dget_chunk_storage_size(dataset, offset, &direct_chunk_nbytes);
+ } H5E_END_TRY;
+
+ /* Check that the chunk storage size call does not succeed. */
+ if(status != -1 )
+ goto error;
+ if(direct_chunk_nbytes != 0 )
+ goto error;
+
+ }
+ }
+
+ /* Close/release resources. */
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(mem_space);
+ H5Sclose(dataspace);
+ H5Pclose(cparms);
+ H5Pclose(dxpl);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_read_unallocated_chunk() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_single_chunk
+ *
+ * Purpose: This is to verify the fix for jira issue HDFFV-10425.
+ * The problem was due to a bug in the internal ilbrary routine
+ * H5D__chunk_direct_write() which passed a null dataset
+ * pointer to the insert callback for the chunk index type.
+ * Currently, the single chunk index is the only one that
+ * used the dataset pointer in the insert callback.
+ *
+ * This routine is based on the test program attached to
+ * 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.
+ * Verify that the data read is the same as the written data.
+ *
+ * Since expanded to test multiple combinations of cases
+ * involving a single chunk
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_single_chunk(unsigned config)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hsize_t dims[2] = {DIM0, DIM1}; /* Dimension sizes */
+ hsize_t chunk[2] = {CHUNK0, CHUNK1}; /* Chunk dimension sizes */
+ hsize_t offset[2] = {0,0}; /* Offset for writing */
+ uint32_t filters; /* Filter mask out */
+ int wdata[DIM0][DIM1]; /* Write buffer */
+ int rdata[DIM0][DIM1]; /* Read buffer */
+ int i, j; /* Local index variable */
+
+ TESTING("Single chunk I/O");
+
+ /* Initialize data */
+ for (i=0; i<DIM0; i++) {
+ for (j=0; j< DIM1; j++)
+ wdata[i][j] = j/CHUNK0;
+ }
+
+ /* Create a new file with the latest format */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+ if(config & CONFIG_LATEST)
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
+ if((fid = H5Fcreate(FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ goto error;
+
+ /* Create dataspace */
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
+
+ /* Create the dataset creation property list and set the chunk size */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk(dcpl, 2, chunk) < 0)
+ goto error;
+
+ /* Create the dataset */
+ if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if(config & CONFIG_DIRECT_WRITE) {
+ /* Write the data directly to the dataset */
+ if(H5Dwrite_chunk(did, H5P_DEFAULT, 0, offset, CHUNK0*CHUNK1*4, (void *)wdata) < 0)
+ goto error;
+ } /* end if */
+ else
+ /* Write the data to the dataset */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)wdata) < 0)
+ goto error;
+
+ /*
+ * Close and release resources.
+ */
+ if(H5Pclose(dcpl) < 0)
+ goto error;
+ if(config & CONFIG_REOPEN_DSET)
+ if(H5Dclose(did) < 0)
+ goto error;
+ if(H5Sclose(sid) < 0)
+ goto error;
+ if(H5Pclose(fapl) < 0)
+ goto error;
+ if(config & CONFIG_REOPEN_FILE)
+ if(H5Fclose(fid) < 0)
+ goto error;
+
+ /* Open the file and dataset with default properties */
+ if(config & CONFIG_REOPEN_FILE)
+ if((fid = H5Fopen(FILE, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ goto error;
+ if(config & CONFIG_REOPEN_DSET)
+ if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Retrieve dataset creation property list */
+ if((dcpl = H5Dget_create_plist(did)) < 0)
+ goto error;
+
+ if(config & CONFIG_DIRECT_READ) {
+ /* Read the data directly */
+ if(H5Dread_chunk(did, H5P_DEFAULT, offset, &filters, rdata) < 0)
+ goto error;
+
+ /* Verify returned filter mask */
+ if(filters != 0)
+ goto error;
+ } /* end if */
+ else
+ /* Read the data */
+ if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0)
+ goto error;
+
+ /* Verify that the data read was correct. */
+ for (i = 0; i < DIM0; i++) {
+ for (j = 0; j < DIM1; j++) {
+ if(rdata[i][j] != wdata[i][j])
+ goto error;
+ }
+ }
+
+ /*
+ * Close and release resources
+ */
+ if(H5Pclose(dcpl) < 0)
+ goto error;
+ if(H5Dclose(did) < 0)
+ goto error;
+ if(H5Fclose(fid) < 0)
+ goto error;
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(dcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+
+ H5_FAILED();
+ return 1;
+} /* test_single_chunk_latest() */
+
+/*-------------------------------------------------------------------------
+ * Function: Main function
+ *
+ * Purpose: Test direct chunk write function H5Dwrite_chunk and
+ * chunk direct read function H5Dread_chunk
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Raymond Lu
+ * 30 November 2012
+ *
+ *-------------------------------------------------------------------------
+ */
+int main( void )
+{
+ hid_t file_id;
+ unsigned config;
+ int nerrors=0;
+
+ /*
+ * Create a new file. If file exists its contents will be overwritten.
+ */
+ if((file_id = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ /* Test direct chunk write and direct chunk read */
+#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_skip_compress_write1(file_id);
+ nerrors += test_skip_compress_write2(file_id);
+ nerrors += test_data_conv(file_id);
+ nerrors += test_invalid_parameters(file_id);
+
+ /* Test direct chunk read */
+#ifdef H5_HAVE_FILTER_DEFLATE
+ nerrors += test_direct_chunk_read_no_cache(file_id);
+ nerrors += test_direct_chunk_read_cache(file_id, TRUE);
+ nerrors += test_direct_chunk_read_cache(file_id, FALSE);
+#endif /* H5_HAVE_FILTER_DEFLATE */
+ nerrors += test_read_unfiltered_dset(file_id);
+ nerrors += test_read_unallocated_chunk(file_id);
+
+ /* Loop over test configurations */
+ for(config = 0; config < CONFIG_END; config++) {
+ hbool_t need_comma = FALSE;
+
+ /* Check for invalid combinations */
+ if((config & CONFIG_REOPEN_FILE) && !(config & CONFIG_REOPEN_DSET))
+ continue;
+
+ /* Print configuration */
+ HDprintf("Configuration: ");
+ if(config == 0)
+ HDprintf("<empty>");
+ if(config & CONFIG_LATEST) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("latest format");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_REOPEN_FILE) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("reopen file");
+ need_comma = TRUE;
+ } /* end if */
+ else if(config & CONFIG_REOPEN_DSET) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("reopen dataset");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_DIRECT_WRITE) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("direct write");
+ need_comma = TRUE;
+ } /* end if */
+ if(config & CONFIG_DIRECT_READ) {
+ if(need_comma)
+ HDprintf(", ");
+ HDprintf("direct read");
+ need_comma = TRUE;
+ } /* end if */
+ HDprintf(":\n");
+ fflush(stdout);
+
+ nerrors += test_single_chunk(config);
+ } /* end for */
+
+ if(H5Fclose(file_id) < 0)
+ goto error;
+
+ /* check for errors */
+ if (nerrors)
+ goto error;
+
+ HDputs("All direct chunk read/write tests passed.");
+ return EXIT_SUCCESS;
+
+error:
+ HDputs("*** TESTS FAILED ***");
+ return EXIT_FAILURE;
+}
+
diff --git a/test/dsets.c b/test/dsets.c
index 0ca08e4..4ab3efa 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -12,20 +12,42 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Robb Matzke <matzke@llnl.gov>
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke <matzke@llnl.gov>
+ * Tuesday, December 9, 1997
*
- * Purpose: Tests the dataset interface (H5D)
+ * Purpose: Tests the dataset interface (H5D)
*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
-#define H5FD_FRIEND /*suppress error about including H5FDpkg */
+#define H5FD_FRIEND /*suppress error about including H5FDpkg */
#define H5FD_TESTING
-#define H5Z_FRIEND /*suppress error about including H5Zpkg */
+#define H5Z_FRIEND /*suppress error about including H5Zpkg */
-#include "h5test.h"
+#include "testhdf5.h"
#include "H5srcdir.h"
+
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h"
+#include "H5Pprivate.h"
+
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+#include "H5Spkg.h" /* Dataspace */
+
+#define H5T_FRIEND /*suppress error about including H5Tpkg */
+#include "H5Tpkg.h" /* Datatype */
+
+#define H5A_FRIEND /*suppress error about including H5Apkg */
+#include "H5Apkg.h" /* Attributes */
+
+/* Use in version bound test */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#include "H5Opkg.h" /* Object headers */
+
#include "H5Dpkg.h"
#include "H5FDpkg.h"
#include "H5VMprivate.h"
@@ -35,72 +57,77 @@
#endif
const char *FILENAME[] = {
- "dataset", /* 0 */
- "compact_dataset", /* 1 */
- "dset_offset", /* 2 */
- "max_compact_dataset", /* 3 */
- "simple", /* 4 */
- "set_local", /* 5 */
- "random_chunks", /* 6 */
- "huge_chunks", /* 7 */
- "chunk_cache", /* 8 */
- "big_chunk", /* 9 */
- "chunk_fast", /* 10 */
- "chunk_expand", /* 11 */
- "chunk_fixed", /* 12 */
+ "dataset", /* 0 */
+ "compact_dataset", /* 1 */
+ "dset_offset", /* 2 */
+ "max_compact_dataset", /* 3 */
+ "simple", /* 4 */
+ "set_local", /* 5 */
+ "random_chunks", /* 6 */
+ "huge_chunks", /* 7 */
+ "chunk_cache", /* 8 */
+ "big_chunk", /* 9 */
+ "chunk_fast", /* 10 */
+ "chunk_expand", /* 11 */
+ "chunk_fixed", /* 12 */
"copy_dcpl_newfile",/* 13 */
"partial_chunks", /* 14 */
"layout_extend", /* 15 */
- "zero_chunk", /* 16 */
+ "zero_chunk", /* 16 */
"chunk_single", /* 17 */
"swmr_non_latest", /* 18 */
"earray_hdr_fd", /* 19 */
"farray_hdr_fd", /* 20 */
"bt2_hdr_fd", /* 21 */
- "storage_size", /* 22 */
+ "storage_size", /* 22 */
"dls_01_strings", /* 23 */
"power2up", /* 24 */
+ "version_bounds", /* 25 */
+ "alloc_0sized", /* 26 */
NULL
};
+
+#define OHMIN_FILENAME_A "ohdr_min_a"
+
#define FILENAME_BUF_SIZE 1024
#define KB 1024
#define FILE_DEFLATE_NAME "deflate.h5"
/* Dataset names for testing filters */
-#define DSET_DEFAULT_NAME "default"
-#define DSET_CHUNKED_NAME "chunked"
-#define DSET_COMPACT_NAME "compact"
-#define DSET_SIMPLE_IO_NAME "simple_io"
-#define DSET_USERBLOCK_IO_NAME "userblock_io"
-#define DSET_COMPACT_IO_NAME "compact_io"
-#define DSET_COMPACT_MAX_NAME "max_compact"
-#define DSET_COMPACT_MAX2_NAME "max_compact_2"
-#define DSET_CONV_BUF_NAME "conv_buf"
-#define DSET_TCONV_NAME "tconv"
-#define DSET_DEFLATE_NAME "deflate"
-#define DSET_SHUFFLE_NAME "shuffle"
-#define DSET_FLETCHER32_NAME "fletcher32"
-#define DSET_FLETCHER32_NAME_2 "fletcher32_2"
-#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
-#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32"
-#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2"
+#define DSET_DEFAULT_NAME "default"
+#define DSET_CHUNKED_NAME "chunked"
+#define DSET_COMPACT_NAME "compact"
+#define DSET_SIMPLE_IO_NAME "simple_io"
+#define DSET_USERBLOCK_IO_NAME "userblock_io"
+#define DSET_COMPACT_IO_NAME "compact_io"
+#define DSET_COMPACT_MAX_NAME "max_compact"
+#define DSET_COMPACT_MAX2_NAME "max_compact_2"
+#define DSET_CONV_BUF_NAME "conv_buf"
+#define DSET_TCONV_NAME "tconv"
+#define DSET_DEFLATE_NAME "deflate"
+#define DSET_SHUFFLE_NAME "shuffle"
+#define DSET_FLETCHER32_NAME "fletcher32"
+#define DSET_FLETCHER32_NAME_2 "fletcher32_2"
+#define DSET_FLETCHER32_NAME_3 "fletcher32_3"
+#define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32"
+#define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2"
#ifdef H5_HAVE_FILTER_SZIP
-#define DSET_SZIP_NAME "szip"
-#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32"
-#define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2"
+#define DSET_SZIP_NAME "szip"
+#define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32"
+#define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2"
#endif /* H5_HAVE_FILTER_SZIP */
-#define DSET_BOGUS_NAME "bogus"
-#define DSET_MISSING_NAME "missing"
-#define DSET_CAN_APPLY_NAME "can_apply"
-#define DSET_CAN_APPLY_NAME2 "can_apply2"
+#define DSET_BOGUS_NAME "bogus"
+#define DSET_MISSING_NAME "missing"
+#define DSET_CAN_APPLY_NAME "can_apply"
+#define DSET_CAN_APPLY_NAME2 "can_apply2"
#ifdef H5_HAVE_FILTER_SZIP
-#define DSET_CAN_APPLY_SZIP_NAME "can_apply_szip"
+#define DSET_CAN_APPLY_SZIP_NAME "can_apply_szip"
#endif /* H5_HAVE_FILTER_SZIP */
-#define DSET_SET_LOCAL_NAME "set_local"
-#define DSET_SET_LOCAL_NAME_2 "set_local_2"
-#define DSET_ONEBYTE_SHUF_NAME "onebyte_shuffle"
+#define DSET_SET_LOCAL_NAME "set_local"
+#define DSET_SET_LOCAL_NAME_2 "set_local_2"
+#define DSET_ONEBYTE_SHUF_NAME "onebyte_shuffle"
#define DSET_NBIT_INT_NAME "nbit_int"
#define DSET_NBIT_FLOAT_NAME "nbit_float"
#define DSET_NBIT_DOUBLE_NAME "nbit_double"
@@ -116,27 +143,29 @@ const char *FILENAME[] = {
#define DSET_SCALEOFFSET_FLOAT_NAME_2 "scaleoffset_float_2"
#define DSET_SCALEOFFSET_DOUBLE_NAME "scaleoffset_double"
#define DSET_SCALEOFFSET_DOUBLE_NAME_2 "scaleoffset_double_2"
-#define DSET_COMPARE_DCPL_NAME "compare_dcpl"
-#define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2"
-#define DSET_COPY_DCPL_NAME_1 "copy_dcpl_1"
-#define DSET_COPY_DCPL_NAME_2 "copy_dcpl_2"
-#define COPY_DCPL_EXTFILE_NAME "ext_file"
-#define DSET_DEPREC_NAME "deprecated"
-#define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked"
-#define DSET_DEPREC_NAME_COMPACT "deprecated_compact"
-#define DSET_DEPREC_NAME_FILTER "deprecated_filter"
+#define DSET_COMPARE_DCPL_NAME "compare_dcpl"
+#define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2"
+#define DSET_COPY_DCPL_NAME_1 "copy_dcpl_1"
+#define DSET_COPY_DCPL_NAME_2 "copy_dcpl_2"
+#define COPY_DCPL_EXTFILE_NAME "ext_file"
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+#define DSET_DEPREC_NAME "deprecated"
+#define DSET_DEPREC_NAME_CHUNKED "deprecated_chunked"
+#define DSET_DEPREC_NAME_COMPACT "deprecated_compact"
+#define DSET_DEPREC_NAME_FILTER "deprecated_filter"
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Dataset names for testing Fixed Array Indexing */
-#define DSET_FIXED_MAX "DSET_FIXED_MAX"
-#define DSET_FIXED_NOMAX "DSET_FIXED_NOMAX"
-#define DSET_FIXED_BIG "DSET_FIXED_BIG"
-#define POINTS 72
-#define POINTS_BIG 2500
+#define DSET_FIXED_MAX "DSET_FIXED_MAX"
+#define DSET_FIXED_NOMAX "DSET_FIXED_NOMAX"
+#define DSET_FIXED_BIG "DSET_FIXED_BIG"
+#define POINTS 72
+#define POINTS_BIG 2500
/* Dataset names used for testing header flush dependencies */
#define DSET_EARRAY_HDR_FD "earray_hdr_fd"
#define DSET_FARRAY_HDR_FD "farray_hdr_fd"
-#define DSET_BT2_HDR_FD "bt2_hdr_fd"
+#define DSET_BT2_HDR_FD "bt2_hdr_fd"
/* Dataset names for testing Implicit Indexing */
#define DSET_SINGLE_MAX "DSET_SINGLE_MAX"
@@ -146,14 +175,16 @@ const char *FILENAME[] = {
#define SIXTY_FOUR_KB 65536
/* Temporary filter IDs used for testing */
-#define H5Z_FILTER_BOGUS 305
-#define H5Z_FILTER_CORRUPT 306
-#define H5Z_FILTER_CAN_APPLY_TEST 307
-#define H5Z_FILTER_SET_LOCAL_TEST 308
-#define H5Z_FILTER_DEPREC 309
-#define H5Z_FILTER_EXPAND 310
-#define H5Z_FILTER_CAN_APPLY_TEST2 311
-#define H5Z_FILTER_COUNT 312
+#define H5Z_FILTER_BOGUS 305
+#define H5Z_FILTER_CORRUPT 306
+#define H5Z_FILTER_CAN_APPLY_TEST 307
+#define H5Z_FILTER_SET_LOCAL_TEST 308
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+#define H5Z_FILTER_DEPREC 309
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+#define H5Z_FILTER_EXPAND 310
+#define H5Z_FILTER_CAN_APPLY_TEST2 311
+#define H5Z_FILTER_COUNT 312
/* Flags for testing filters */
#define DISABLE_FLETCHER32 0
@@ -182,15 +213,15 @@ const char *FILENAME[] = {
/* Names for noencoder test */
#ifdef H5_HAVE_FILTER_SZIP
-#define NOENCODER_FILENAME "noencoder.h5"
+#define NOENCODER_FILENAME "noencoder.h5"
#define NOENCODER_COPY_FILENAME "noencoder.h5.copy"
-#define NOENCODER_TEST_DATASET "noencoder_tdset.h5"
-#define NOENCODER_SZIP_DATASET "noencoder_szip_dset.h5"
+#define NOENCODER_TEST_DATASET "noencoder_tdset.h5"
+#define NOENCODER_SZIP_DATASET "noencoder_szip_dset.h5"
#define NOENCODER_SZIP_SHUFF_FLETCH_DATASET "noencoder_szip_shuffle_fletcher_dset.h5"
#endif /* H5_HAVE_FILTER_SZIP */
/* Names for zero-dim test */
-#define ZERODIM_DATASET "zerodim"
+#define ZERODIM_DATASET "zerodim"
#define ZERODIM_DATASET2 "zerodim2"
/* Parameters for zero-dim test */
@@ -221,8 +252,8 @@ const char *FILENAME[] = {
#define BYPASS_DATASET1 "Dset1"
#define BYPASS_DATASET2 "Dset2"
-#define T_BYPASS_DATASET1 "T_Dset1"
-#define T_BYPASS_DATASET2 "T_Dset2"
+#define T_BYPASS_DATASET1 "T_Dset1"
+#define T_BYPASS_DATASET2 "T_Dset2"
#define BYPASS_DIM 1000
#define BYPASS_CHUNK_DIM 500
@@ -234,7 +265,7 @@ const char *FILENAME[] = {
#define EARRAY_CHUNK_DIM 3
#define EARRAY_EXTEND_INCR 15
#define EARRAY_MAX_EXTEND 75
-
+
/* Parameters for datasets in query storage size tests */
#define STORAGE_SIZE_DIM1 12
#define STORAGE_SIZE_DIM2 6
@@ -246,10 +277,16 @@ const char *FILENAME[] = {
/* Shared global arrays */
#define DSET_DIM1 100
#define DSET_DIM2 200
-int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2];
-double points_dbl[DSET_DIM1][DSET_DIM2], check_dbl[DSET_DIM1][DSET_DIM2];
-size_t count_nbytes_read = 0;
-size_t count_nbytes_written = 0;
+int **points = NULL;
+int *points_data = NULL;
+double **points_dbl = NULL;
+double *points_dbl_data = NULL;
+int **check = NULL;
+int *check_data = NULL;
+double **check_dbl = NULL;
+double *check_dbl_data = NULL;
+size_t count_nbytes_read = 0;
+size_t count_nbytes_written = 0;
/* Temporary buffer dimensions */
#define DSET_TMP_DIM1 50
@@ -266,32 +303,32 @@ const char *OLD_FILENAME[] = { /* Files created under 1.6 branch and 1.8 branch
/* Local prototypes for filter functions */
static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
static htri_t can_apply_bogus(hid_t dcpl_id, hid_t type_id, hid_t space_id);
static herr_t set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t space_id);
static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
static size_t filter_bogus3(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
static size_t filter_corrupt(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
static size_t filter_expand(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
static size_t filter_count(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
/* This message derives from H5Z */
const H5Z_class2_t H5Z_COUNT[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_COUNT, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "count", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- filter_count, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_COUNT, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "count", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ filter_count, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: filter_count
*
@@ -300,12 +337,7 @@ const H5Z_class2_t H5Z_COUNT[1] = {{
* appropriate.
*
* Return: Success: Data chunk size
- *
* Failure: 0
- *
- * Programmer: Neil Fortner
- * Wednesday, March 17, 2010
- *
*-------------------------------------------------------------------------
*/
static size_t
@@ -319,30 +351,25 @@ filter_count(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
count_nbytes_written += nbytes;
return nbytes;
-}
+} /* end filter_count() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_create
- *
- * Purpose: Attempts to create a dataset.
+ * Function: test_create
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Purpose: Attempts to create a dataset.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_create(hid_t file)
{
- hid_t dataset, space, small_space, create_parms;
- hsize_t dims[2], small_dims[2];
- herr_t status;
- hsize_t csize[2];
+ hid_t dataset, space, small_space, create_parms;
+ hsize_t dims[2], small_dims[2];
+ herr_t status;
+ hsize_t csize[2];
TESTING("create, open, close");
@@ -359,11 +386,11 @@ test_create(hid_t file)
assert(space>=0);
/*
- * Create a dataset using the default dataset creation properties. We're
+ * Create a dataset using the default dataset creation properties. We're
* not sure what they are, so we won't check.
*/
dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dataset < 0) goto error;
/* Close the dataset */
@@ -379,13 +406,13 @@ test_create(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
- H5_FAILED();
- puts(" Library allowed overwrite of existing dataset.");
- goto error;
+ H5_FAILED();
+ HDputs(" Library allowed overwrite of existing dataset.");
+ goto error;
}
/*
@@ -402,12 +429,12 @@ test_create(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT);
+ dataset = H5Dopen2(file, "does_not_exist", H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
- H5_FAILED();
- puts(" Opened a non-existent dataset.");
- goto error;
+ H5_FAILED();
+ HDputs(" Opened a non-existent dataset.");
+ goto error;
}
/*
@@ -424,12 +451,12 @@ test_create(hid_t file)
assert(status >= 0);
H5E_BEGIN_TRY {
dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT, create_parms, H5P_DEFAULT);
+ H5P_DEFAULT, create_parms, H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
- H5_FAILED();
- puts(" Opened a dataset with incorrect chunking parameters.");
- goto error;
+ H5_FAILED();
+ HDputs(" Opened a dataset with incorrect chunking parameters.");
+ goto error;
}
csize[0] = 5;
@@ -438,7 +465,7 @@ test_create(hid_t file)
assert(status >= 0);
dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT, create_parms, H5P_DEFAULT);
+ H5P_DEFAULT, create_parms, H5P_DEFAULT);
if(dataset < 0) goto error;
H5Pclose(create_parms);
@@ -467,27 +494,22 @@ test_create(hid_t file)
if(H5Dclose(dataset) < 0) goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_create() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_simple_io
- *
- * Purpose: Tests simple I/O. That is, reading and writing a complete
- * multi-dimensional array without data type or data space
- * conversions, without compression, and stored contiguously.
+ * Function: test_simple_io
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, December 10, 1997
+ * Purpose: Tests simple I/O. That is, reading and writing a complete
+ * multi-dimensional array without data type or data space
+ * conversions, without compression, and stored contiguously.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
@@ -500,7 +522,8 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
void *tconv_buf = NULL;
int f = -1;
haddr_t offset;
- int rdata[DSET_DIM1][DSET_DIM2];
+ int **rdata = NULL;
+ int *rdata_bytes = NULL;
TESTING("simple I/O");
@@ -508,6 +531,14 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
+ /* Set up data array */
+ if(NULL == (rdata_bytes = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (rdata = (int **)HDcalloc(DSET_DIM1, sizeof(rdata_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ rdata[i] = rdata_bytes + (i * DSET_DIM2);
+
/* Initialize the dataset */
for(i = n = 0; i < DSET_DIM1; i++)
for(j = 0; j < DSET_DIM2; j++)
@@ -537,7 +568,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
if(H5Dget_offset(dataset) != HADDR_UNDEF) goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points_data) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
@@ -546,7 +577,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
/* Read the dataset back */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -554,8 +585,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;
}
}
@@ -570,7 +601,7 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
f = HDopen(filename, O_RDONLY);
HDlseek(f, (off_t)offset, SEEK_SET);
- if(HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2) < 0)
+ if(HDread(f, rdata_bytes, sizeof(int)*DSET_DIM1*DSET_DIM2) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -578,8 +609,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;
}
}
@@ -589,14 +620,17 @@ test_simple_io(const char *env_h5_drvr, hid_t fapl)
f = -1;
HDfree(tconv_buf);
+ HDfree(rdata_bytes);
+ HDfree(rdata);
+
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;
+ return SUCCEED;
error:
if(space > 0)
@@ -609,36 +643,35 @@ error:
if(H5Fclose(file) < 0) TEST_ERROR
if(f > 0)
HDclose(f);
- if(tconv_buf)
- HDfree(tconv_buf);
- return -1;
-}
-
+ HDfree(tconv_buf);
+ HDfree(rdata_bytes);
+ HDfree(rdata);
+
+ return FAIL;
+} /* end test_simple_io() */
+
+
/*-------------------------------------------------------------------------
- * Function: test_userblock_offset
- *
- * Purpose: Tests H5Dget_offset when user block exists.
+ * Function: test_userblock_offset
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * Wednesday, November 27, 2002
+ * Purpose: Tests H5Dget_offset when user block exists.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
{
char filename[FILENAME_BUF_SIZE];
- hid_t file = -1, fcpl = -1, dataset = -1, space = -1;
- int i, j;
- hsize_t dims[2];
+ hid_t file = -1, fcpl = -1, dataset = -1, space = -1;
+ int i, j;
+ hsize_t dims[2];
int f = -1;
haddr_t offset;
- int rdata[DSET_DIM1][DSET_DIM2];
+ int **rdata = NULL;
+ int *rdata_bytes = NULL;
TESTING("dataset offset with user block");
@@ -646,11 +679,19 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
+ /* Set up data array */
+ if(NULL == (rdata_bytes = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (rdata = (int **)HDcalloc(DSET_DIM1, sizeof(rdata_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ rdata[i] = rdata_bytes + (i * DSET_DIM2);
+
if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error;
if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error;
- if(new_format)
- if(H5Pset_file_space_page_size(fcpl, (hsize_t)USER_BLOCK) < 0)
- goto error;
+ if(new_format)
+ if(H5Pset_file_space_page_size(fcpl, (hsize_t)USER_BLOCK) < 0)
+ goto error;
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
goto error;
@@ -669,7 +710,7 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
space = -1;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_data) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
@@ -684,7 +725,7 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
f = HDopen(filename, O_RDONLY);
HDlseek(f, (off_t)offset, SEEK_SET);
- if(HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2) < 0)
+ if(HDread(f, rdata_bytes, sizeof(int)*DSET_DIM1*DSET_DIM2) < 0)
goto error;
/* Check that the values read are the same as the values written */
@@ -692,8 +733,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;
}
}
@@ -702,14 +743,17 @@ test_userblock_offset(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
HDclose(f);
f = -1;
+ HDfree(rdata_bytes);
+ HDfree(rdata);
+
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;
+ return SUCCEED;
error:
if(space > 0)
@@ -722,10 +766,14 @@ error:
if(H5Fclose(file) < 0) TEST_ERROR
if(f > 0)
HDclose(f);
- return -1;
-}
-
+ HDfree(rdata_bytes);
+ HDfree(rdata);
+
+ return FAIL;
+} /* end test_userblock_offset() */
+
+
/*-------------------------------------------------------------------------
* Function: test_compact_io
*
@@ -735,22 +783,22 @@ error:
* compact dataset.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Raymond Lu
- * August 8, 2002
- *
*-------------------------------------------------------------------------
*/
static herr_t
test_compact_io(hid_t fapl)
{
hid_t file, dataset, space, plist;
+ hid_t verfile = -1, new_fapl = -1;
hsize_t dims[2];
int wbuf[16][8], rbuf[16][8];
- char filename[FILENAME_BUF_SIZE];
- int i, j, n;
+ char filename[FILENAME_BUF_SIZE];
+ H5F_libver_t low, high; /* File format bounds */
+ H5F_t *fp; /* Internal file pointer */
+ H5D_t *dsetp; /* Internal dataset pointer */
+ int i, j, n; /* Indices */
+ herr_t ret; /* Generic return value */
TESTING("compact dataset I/O");
@@ -789,8 +837,6 @@ test_compact_io(hid_t fapl)
if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
/* Close file */
- if(H5Sclose(space) < 0) TEST_ERROR
- if(H5Pclose(plist) < 0) TEST_ERROR
if(H5Dclose(dataset) < 0) TEST_ERROR
if(H5Fclose(file) < 0) TEST_ERROR
@@ -809,24 +855,118 @@ 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 if */
+ } /* end */
if(H5Dclose(dataset) < 0) TEST_ERROR
if(H5Fclose(file) < 0) TEST_ERROR
- PASSED();
- return 0;
+ /**************************************
+ * Additional test for version bounds *
+ **************************************/
+
+ /* Create a copy of file access property list */
+ if((new_fapl = h5_fileaccess()) < 0) TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combinations.
+ - Create a file, create and write a compact dataset, and verify its data
+ - Verify the dataset's layout and fill message versions */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a file */
+ h5_fixname(FILENAME[25], new_fapl, filename, sizeof filename);
+ if((verfile = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl)) < 0)
+ TEST_ERROR
+
+ /* Create the compact dataset */
+ dataset = H5Dcreate2(verfile, DSET_DEFAULT_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT);
+ if(dataset < 0) TEST_ERROR
+
+ /* Write the same data as of DSET_COMPACT_IO_NAME */
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
+ TEST_ERROR
+
+ /* Close DSET_DEFAULT_NAME, then reopen it to read and verify
+ the data */
+ if(H5Dclose(dataset) < 0) TEST_ERROR
+ if((dataset = H5Dopen2(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ TEST_ERROR
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < 16; i++)
+ for(j = 0; j < 8; j++)
+ if(rbuf[i][j] != wbuf[i][j]) {
+ H5_FAILED();
+ 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 */
+
+ /* Get the internal file pointer */
+ if((fp = (H5F_t *)H5VL_object(verfile)) == NULL) TEST_ERROR
+
+ /* Get the internal dataset pointer */
+ if((dsetp = (H5D_t *)H5VL_object(dataset)) == NULL) TEST_ERROR
+
+ /* Verify the dataset's layout and fill message versions */
+ if(fp->shared->low_bound == H5F_LIBVER_EARLIEST) {
+ VERIFY(dsetp->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "layout_ver_bounds");
+ VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "fill_ver_bounds");
+ } else {
+ VERIFY(dsetp->shared->layout.version, H5O_layout_ver_bounds[fp->shared->low_bound], "layout_ver_bounds");
+ VERIFY(dsetp->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[fp->shared->low_bound], "fill_ver_bounds");
+ }
+
+ /* Close the dataset and delete from the file */
+ if(H5Dclose(dataset) < 0) TEST_ERROR
+ if(H5Ldelete(verfile, DSET_DEFAULT_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(verfile) < 0) TEST_ERROR
+
+ } /* end for high */
+ } /* end for low */
+
+ if(H5Pclose(new_fapl) < 0) TEST_ERROR
+ if(H5Sclose(space) < 0) TEST_ERROR
+ if(H5Pclose(plist) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
error:
- return -1;
-}
+ H5E_BEGIN_TRY {
+ H5Sclose(space);
+ H5Pclose(plist);
+ H5Pclose(new_fapl);
+ H5Dclose(dataset);
+ H5Fclose(file);
+ H5Fclose(verfile);
+ } H5E_END_TRY;
+
+ return FAIL;
+} /* end test_compact_io() */
+
-
/*-------------------------------------------------------------------------
* Function: test_max_compact
*
@@ -834,10 +974,6 @@ test_compact_io(hid_t fapl)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Raymond Lu
- * August 8, 2002
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -851,7 +987,7 @@ test_max_compact(hid_t fapl)
size_t compact_size;
int *wbuf = NULL;
int *rbuf = NULL;
- char filename[FILENAME_BUF_SIZE];
+ char filename[FILENAME_BUF_SIZE];
int n;
size_t u;
@@ -918,8 +1054,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 */
@@ -964,7 +1100,7 @@ test_max_compact(hid_t fapl)
FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
if(wbuf)
@@ -980,39 +1116,36 @@ error:
H5Fclose(file);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_max_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: test_layout_extend
*
* Purpose: Verify that the creation of extendible dataset with dataspace:
- * cur_dims < max_dims (max_dims can be fixed size or H5S_UNLIMITED)
- * will behave as follows:
- * H5D_COMPACT layout: fail
- * H5D_CONTIGUOUS layout: fail
- * H5D_CHUNKED layout: succeed
+ * cur_dims < max_dims (max_dims can be fixed size or H5S_UNLIMITED)
+ * will behave as follows:
+ * H5D_COMPACT layout: fail
+ * H5D_CONTIGUOUS layout: fail
+ * H5D_CHUNKED layout: succeed
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Vailin Choi; August 2010
- *
*-------------------------------------------------------------------------
*/
static herr_t
test_layout_extend(hid_t fapl)
{
- char filename[FILENAME_BUF_SIZE]; /* File name */
- hid_t fid = -1; /* File id */
- hid_t sid_fix = -1, sid_unlim = -1; /* Dataspace id */
+ char filename[FILENAME_BUF_SIZE]; /* File name */
+ hid_t fid = -1; /* File id */
+ hid_t sid_fix = -1, sid_unlim = -1; /* Dataspace id */
hid_t dcpl_compact = -1, dcpl_contig = -1, dcpl_chunked = -1; /* Dataset creation property list id */
- hid_t did_fixed = -1, did_unlim = -1; /* Dataset id */
- hsize_t cur_size[1] = {10}; /* Current size of dataspace */
- hsize_t max_unlim[1] = {H5S_UNLIMITED}; /* Maximum size of dataspace (unlimited) */
- hsize_t max_fix[1] = {100}; /* Maximum size of dataspace (fixed) */
- hsize_t chunk_dim[1] = {10}; /* Chunk size */
+ hid_t did_fixed = -1, did_unlim = -1; /* Dataset id */
+ hsize_t cur_size[1] = {10}; /* Current size of dataspace */
+ hsize_t max_unlim[1] = {H5S_UNLIMITED}; /* Maximum size of dataspace (unlimited) */
+ hsize_t max_fix[1] = {100}; /* Maximum size of dataspace (fixed) */
+ hsize_t chunk_dim[1] = {10}; /* Chunk size */
TESTING("extendible dataset with various layout");
@@ -1035,14 +1168,14 @@ test_layout_extend(hid_t fapl)
/* Create dataset with extendible dataspace (fixed max_dims) should fail */
H5E_BEGIN_TRY {
- if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL)
- TEST_ERROR
+ if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL)
+ TEST_ERROR
} H5E_END_TRY;
/* Create dataset with extendible dataspace (unlimited max_dims) should fail */
H5E_BEGIN_TRY {
- if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL)
- TEST_ERROR
+ if(H5Dcreate2(fid, "compact", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT) != FAIL)
+ TEST_ERROR
} H5E_END_TRY;
/* Create property list for contiguous dataset creation */
@@ -1053,14 +1186,14 @@ test_layout_extend(hid_t fapl)
/* Create dataset with extendible dataspace (fixed max_dims) should fail */
H5E_BEGIN_TRY {
- if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL)
- TEST_ERROR
+ if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL)
+ TEST_ERROR
} H5E_END_TRY;
/* Create dataset with extendible dataspace (unlimited max_dims) should fail*/
H5E_BEGIN_TRY {
- if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL)
- TEST_ERROR
+ if(H5Dcreate2(fid, "contig", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT) != FAIL)
+ TEST_ERROR
} H5E_END_TRY;
/* Create property list for chunked dataset creation */
@@ -1072,11 +1205,11 @@ test_layout_extend(hid_t fapl)
/* Create dataset with extendible dataspace (fixed max_dims) should succeed */
if((did_fixed = H5Dcreate2(fid, "chunked_fixed", H5T_NATIVE_INT, sid_fix, H5P_DEFAULT, dcpl_chunked, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Create dataset with extendible dataspace (unlimited max_dims) should succeed */
if((did_unlim = H5Dcreate2(fid, "chunked_unlim", H5T_NATIVE_INT, sid_unlim, H5P_DEFAULT, dcpl_chunked, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Closing */
if(H5Sclose(sid_fix) < 0) FAIL_STACK_ERROR
@@ -1092,7 +1225,7 @@ test_layout_extend(hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1106,22 +1239,17 @@ error:
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_layout_extend() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_conv_buffer
- *
- * Purpose: Test size of data type conversion buffer.
- *
- * Return: Success: 0
+ * Function: test_conv_buffer
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * Monday, May 12, 2003
+ * Purpose: Test size of data type conversion buffer.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1146,14 +1274,19 @@ test_conv_buffer(hid_t fid)
CmpField *cf = NULL;
CmpFieldR *cfrR = NULL;
- hid_t dataset = -1; /* dataset ID */
- hid_t space = -1; /* data space ID */
- hid_t ctype1, ctype2; /* data type ID */
- hid_t arr_type1, arr_type2, arr_type3, arr_type4, arr_type5;
+ hid_t dataset = H5I_INVALID_HID; /* dataset ID */
+ hid_t space = H5I_INVALID_HID; /* data space ID */
+ hid_t ctype1 = H5I_INVALID_HID,
+ ctype2 = H5I_INVALID_HID; /* data type ID */
+ hid_t arr_type1 = H5I_INVALID_HID,
+ arr_type2 = H5I_INVALID_HID,
+ arr_type3 = H5I_INVALID_HID,
+ arr_type4 = H5I_INVALID_HID,
+ arr_type5 = H5I_INVALID_HID;
hsize_t dimsa[3];
hsize_t dimsb[1];
hsize_t dimsc[1];
- hid_t xfer_list;
+ hid_t xfer_list = H5I_INVALID_HID;
size_t size;
TESTING("data type conversion buffer size");
@@ -1221,7 +1354,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;
}
@@ -1246,35 +1379,43 @@ test_conv_buffer(hid_t fid)
HDfree(cf);
HDfree(cfrR);
- puts(" PASSED");
- return 0;
+ HDputs(" PASSED");
+ return SUCCEED;
error:
- return -1;
-}
+ H5E_BEGIN_TRY {
+ H5Pclose(xfer_list);
+ H5Sclose(space);
+ H5Tclose(arr_type1);
+ H5Tclose(arr_type2);
+ H5Tclose(arr_type3);
+ H5Tclose(ctype1);
+ H5Tclose(ctype2);
+ H5Tclose(arr_type4);
+ H5Tclose(arr_type5);
+ H5Dclose(dataset);
+ } H5E_END_TRY;
+
+ return FAIL;
+} /* end test_conv_buffer() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_tconv
- *
- * Purpose: Test some simple data type conversion stuff.
- *
- * Return: Success: 0
+ * Function: test_tconv
*
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, January 14, 1998
+ * Purpose: Test some simple data type conversion stuff.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_tconv(hid_t file)
{
- char *out = NULL, *in = NULL;
- hsize_t dims[1];
- hid_t space = -1, dataset = -1;
- int i;
+ char *out = NULL, *in = NULL;
+ hsize_t dims[1];
+ hid_t space = -1, dataset = -1;
+ int i;
if ((out = (char *)HDmalloc((size_t)(4 * 1000 * 1000))) == NULL)
goto error;
@@ -1297,7 +1438,7 @@ test_tconv(hid_t file)
/* Create the data set */
if((dataset = H5Dcreate2(file, DSET_TCONV_NAME, H5T_STD_I32LE, space,
- H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* Write the data to the dataset */
@@ -1315,7 +1456,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;
}
}
@@ -1325,8 +1466,8 @@ test_tconv(hid_t file)
HDfree(out);
HDfree(in);
- puts(" PASSED");
- return 0;
+ HDputs(" PASSED");
+ return SUCCEED;
error:
if(out)
@@ -1339,33 +1480,29 @@ error:
H5Sclose(space);
} H5E_END_TRY;
- return -1;
-}
+ return FAIL;
+} /* end test_tconv() */
/* This message derives from H5Z */
const H5Z_class2_t H5Z_BOGUS[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_BOGUS, /* Filter id number */
+ H5Z_FILTER_BOGUS, /* Filter id number */
1, 1, /* Encoding and decoding enabled */
- "bogus", /* Filter name for debugging */
+ "bogus", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
- filter_bogus, /* The actual filter function */
+ filter_bogus, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
- * Function: can_apply_bogus
- *
- * Purpose: A bogus 'can apply' callback that returns 0 for H5T_NATIVE_DOUBLE
- * dataype, but returns 1 for all other datatypes
- *
- * Return: Success: Described above
- * Failure: 0
+ * Function: can_apply_bogus
*
- * Programmer: Quincey Koziol
- * Friday, April 5, 2003
+ * Purpose: A bogus 'can apply' callback that returns 0 for H5T_NATIVE_DOUBLE
+ * dataype, but returns 1 for all other datatypes
*
+ * Return: Success: Described above
+ * Failure: 0
*-------------------------------------------------------------------------
*/
static htri_t
@@ -1377,21 +1514,16 @@ can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSE
return 1;
else
return -1;
-}
+} /* end can_apply_bogus() */
+
-
/*-------------------------------------------------------------------------
- * Function: filter_bogus
+ * Function: filter_bogus
*
- * Purpose: A bogus compression method that doesn't do anything.
- *
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Robb Matzke
- * Tuesday, April 21, 1998
+ * Purpose: A bogus compression method that doesn't do anything.
*
+ * Return: Success: Data chunk size
+ * Failure: 0
*-------------------------------------------------------------------------
*/
static size_t
@@ -1400,22 +1532,18 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
{
return nbytes;
-}
+} /* end filter_bogus() */
+
-
/*-------------------------------------------------------------------------
- * Function: set_local_bogus2
+ * Function: set_local_bogus2
*
- * Purpose: A 'set local' callback that stores the size of the datatype
- * and adds it to all the H5T_NATIVE_INT values during
- * filter operation.
- *
- * Return: Success: non-negative
- * Failure: negative
- *
- * Programmer: Quincey Koziol
- * Friday, April 5, 2003
+ * Purpose: A 'set local' callback that stores the size of the datatype
+ * and adds it to all the H5T_NATIVE_INT values during
+ * filter operation.
*
+ * Return: Success: non-negative
+ * Failure: negative
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1452,21 +1580,17 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id)
return(SUCCEED);
} /* end set_local_bogus2() */
-
+
/*-------------------------------------------------------------------------
- * Function: filter_bogus2
- *
- * Purpose: A filter method that adds a value to data values on writing
- * (if the parameter is set), but does not modify data values on
- * reading (so that correct operation of the filter can be
- * checked).
+ * Function: filter_bogus2
*
- * Return: Success: Data chunk size
- * Failure: 0
- *
- * Programmer: Quincey Koziol
- * Monday, April 7, 2003
+ * Purpose: A filter method that adds a value to data values on writing
+ * (if the parameter is set), but does not modify data values on
+ * reading (so that correct operation of the filter can be
+ * checked).
*
+ * Return: Success: Data chunk size
+ * Failure: 0
*-------------------------------------------------------------------------
*/
static size_t
@@ -1508,21 +1632,16 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts,
/* Filter is "no op" */
else
return(nbytes);
-}
+} /* end filter_bogus2() */
+
-
/*-------------------------------------------------------------------------
- * Function: filter_bogus3
- *
- * Purpose: A bogus compression method that returns a failure.
+ * Function: filter_bogus3
*
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * 4 August 2010
+ * Purpose: A bogus compression method that returns a failure.
*
+ * Return: Success: Data chunk size
+ * Failure: 0
*-------------------------------------------------------------------------
*/
static size_t
@@ -1531,34 +1650,29 @@ filter_bogus3(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
{
return 0;
-}
+} /* end filter_bogus3() */
/* This message derives from H5Z */
const H5Z_class2_t H5Z_CORRUPT[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_CORRUPT, /* Filter id number */
+ H5Z_FILTER_CORRUPT, /* Filter id number */
1, 1, /* Encoding and decoding enabled */
- "corrupt", /* Filter name for debugging */
+ "corrupt", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
- filter_corrupt, /* The actual filter function */
+ filter_corrupt, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
- * Function: filter_corrupt
- *
- * Purpose: For testing Fletcher32 checksum. modify data slightly during
- * writing so that when data is read back, the checksum should
- * fail.
+ * Function: filter_corrupt
*
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * Jan 14, 2003
+ * Purpose: For testing Fletcher32 checksum. modify data slightly during
+ * writing so that when data is read back, the checksum should
+ * fail.
*
+ * Return: Success: Data chunk size
+ * Failure: 0
*-------------------------------------------------------------------------
*/
static size_t
@@ -1581,7 +1695,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts,
if(offset > nbytes || (offset + length) > nbytes || length < sizeof(unsigned int))
TEST_ERROR
- if(NULL == (data = HDmalloc((size_t)length)))
+ if(NULL == (data = HDmalloc((size_t)length)))
TEST_ERROR
HDmemset(data, (int)value, (size_t)length);
@@ -1608,17 +1722,13 @@ error:
return ret_value;
} /* end filter_corrupt() */
-
+
/*-------------------------------------------------------------------------
* Function: filter_cb_cont
*
* Purpose: Callback function to handle checksum failure. Let it continue.
*
* Return: continue
- *
- * Programmer: Raymond Lu
- * Jan 14, 2003
- *
*-------------------------------------------------------------------------
*/
static H5Z_cb_return_t
@@ -1629,19 +1739,15 @@ filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU
return H5Z_CB_CONT;
else
return H5Z_CB_FAIL;
-}
+} /* end filter_cb_cont() */
+
-
/*-------------------------------------------------------------------------
* Function: filter_cb_fail
*
* Purpose: Callback function to handle checksum failure. Let it fail.
*
* Return: fail
- *
- * Programmer: Raymond Lu
- * Jan 14, 2003
- *
*-------------------------------------------------------------------------
*/
static H5Z_cb_return_t
@@ -1652,39 +1758,35 @@ filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU
return H5Z_CB_FAIL;
else
return H5Z_CB_CONT;
-}
+} /* end filter_cb_fail() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_filter_internal
+ * Function: test_filter_internal
*
- * Purpose: Tests dataset compression. If compression is requested when
- * it hasn't been compiled into the library (such as when
- * updating an existing compressed dataset) then data is sent to
- * the file uncompressed but no errors are returned.
- *
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Robb Matzke
- * Wednesday, April 15, 1998
+ * Purpose: Tests dataset compression. If compression is requested when
+ * it hasn't been compiled into the library (such as when
+ * updating an existing compressed dataset) then data is sent to
+ * the file uncompressed but no errors are returned.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
int corrupted, hsize_t *dset_size)
{
- hid_t dataset; /* Dataset ID */
- hid_t dxpl; /* Dataset xfer property list ID */
- hid_t write_dxpl; /* Dataset xfer property list ID for writing */
- hid_t sid; /* Dataspace ID */
- const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
- const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
- const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */
- void *tconv_buf = NULL; /* Temporary conversion buffer */
- size_t i, j, n; /* Local index variables */
- herr_t status; /* Error status */
+ hid_t dataset; /* Dataset ID */
+ hid_t dxpl; /* Dataset xfer property list ID */
+ hid_t write_dxpl; /* Dataset xfer property list ID for writing */
+ hid_t sid; /* Dataspace ID */
+ const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
+ const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
+ const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */
+ void *tconv_buf = NULL; /* Temporary conversion buffer */
+ size_t i, j, n; /* Local index variables */
+ herr_t status; /* Error status */
/* Create the data space */
if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
@@ -1710,13 +1812,13 @@ 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 */
/* Create the dataset */
if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT)) < 0) goto error;
+ dcpl, H5P_DEFAULT)) < 0) goto error;
PASSED();
@@ -1726,19 +1828,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (uninitialized read)");
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
+ TEST_ERROR;
for(i=0; i<(size_t)size[0]; i++) {
- for(j=0; j<(size_t)size[1]; j++) {
- if(0!=check[i][j]) {
- H5_FAILED();
- printf(" Read a non-zero value.\n");
- printf(" At index %lu,%lu\n",
- (unsigned long)i, (unsigned long)j);
- goto error;
- }
- }
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(0!=check[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read a non-zero value.\n");
+ HDprintf(" At index %lu,%lu\n",
+ (unsigned long)i, (unsigned long)j);
+ goto error;
+ }
+ }
}
PASSED();
@@ -1750,13 +1852,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
TESTING(" filters (write)");
for(i=n=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- points[i][j] = (int)(n++);
- }
+ for(j=0; j<size[1]; j++) {
+ points[i][j] = (int)(n++);
+ }
}
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
- TEST_ERROR;
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points_data) < 0)
+ TEST_ERROR;
if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR;
@@ -1773,38 +1875,39 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
- } else {
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
+ }
+ else {
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
+ TEST_ERROR;
/* Check that the values read are the same as the values written */
for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- fprintf(stderr," At original: %d\n", (int)points[i][j]);
- fprintf(stderr," At returned: %d\n", (int)check[i][j]);
- goto error;
- }
- }
+ for(j=0; j<size[1]; j++) {
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDfprintf(stderr," At original: %d\n", (int)points[i][j]);
+ HDfprintf(stderr," At returned: %d\n", (int)check[i][j]);
+ goto error;
+ }
+ }
}
}
@@ -1820,49 +1923,50 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
TESTING(" filters (modify)");
for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]/2; j++) {
- points[i][j] = (int)HDrandom ();
- }
+ for(j=0; j<size[1]/2; j++) {
+ points[i][j] = (int)HDrandom ();
+ }
}
- if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
- TEST_ERROR;
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points_data) < 0)
+ TEST_ERROR;
if(corrupted) {
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
- } else {
+ }
+ else {
/* Read the dataset back and check it */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
+ TEST_ERROR;
/* Check that the values read are the same as the values written */
for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
- (unsigned long)i, (unsigned long)j);
- goto error;
- }
- }
+ for(j=0; j<size[1]; j++) {
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n",
+ (unsigned long)i, (unsigned long)j);
+ goto error;
+ }
+ }
}
}
@@ -1884,13 +1988,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status >= 0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
@@ -1898,24 +2002,24 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status >= 0) TEST_ERROR;
} /* end if */
else {
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
for(i = 0; i < size[0]; i++)
- for(j = 0; j < size[1]; j++)
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
- (unsigned long)i, (unsigned long)j);
- goto error;
- } /* end if */
+ for(j = 0; j < size[1]; j++)
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n",
+ (unsigned long)i, (unsigned long)j);
+ goto error;
+ } /* end if */
} /* end else */
PASSED();
@@ -1930,57 +2034,58 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
TESTING(" filters (partial I/O)");
for(i=0; i<(size_t)hs_size[0]; i++) {
- for(j=0; j<(size_t)hs_size[1]; j++) {
- points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom();
- }
+ for(j=0; j<(size_t)hs_size[1]; j++) {
+ points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom();
+ }
}
if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
- NULL) < 0) TEST_ERROR;
+ NULL) < 0) TEST_ERROR;
/* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */
- if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
- TEST_ERROR;
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points_data) < 0)
+ TEST_ERROR;
if(corrupted) {
/* Default behavior is failure when data is corrupted. */
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
/* Callback decides to continue inspite data is corrupted. */
if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL) < 0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check_data) < 0)
TEST_ERROR;
/* Callback decides to fail when data is corrupted. */
if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL) < 0) TEST_ERROR;
/* (Use the "write" DXPL in order to make certain corruption is seen) */
H5E_BEGIN_TRY {
- status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check);
+ status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check_data);
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
- } else {
- if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
- TEST_ERROR;
+ }
+ else {
+ if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check_data) < 0)
+ TEST_ERROR;
/* Check that the values read are the same as the values written */
for(i=0; i<(size_t)hs_size[0]; i++) {
- for(j=0; j<(size_t)hs_size[1]; j++) {
- if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
- check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
- H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n",
- (unsigned long)((size_t)hs_offset[0]+i),
- (unsigned long)((size_t)hs_offset[1]+j));
- fprintf(stderr," At original: %d\n",
- (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- fprintf(stderr," At returned: %d\n",
- (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- goto error;
- }
- }
+ for(j=0; j<(size_t)hs_size[1]; j++) {
+ if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
+ check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
+ H5_FAILED();
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n",
+ (unsigned long)((size_t)hs_offset[0]+i),
+ (unsigned long)((size_t)hs_offset[1]+j));
+ HDfprintf(stderr," At original: %d\n",
+ (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
+ HDfprintf(stderr," At returned: %d\n",
+ (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
+ goto error;
+ }
+ }
}
}
@@ -1993,29 +2098,26 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(H5Dclose (dataset) < 0) goto error;
if(H5Sclose (sid) < 0) goto error;
if(H5Pclose (dxpl) < 0) goto error;
+ if(H5Pclose (write_dxpl) < 0) goto error;
HDfree (tconv_buf);
- return(0);
+ return SUCCEED;
error:
if(tconv_buf)
HDfree (tconv_buf);
- return -1;
-}
+ return FAIL;
+} /* end test_filter_internal() */
/*-------------------------------------------------------------------------
- * Function: test_filter_noencoder
- *
- * Purpose: Tests filters with no encoder present. Ensures that data
- * can still be decoded correctly and that errors are thrown
- * when the application tries to write.
- *
- * Return: Success: 0
- * Failure: -1
+ * Function: test_filter_noencoder
*
- * Programmer: Nat Furrer and James Laird
- * Monday, June 7, 2004
+ * Purpose: Tests filters with no encoder present. Ensures that data
+ * can still be decoded correctly and that errors are thrown
+ * when the application tries to write.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_SZIP
@@ -2086,7 +2188,7 @@ test_filter_noencoder(const char *dset_name)
*/
dims = 20; /* Dataset is originally of size 10 */
H5E_BEGIN_TRY{
- err = H5Dset_extent(dset_id, &dims);
+ err = H5Dset_extent(dset_id, &dims);
}H5E_END_TRY
if(err >= 0) goto error;
@@ -2095,7 +2197,7 @@ test_filter_noencoder(const char *dset_name)
* the filter does not have an encoder.
*/
H5E_BEGIN_TRY{
- err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints);
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints);
}H5E_END_TRY
if(err >= 0) goto error;
@@ -2107,7 +2209,7 @@ test_filter_noencoder(const char *dset_name)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5_FAILED();
@@ -2122,8 +2224,8 @@ error:
if(file_id != -1)
H5Fclose(file_id);
- return -1;
-}
+ return FAIL;
+} /* end test_filter_noencoder() */
#endif /* H5_HAVE_FILTER_SZIP */
/*-------------------------------------------------------------------------
@@ -2133,10 +2235,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Nat Furrer and James Laird
- * Thursday, June 10, 2004
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2173,7 +2271,7 @@ test_get_filter_info(void)
#ifdef H5_HAVE_FILTER_SZIP
if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR
- if(SZ_encoder_enabled()) {
+ if(H5Z_SZIP->encoder_present) {
if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
TEST_ERROR
@@ -2193,23 +2291,19 @@ test_get_filter_info(void)
if(err >= 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_get_filter_info() */
/*-------------------------------------------------------------------------
- * Function: test_filters
- *
- * Purpose: Tests dataset filter.
- *
- * Return: Success: 0
- * Failure: -1
+ * Function: test_filters
*
- * Programmer: Robb Matzke
- * Wednesday, April 15, 1998
+ * Purpose: Tests dataset filter.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2219,28 +2313,28 @@ H5_ATTR_UNUSED
#endif /* H5_HAVE_FILTER_SZIP */
fapl)
{
- hid_t dc; /* Dataset creation property list ID */
+ hid_t dc; /* Dataset creation property list ID */
const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
- hsize_t null_size; /* Size of dataset with null filter */
+ hsize_t null_size; /* Size of dataset with null filter */
- hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */
+ hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */
unsigned data_corrupt[3]; /* position and length of data to be corrupted */
#ifdef H5_HAVE_FILTER_DEFLATE
- hsize_t deflate_size; /* Size of dataset with deflate filter */
+ hsize_t deflate_size; /* Size of dataset with deflate filter */
#endif /* H5_HAVE_FILTER_DEFLATE */
#ifdef H5_HAVE_FILTER_SZIP
- hsize_t szip_size; /* Size of dataset with szip filter */
- unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK;
- unsigned szip_pixels_per_block=4;
+ hsize_t szip_size; /* Size of dataset with szip filter */
+ unsigned szip_options_mask = H5_SZIP_NN_OPTION_MASK;
+ unsigned szip_pixels_per_block = 4;
#endif /* H5_HAVE_FILTER_SZIP */
hsize_t shuffle_size; /* Size of dataset with shuffle filter */
-#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP)
- hsize_t combo_size; /* Size of dataset with multiple filters */
-#endif /* defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP */
+#if defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP)
+ hsize_t combo_size; /* Size of dataset with multiple filters */
+#endif /* defined(H5_HAVE_FILTER_DEFLATE) || defined(H5_HAVE_FILTER_SZIP) */
/* test the H5Zget_filter_info function */
if(test_get_filter_info() < 0) goto error;
@@ -2249,7 +2343,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;
@@ -2264,7 +2358,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;
@@ -2273,21 +2367,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;
@@ -2297,7 +2391,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 */
@@ -2310,7 +2404,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;
@@ -2321,7 +2415,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 */
/*----------------------------------------------------------
@@ -2334,34 +2428,36 @@ H5_ATTR_UNUSED
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- puts("");
- 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;
+ 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;
- } else {
- SKIPPED();
+ }
+ else {
+ SKIPPED();
}
TESTING("szip filter (without encoder)");
if( h5_szip_can_encode() != 1) {
- puts("");
- if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error;
- } else {
- SKIPPED();
+ HDputs("");
+ if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error;
+ }
+ else {
+ SKIPPED();
}
#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;
@@ -2369,7 +2465,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 */
@@ -2381,7 +2477,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;
@@ -2393,7 +2489,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;
@@ -2407,7 +2503,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 */
/*----------------------------------------------------------
@@ -2422,22 +2518,24 @@ H5_ATTR_UNUSED
if(H5Pset_fletcher32 (dc) < 0) goto error;
if(H5Pset_shuffle (dc) < 0) goto error;
- /* Make sure encoding is enabled */
+ /* Make sure encoding is enabled */
if( h5_szip_can_encode() == 1) {
- puts("");
- 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;
- } else {
- SKIPPED();
+ 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;
+ }
+ else {
+ SKIPPED();
}
TESTING("shuffle+szip+checksum filters(checksum first, without encoder)");
if( h5_szip_can_encode() != 1) {
- puts("");
- if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error;
- } else {
- SKIPPED();
+ HDputs("");
+ if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error;
+ }
+ else {
+ SKIPPED();
}
/* Clean up objects used for this test */
@@ -2447,45 +2545,40 @@ H5_ATTR_UNUSED
/* Make sure encoding is enabled */
if( h5_szip_can_encode() == 1) {
- puts("");
- 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;
- if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
- if(H5Pset_fletcher32 (dc) < 0) goto error;
-
- if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
+ 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;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
- /* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
+ if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
- } else {
- SKIPPED();
+ /* Clean up objects used for this test */
+ if(H5Pclose (dc) < 0) goto error;
+ }
+ else {
+ SKIPPED();
}
#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 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_filters() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_missing_filter
- *
- * Purpose: Tests library behavior when filter is missing
+ * Function: test_missing_filter
*
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Quincey Koziol
- * Thursday, November 14, 2002
+ * Purpose: Tests library behavior when filter is missing
*
+ * Return: SUCCEED/FAIL
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2501,6 +2594,7 @@ test_missing_filter(hid_t file)
size_t i,j; /* Local index variables */
herr_t ret; /* Generic return value */
const char *testfile = H5_get_srcdir_filename(FILE_DEFLATE_NAME); /* Corrected test file name */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
TESTING("dataset access with missing filter");
@@ -2509,38 +2603,43 @@ test_missing_filter(hid_t file)
/* Verify deflate filter is registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Deflate filter not available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter not available\n",__LINE__);
goto error;
} /* end if */
- /* Unregister deflate filter (use internal function) */
- if(H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) {
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
+ /* Unregister deflate filter */
+ /* (Use private routine, to avoid range checking on filter ID) */
+ if(H5Z__unregister(H5Z_FILTER_DEFLATE) < 0) {
H5_FAILED();
- printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Verify deflate filter is not registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=FALSE) {
H5_FAILED();
- printf(" Line %d: Deflate filter available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter available\n",__LINE__);
goto error;
} /* end if */
/* Create dcpl with deflate 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(H5Pset_deflate(dcpl, 9) < 0) {
H5_FAILED();
- printf(" Line %d: Can't set deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't set deflate filter\n",__LINE__);
goto error;
} /* end if */
@@ -2548,47 +2647,47 @@ test_missing_filter(hid_t file)
ret=H5Pall_filters_avail(dcpl);
if(ret<0) {
H5_FAILED();
- printf(" Line %d: Can't check filter availability\n",__LINE__);
+ HDprintf(" Line %d: Can't check filter availability\n",__LINE__);
goto error;
} /* end if */
if(ret!=FALSE) {
H5_FAILED();
- printf(" Line %d: Filter shouldn't be available\n",__LINE__);
+ HDprintf(" Line %d: Filter shouldn't be available\n",__LINE__);
goto error;
} /* end if */
/* 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_MISSING_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) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_data) < 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(0 == (dset_size = H5Dget_storage_size(dsid))) {
H5_FAILED();
- printf(" Line %d: Error querying dataset size, dset_size=%lu\n",__LINE__,(unsigned long)dset_size);
+ HDprintf(" Line %d: Error querying dataset size, dset_size=%lu\n",__LINE__,(unsigned long)dset_size);
goto error;
} /* end if */
@@ -2596,50 +2695,50 @@ test_missing_filter(hid_t file)
/* (i.e. the deflation filter we asked for was silently ignored) */
if((H5Tget_size(H5T_NATIVE_INT) * DSET_DIM1 * DSET_DIM2) != 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) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data) < 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 */
/* Compare data */
/* Check that the values read are the same as the values written */
for(i=0; i<(size_t)dims[0]; i++) {
- 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]);
- goto error;
- } /* end if */
- } /* end for */
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ 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 */
} /* end for */
/* 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 */
@@ -2649,38 +2748,38 @@ test_missing_filter(hid_t file)
/* Open existing file */
if((fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open existing deflated file\n", __LINE__);
+ HDprintf(" Line %d: Can't open existing deflated file\n", __LINE__);
goto error;
} /* end if */
/* Open dataset */
if((dsid = H5Dopen2(fid, "Dataset1", 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 */
/* Read data (should fail, since deflate filter is missing) */
H5E_BEGIN_TRY {
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check);
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data);
} H5E_END_TRY;
if(ret>=0) {
H5_FAILED();
- printf(" Line %d: Should not be able to read dataset data\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to read 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 existing file */
if(H5Fclose(fid) < 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 */
@@ -2688,58 +2787,59 @@ test_missing_filter(hid_t file)
/* Verify deflate filter is not registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=FALSE) {
H5_FAILED();
- printf(" Line %d: Deflate filter available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter available\n",__LINE__);
goto error;
} /* end if */
#ifdef H5_HAVE_FILTER_DEFLATE
/* Register deflate filter (use internal function to avoid range checks) */
if(H5Z_register(H5Z_DEFLATE) < 0) {
H5_FAILED();
- printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
+ HDprintf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
} /* end if */
/* Verify deflate filter is registered currently */
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE)!=TRUE) {
H5_FAILED();
- printf(" Line %d: Deflate filter not available\n",__LINE__);
+ HDprintf(" Line %d: Deflate filter not available\n",__LINE__);
goto error;
} /* end if */
#endif /* H5_HAVE_FILTER_DEFLATE */
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ if(api_ctx_pushed) H5CX_pop();
+
+ return FAIL;
+} /* end test_missing_filter() */
/*-------------------------------------------------------------------------
- * Function: test_onebyte_shuffle
- *
- * Purpose: Tests the 8-bit array with shuffling algorithm.
- * The shuffled array should be the same result as
- * that before the shuffling.
+ * Function: test_onebyte_shuffle
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Kent Yang
- * Wednesday, Nov. 13th, 2002
+ * Purpose: Tests the 8-bit array with shuffling algorithm.
+ * The shuffled array should be the same result as
+ * that before the shuffling.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_onebyte_shuffle(hid_t file)
{
- hid_t dataset, space,dc;
- const hsize_t size[2] = {10, 20};
- const hsize_t chunk_size[2] = {10, 20};
- unsigned char orig_data[10][20];
- unsigned char new_data[10][20];
- size_t i, j;
+ hid_t dataset, space,dc;
+ const hsize_t size[2] = {10, 20};
+ const hsize_t chunk_size[2] = {10, 20};
+ unsigned char orig_data[10][20];
+ unsigned char new_data[10][20];
+ size_t i, j;
TESTING("8-bit shuffling (setup)");
@@ -2753,11 +2853,11 @@ test_onebyte_shuffle(hid_t file)
/* Create the dataset */
if((dataset = H5Dcreate2(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR,
- space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
for(i= 0;i< 10; i++)
- for(j = 0; j < 20; j++)
- orig_data[i][j] = (unsigned char)HDrandom();
+ for(j = 0; j < 20; j++)
+ orig_data[i][j] = (unsigned char)HDrandom();
PASSED();
@@ -2768,9 +2868,8 @@ test_onebyte_shuffle(hid_t file)
*/
TESTING("8-bit shuffling (write)");
- if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data) < 0)
- goto error;
+ if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0)
+ goto error;
PASSED();
@@ -2781,21 +2880,20 @@ test_onebyte_shuffle(hid_t file)
TESTING("8-bit shuffling (read)");
/* Read the dataset back */
- if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data) < 0)
- goto error;
+ if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0)
+ goto error;
/* Check that the values read are the same as the values written */
for(i=0; i<(size_t)size[0]; i++) {
- 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);
- goto error;
- }
- }
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[i][j] != orig_data[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n",
+ (unsigned long)i, (unsigned long)j);
+ goto error;
+ }
+ }
}
/*----------------------------------------------------------------------
@@ -2807,25 +2905,20 @@ test_onebyte_shuffle(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_onebyte_shuffle() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_int
*
* Purpose: Tests the integer datatype for nbit filter
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Xiaowen Wu
- * Wednesday, Dec. 23th, 2004
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2841,7 +2934,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 */
@@ -2871,14 +2964,14 @@ test_nbit_int(hid_t file)
/* Initialize data, assuming size of long long >= size of int */
for(i= 0;i< (size_t)size[0]; i++)
- for(j = 0; j < (size_t)size[1]; j++) {
- power = HDpow(2.0f, (double)(precision - 1));
- orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset);
+ for(j = 0; j < (size_t)size[1]; j++) {
+ power = HDpow(2.0f, (double)(precision - 1));
+ orig_data[i][j] = (int)(((long long)HDrandom() % (long long)power) << offset);
- /* even-numbered values are negtive */
- if((i*size[1]+j+1)%2 == 0)
- orig_data[i][j] = -orig_data[i][j];
- }
+ /* even-numbered values are negtive */
+ if((i*size[1]+j+1)%2 == 0)
+ orig_data[i][j] = -orig_data[i][j];
+ }
PASSED();
@@ -2889,8 +2982,7 @@ test_nbit_int(hid_t file)
*/
TESTING(" nbit int (write)");
- if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- orig_data) < 0)
+ if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0)
goto error;
PASSED();
@@ -2901,8 +2993,7 @@ test_nbit_int(hid_t file)
TESTING(" nbit int (read)");
/* Read the dataset back */
- if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- new_data) < 0)
+ if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
@@ -2913,8 +3004,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;
}
}
@@ -2932,25 +3023,20 @@ test_nbit_int(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_int() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_float
*
* Purpose: Tests the float datatype of nbit filter
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Xiaowen Wu
- * Friday, Jan. 21th, 2005
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -2966,7 +3052,7 @@ test_nbit_float(hid_t file)
{-49140.0f, 2350.25f, -3.2110596e-1f, 6.4998865e-5f, -0.0f}};
float new_data[2][5];
size_t precision, offset;
- size_t i, j;
+ size_t i, j;
TESTING(" nbit float (setup)");
@@ -3029,12 +3115,12 @@ test_nbit_float(hid_t file)
*/
for(i = 0; i < (size_t)size[0]; i++) {
for(j = 0; j < (size_t)size[1]; j++) {
- if(!(orig_data[i][j] == orig_data[i][j]))
+ if(HDisnan(orig_data[i][j]))
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;
}
}
@@ -3055,25 +3141,20 @@ test_nbit_float(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_float() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_double
*
* Purpose: Tests the double datatype of nbit filter
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Xiaowen Wu
- * Wednesday, Jan. 26th, 2005
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3088,18 +3169,18 @@ test_nbit_double(hid_t file)
*/
double orig_data[2][5] = {
{
- H5_DOUBLE(1.6081706885101836e+60),
- H5_DOUBLE(-255.32099170994480),
- H5_DOUBLE(1.2677579992621376e-61),
- H5_DOUBLE(64568.289448797700),
- H5_DOUBLE(-1.0619721778839084e-75)
- },
+ (double)1.6081706885101836e+60L,
+ -255.32099170994480f,
+ (double)1.2677579992621376e-61L,
+ 64568.289448797700f,
+ (double)-1.0619721778839084e-75L
+ },
{
- H5_DOUBLE(2.1499497833454840e+56),
- H5_DOUBLE(6.6562295504670740e-3),
- H5_DOUBLE(-1.5747263393432150),
- H5_DOUBLE(1.0711093225222612),
- H5_DOUBLE(-9.8971679387636870e-1)
+ (double)2.1499497833454840e+56L,
+ 6.6562295504670740e-3f,
+ -1.5747263393432150f,
+ 1.0711093225222612f,
+ -9.8971679387636870e-1f
}};
double new_data[2][5];
size_t precision, offset;
@@ -3166,12 +3247,12 @@ test_nbit_double(hid_t file)
*/
for(i = 0; i < (size_t)size[0]; i++) {
for(j = 0; j < (size_t)size[1]; j++) {
- if(!(orig_data[i][j] == orig_data[i][j]))
+ if(HDisnan(orig_data[i][j]))
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;
}
}
@@ -3192,25 +3273,20 @@ test_nbit_double(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_double() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_array
*
* Purpose: Tests the simple version array datatype for nbit filter
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Xiaowen Wu
- * Tuesday, Jan. 18th, 2005
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -3303,8 +3379,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;
}
@@ -3324,13 +3400,13 @@ test_nbit_array(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_array() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_compound
*
@@ -3362,7 +3438,7 @@ test_nbit_compound(hid_t file)
hid_t dataset, space, dc;
const hsize_t size[2] = {2, 5};
const hsize_t chunk_size[2] = {2, 5};
- const float float_val[2][5] = {{188384.0F, 19.103516F, -1.0831790e9F, -84.242188F, 5.2045898F},
+ const float float_val[2][5] = {{188384.0F, 19.103516F, -1.0831790e9F, -84.242188F, 5.2045898F},
{-49140.0F, 2350.25F, -3.2110596e-1F, 6.4998865e-5F, -0.0F}};
atomic orig_data[2][5];
atomic new_data[2][5];
@@ -3506,11 +3582,11 @@ test_nbit_compound(hid_t file)
if(((unsigned)new_data[i][j].i & i_mask) != ((unsigned)orig_data[i][j].i & i_mask) ||
((unsigned)new_data[i][j].c & c_mask) != ((unsigned)orig_data[i][j].c & c_mask) ||
((unsigned)new_data[i][j].s & s_mask) != ((unsigned)orig_data[i][j].s & s_mask) ||
- (orig_data[i][j].f == orig_data[i][j].f && !H5_FLT_ABS_EQUAL(new_data[i][j].f, orig_data[i][j].f)))
+ (!HDisnan(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;
}
}
@@ -3541,13 +3617,13 @@ test_nbit_compound(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_compound() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_compound_2
*
@@ -3796,7 +3872,7 @@ test_nbit_compound_2(hid_t file)
/* Check that the values read are the same as the values written
* Use mask for checking the significant bits, ignoring the padding bits
*/
- /* The original code
+ /* The original code
* i_mask = ~((unsigned)~0 << (precision[0] + offset[0])) & ((unsigned)~0 << offset[0]);
* left shift a 32-bit integer for 32-bit. The result is undefined by C language. A user
* discovered it using clang compiler with -fcatch-undefined-behavior option (see Issue 7674
@@ -3828,7 +3904,7 @@ test_nbit_compound_2(hid_t file)
if(((unsigned)new_data[i][j].d[m][n].i & i_mask) != ((unsigned)orig_data[i][j].d[m][n].i & i_mask)||
((unsigned)new_data[i][j].d[m][n].c & c_mask) != ((unsigned)orig_data[i][j].d[m][n].c & c_mask)||
((unsigned)new_data[i][j].d[m][n].s & s_mask) != ((unsigned)orig_data[i][j].d[m][n].s & s_mask)||
- (new_data[i][j].d[m][n].f == new_data[i][j].d[m][n].f && !H5_FLT_ABS_EQUAL(new_data[i][j].d[m][n].f, new_data[i][j].d[m][n].f))) {
+ (!HDisnan(new_data[i][j].d[m][n].f) && !H5_FLT_ABS_EQUAL(new_data[i][j].d[m][n].f, new_data[i][j].d[m][n].f))) {
d_failed = 1;
goto out;
}
@@ -3837,11 +3913,11 @@ out:
if(((unsigned)new_data[i][j].a.i & i_mask) != ((unsigned)orig_data[i][j].a.i & i_mask)||
((unsigned)new_data[i][j].a.c & c_mask) != ((unsigned)orig_data[i][j].a.c & c_mask)||
((unsigned)new_data[i][j].a.s & s_mask) != ((unsigned)orig_data[i][j].a.s & s_mask)||
- (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)) ||
+ (!HDisnan(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;
}
}
@@ -3886,13 +3962,13 @@ out:
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_compound_2() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_compound_3
*
@@ -4023,8 +4099,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;
}
@@ -4032,8 +4108,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;
}
@@ -4041,8 +4117,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;
}
}
@@ -4051,8 +4127,8 @@ test_nbit_compound_3(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
- if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
+ if(H5Treclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
+ if(H5Treclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
if(H5Tclose(i_tid) < 0) goto error;
if(H5Tclose(str_tid) < 0) goto error;
if(H5Tclose(vl_str_tid) < 0) goto error;
@@ -4066,13 +4142,13 @@ test_nbit_compound_3(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_nbit_compound_3() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_int_size
*
@@ -4093,157 +4169,172 @@ test_nbit_int_size(hid_t file)
hid_t dataspace, dataset, datatype, mem_datatype, dset_create_props;
hsize_t dims[2], chunk_size[2];
hsize_t dset_size = 0;
- int orig_data[DSET_DIM1][DSET_DIM2];
+ int **orig = NULL;
+ int *orig_data = NULL;
double power;
int i, j;
size_t precision, offset;
TESTING(" nbit integer dataset size");
- /* Define dataset datatype (integer), and set precision, offset */
- if((datatype = H5Tcopy(H5T_NATIVE_INT)) < 0) {
- H5_FAILED();
- printf(" line %d: H5Tcopy failed\n",__LINE__);
- goto error;
- } /* end if */
+ /* Set up data array */
+ if(NULL == (orig_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (orig = (int **)HDcalloc(DSET_DIM1, sizeof(orig_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ orig[i] = orig_data + (i * DSET_DIM2);
- precision = 16; /* precision includes sign bit */
- if(H5Tset_precision(datatype,precision)<0) {
- H5_FAILED();
- printf(" line %d: H5Pset_precision failed\n",__LINE__);
- goto error;
- } /* end if */
+ /* Define dataset datatype (integer), and set precision, offset */
+ if((datatype = H5Tcopy(H5T_NATIVE_INT)) < 0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Tcopy failed\n",__LINE__);
+ goto error;
+ }
- offset = 8;
- if(H5Tset_offset(datatype,offset)<0) {
- H5_FAILED();
- printf(" line %d: H5Tset_offset failed\n",__LINE__);
- goto error;
- } /* end if */
+ precision = 16; /* precision includes sign bit */
+ if(H5Tset_precision(datatype,precision)<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pset_precision failed\n",__LINE__);
+ goto error;
+ }
- /* Copy to memory datatype */
- if((mem_datatype = H5Tcopy(datatype)) < 0) {
- H5_FAILED();
- printf(" line %d: H5Tcopy failed\n",__LINE__);
- goto error;
- } /* end if */
+ offset = 8;
+ if(H5Tset_offset(datatype,offset)<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Tset_offset failed\n",__LINE__);
+ goto error;
+ }
- /* Set order of dataset datatype */
- if(H5Tset_order(datatype, H5T_ORDER_BE)<0) {
+ /* Copy to memory datatype */
+ if((mem_datatype = H5Tcopy(datatype)) < 0) {
H5_FAILED();
- printf(" 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__);
- goto error;
- } /* end if */
+ HDprintf(" line %d: H5Tcopy failed\n",__LINE__);
+ goto error;
+ }
- /* Initiliaze data buffer with random data within correct range
- * corresponding to the memory datatype's precision and offset.
- */
- for (i=0; i < DSET_DIM1; i++)
- for (j=0; j < DSET_DIM2; j++) {
- power = HDpow(2.0F, (double)(precision-1));
- orig_data[i][j] = HDrandom() % (int)power << offset;
- } /* end for */
+ /* Set order of dataset datatype */
+ if(H5Tset_order(datatype, H5T_ORDER_BE)<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pset_order failed\n",__LINE__);
+ goto error;
+ }
+ if(H5Tset_size(datatype, 4)<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pset_size failed\n",__LINE__);
+ goto error;
+ }
- /* Describe the dataspace. */
- dims[0] = DSET_DIM1;
- dims[1] = DSET_DIM2;
- if((dataspace = H5Screate_simple (2, dims, NULL))<0) {
- H5_FAILED();
- printf(" line %d: H5Pcreate failed\n",__LINE__);
- goto error;
- } /* end if */
+ /* Initiliaze data buffer with random data within correct range
+ * corresponding to the memory datatype's precision and offset.
+ */
+ for (i=0; i < DSET_DIM1; i++)
+ for (j=0; j < DSET_DIM2; j++) {
+ power = HDpow(2.0F, (double)(precision-1));
+ orig[i][j] = HDrandom() % (int)power << offset;
+ }
- /*
- * Set the dataset creation property list to specify the chunks
- */
- chunk_size[0] = DSET_DIM1/10;
- chunk_size[1] = DSET_DIM2/10;
- if((dset_create_props = H5Pcreate (H5P_DATASET_CREATE))<0) {
- H5_FAILED();
- printf(" 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__);
- goto error;
- } /* end if */
+ /* Describe the dataspace. */
+ dims[0] = DSET_DIM1;
+ dims[1] = DSET_DIM2;
+ if((dataspace = H5Screate_simple(2, dims, NULL))<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pcreate failed\n",__LINE__);
+ goto error;
+ }
- /*
- * Set for n-bit compression
- */
- if(H5Pset_nbit (dset_create_props)<0) {
- H5_FAILED();
- printf(" line %d: H5Pset_nbit failed\n",__LINE__);
- goto error;
- } /* end if */
+ /*
+ * Set the dataset creation property list to specify the chunks
+ */
+ chunk_size[0] = DSET_DIM1/10;
+ chunk_size[1] = DSET_DIM2/10;
+ if((dset_create_props = H5Pcreate(H5P_DATASET_CREATE))<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pcreate failed\n",__LINE__);
+ goto error;
+ }
- /*
- * Create a new dataset within the file.
- */
- if((dataset = H5Dcreate2 (file, DSET_NBIT_INT_SIZE_NAME, datatype,
- dataspace, H5P_DEFAULT,
+ if(H5Pset_chunk(dset_create_props, 2, chunk_size)<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pset_chunk failed\n",__LINE__);
+ goto error;
+ }
+
+ /*
+ * Set for n-bit compression
+ */
+ if(H5Pset_nbit(dset_create_props)<0) {
+ H5_FAILED();
+ HDprintf(" line %d: H5Pset_nbit failed\n",__LINE__);
+ goto error;
+ }
+
+ /*
+ * Create a new dataset within the file.
+ */
+ if((dataset = H5Dcreate2(file, DSET_NBIT_INT_SIZE_NAME, datatype,
+ dataspace, H5P_DEFAULT,
dset_create_props, H5P_DEFAULT))<0) {
- H5_FAILED();
- printf(" line %d: H5dwrite failed\n",__LINE__);
- goto error;
- } /* end if */
+ H5_FAILED();
+ HDprintf(" line %d: H5dwrite failed\n",__LINE__);
+ goto error;
+ }
- /*
- * Write the array to the file.
- */
- if(H5Dwrite (dataset, mem_datatype, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, orig_data)<0) {
- H5_FAILED();
- printf(" Line %d: H5Dwrite failed\n",__LINE__);
- goto error;
- } /* end if */
+ /*
+ * Write the array to the file.
+ */
+ if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data)<0) {
+ H5_FAILED();
+ HDprintf(" Line %d: H5Dwrite failed\n",__LINE__);
+ goto error;
+ }
- /*
- * Get the precision of the data type
- */
- if((precision = H5Tget_precision(datatype)) == 0) {
- H5_FAILED();
- printf(" Line %d: wrong precision size: %zu\n",__LINE__, precision);
- goto error;
- } /* end if */
+ /*
+ * Get the precision of the data type
+ */
+ if((precision = H5Tget_precision(datatype)) == 0) {
+ H5_FAILED();
+ HDprintf(" Line %d: wrong precision size: %zu\n",__LINE__, precision);
+ goto error;
+ }
- /*
- * The size of the dataset after compression should around 2 * DSET_DIM1 * DSET_DIM2
- */
- if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) ||
- dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) {
- H5_FAILED();
- HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size);
- goto error;
- } /* end if */
+ /*
+ * The size of the dataset after compression should around 2 * DSET_DIM1 * DSET_DIM2
+ */
+ if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) ||
+ dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) {
+ H5_FAILED();
+ HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size);
+ goto error;
+ }
- H5Tclose (datatype);
- H5Tclose (mem_datatype);
- H5Dclose (dataset);
- H5Sclose (dataspace);
- H5Pclose (dset_create_props);
+ H5Tclose(datatype);
+ H5Tclose(mem_datatype);
+ H5Dclose(dataset);
+ H5Sclose(dataspace);
+ H5Pclose(dset_create_props);
+
+ HDfree(orig);
+ HDfree(orig_data);
PASSED();
- return 0;
+ return SUCCEED;
+
error:
- return -1;
-}
+ HDfree(orig);
+ HDfree(orig_data);
+
+ return FAIL;
+} /* end test_nbit_int_size() */
+
-
/*-------------------------------------------------------------------------
* Function: test_nbit_flt_size
*
- * Purpose: Tests the correct size of the floating-number datatype for
+ * Purpose: Tests the correct size of the floating-number datatype for
* nbit filter
*
* Return: Success: 0
@@ -4261,13 +4352,22 @@ test_nbit_flt_size(hid_t file)
hid_t dataspace, dataset, datatype, dset_create_props;
hsize_t dims[2], chunk_size[2];
hsize_t dset_size = 0;
- float orig_data[DSET_DIM1][DSET_DIM2];
+ float **orig = NULL;
+ float *orig_data = NULL;
int i, j;
size_t precision, offset;
size_t spos, epos, esize, mpos, msize;
TESTING(" nbit floating-number dataset size");
+ /* Set up data array */
+ if(NULL == (orig_data = (float *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(float))))
+ TEST_ERROR;
+ if(NULL == (orig = (float **)HDcalloc(DSET_DIM1, sizeof(orig_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ orig[i] = orig_data + (i * DSET_DIM2);
+
/* Define floating-point type for dataset
*-------------------------------------------------------------------
* size=4 byte, precision=16 bits, offset=8 bits,
@@ -4292,7 +4392,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 */
@@ -4306,47 +4406,47 @@ 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 */
- /*
- * Initiliaze data buffer with random data
+ /*
+ * Initiliaze data buffer with random data
*/
for (i=0; i < DSET_DIM1; i++)
for (j=0; j < DSET_DIM2; j++)
- orig_data[i][j] = (float)(HDrandom() % 1234567) / 2;
+ orig[i][j] = (float)(HDrandom() % 1234567) / 2;
/* Describe the dataspace. */
@@ -4354,7 +4454,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 */
@@ -4365,13 +4465,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 */
@@ -4380,7 +4480,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 */
@@ -4388,10 +4488,10 @@ test_nbit_flt_size(hid_t file)
* Create a new dataset within the file.
*/
if((dataset = H5Dcreate2 (file, DSET_NBIT_FLT_SIZE_NAME, datatype,
- dataspace, H5P_DEFAULT,
+ 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 */
@@ -4401,23 +4501,23 @@ 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 */
- /*
+ /*
* Get the precision of the data type
*/
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 */
- /*
+ /*
* The size of the dataset after compression should around 2 * DSET_DIM1 * DSET_DIM2
*/
- if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) ||
+ if((dset_size = H5Dget_storage_size(dataset)) < DSET_DIM1*DSET_DIM2*(precision/8) ||
dset_size > DSET_DIM1*DSET_DIM2*(precision/8) + 1*KB) {
H5_FAILED();
HDfprintf(stdout, " Line %d: wrong dataset size: %Hu\n",__LINE__, dset_size);
@@ -4431,11 +4531,17 @@ test_nbit_flt_size(hid_t file)
PASSED();
- return 0;
+ HDfree(orig);
+ HDfree(orig_data);
+
+ return SUCCEED;
error:
- return -1;
-}
-
+ HDfree(orig);
+ HDfree(orig_data);
+
+ return FAIL;
+} /* end test_nbit_flt_size() */
+
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_int
*
@@ -4461,7 +4567,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);
@@ -4524,8 +4630,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;
}
}
@@ -4542,12 +4648,12 @@ test_scaleoffset_int(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_scaleoffset_int() */
+
-
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_int_2
*
@@ -4653,8 +4759,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;
}
}
@@ -4670,12 +4776,12 @@ test_scaleoffset_int_2(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_scaleoffset_int_2() */
+
-
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_float
*
@@ -4765,8 +4871,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;
}
}
@@ -4783,12 +4889,12 @@ test_scaleoffset_float(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_scaleoffset_float() */
+
-
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_float_2
*
@@ -4896,8 +5002,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;
}
}
@@ -4912,12 +5018,12 @@ test_scaleoffset_float_2(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_scaleoffset_float_2() */
+
-
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_double
*
@@ -5007,8 +5113,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;
}
}
@@ -5025,12 +5131,12 @@ test_scaleoffset_double(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_scaleoffset_double() */
+
-
/*-------------------------------------------------------------------------
* Function: test_scaleoffset_double_2
*
@@ -5138,8 +5244,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;
}
}
@@ -5155,25 +5261,25 @@ test_scaleoffset_double_2(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
-}
+ return FAIL;
+} /* end test_scaleoffset_double_2() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_multiopen
+ * Function: test_multiopen
*
- * Purpose: Tests that a bug no longer exists. If a dataset is opened
- * twice and one of the handles is used to extend the dataset,
- * then the other handle should return the new size when
- * queried.
+ * Purpose: Tests that a bug no longer exists. If a dataset is opened
+ * twice and one of the handles is used to extend the dataset,
+ * then the other handle should return the new size when
+ * queried.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, June 9, 1998
*
*-------------------------------------------------------------------------
@@ -5181,10 +5287,10 @@ error:
static herr_t
test_multiopen (hid_t file)
{
- hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1;
- hsize_t cur_size[1] = {10};
- static hsize_t max_size[1] = {H5S_UNLIMITED};
- hsize_t tmp_size[1];
+ hid_t dcpl = -1, space = -1, dset1 = -1, dset2 = -1;
+ hsize_t cur_size[1] = {10};
+ hsize_t tmp_size[1];
+ static hsize_t max_size[1] = {H5S_UNLIMITED};
TESTING("multi-open with extending");
@@ -5204,9 +5310,9 @@ test_multiopen (hid_t file)
if((space = H5Dget_space(dset2)) < 0) goto error;
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]);
- goto error;
+ H5_FAILED();
+ HDprintf(" Got %d instead of %d!\n", (int)tmp_size[0], (int)cur_size[0]);
+ goto error;
} /* end if */
if(H5Dclose(dset1) < 0) goto error;
@@ -5215,29 +5321,29 @@ test_multiopen (hid_t file)
if(H5Pclose(dcpl) < 0) goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Dclose(dset1);
- H5Dclose(dset2);
- H5Sclose(space);
- H5Pclose(dcpl);
+ H5Dclose(dset1);
+ H5Dclose(dset2);
+ H5Sclose(space);
+ H5Pclose(dcpl);
} H5E_END_TRY;
- return -1;
-}
+ return FAIL;
+} /* end test_multiopen() */
+
-
/*-------------------------------------------------------------------------
- * Function: test_types
+ * Function: test_types
*
- * Purpose: Make some datasets with various types so we can test h5ls.
+ * Purpose: Make some datasets with various types so we can test h5ls.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, June 7, 1999
*
*-------------------------------------------------------------------------
@@ -5245,10 +5351,10 @@ test_multiopen (hid_t file)
static herr_t
test_types(hid_t file)
{
- hid_t grp=-1, type=-1, space=-1, dset=-1;
- size_t i;
- hsize_t nelmts;
- unsigned char buf[32];
+ hid_t grp=-1, type=-1, space=-1, dset=-1;
+ size_t i;
+ hsize_t nelmts;
+ unsigned char buf[32];
TESTING("various datatypes");
if((grp = H5Gcreate2(file, "typetests", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
@@ -5256,12 +5362,12 @@ test_types(hid_t file)
/* bitfield_1 */
nelmts = sizeof(buf);
if((type=H5Tcopy(H5T_STD_B8LE)) < 0 ||
- (space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
- for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ (space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
+ (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- goto error;
+ goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
@@ -5270,12 +5376,12 @@ test_types(hid_t file)
/* bitfield_2 */
nelmts = sizeof(buf)/2;
if((type=H5Tcopy(H5T_STD_B16LE)) < 0 ||
- (space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
- for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ (space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
+ (dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- goto error;
+ goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
if(H5Dclose(dset) < 0) goto error;
@@ -5286,9 +5392,9 @@ test_types(hid_t file)
H5Tset_tag(type, "testing 1-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
(dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
@@ -5300,9 +5406,9 @@ test_types(hid_t file)
H5Tset_tag(type, "testing 4-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
(dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
for(i = 0; i < sizeof buf; i++)
- buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ buf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
if(H5Tclose(type) < 0) goto error;
@@ -5311,42 +5417,42 @@ test_types(hid_t file)
/* Cleanup */
if(H5Gclose(grp) < 0) goto error;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
- H5Gclose(grp);
- H5Tclose(type);
- H5Sclose(space);
- H5Dclose(dset);
+ H5Gclose(grp);
+ H5Tclose(type);
+ H5Sclose(space);
+ H5Dclose(dset);
} H5E_END_TRY;
- return -1;
-}
+ return FAIL;
+} /* end test_types() */
/* This message derives from H5Z */
const H5Z_class2_t H5Z_CAN_APPLY_TEST[1] = {{
H5Z_CLASS_T_VERS,
- H5Z_FILTER_CAN_APPLY_TEST, /* Filter id number */
+ H5Z_FILTER_CAN_APPLY_TEST, /* Filter id number */
1, 1,
- "can_apply_test", /* Filter name for debugging */
+ "can_apply_test", /* Filter name for debugging */
can_apply_bogus, /* The "can apply" callback */
NULL, /* The "set local" callback */
- filter_bogus, /* The actual filter function */
+ filter_bogus, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
- * Function: test_can_apply
+ * Function: test_can_apply
*
- * Purpose: Tests library behavior when filter indicates it can't
+ * Purpose: Tests library behavior when filter indicates it can't
* apply to certain combinations of creation parameters.
* The filter is mandate. If the CAN_APPLY callback function
* indicates wrong datatype, the dataset creation should fail.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Friday, April 5, 2003
*
*-------------------------------------------------------------------------
@@ -5367,42 +5473,42 @@ 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 */
/* Create new dataset */
- /* (Should fail because the 'can apply' function should indicate inappropriate
+ /* (Should fail because the 'can apply' function should indicate inappropriate
* combination. And the filter is mandate.) */
H5E_BEGIN_TRY {
dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} 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 */
@@ -5413,7 +5519,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 */
@@ -5421,115 +5527,115 @@ 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) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_data) < 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) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data) < 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 */
/* Compare data */
/* Check that the values read are the same as the values written */
for(i=0; i<(size_t)dims[0]; i++) {
- 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]);
- goto error;
- } /* end if */
- } /* end for */
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ 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 */
} /* end for */
/* 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 */
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_can_apply() */
/* This message derives from H5Z */
const H5Z_class2_t H5Z_CAN_APPLY_TEST2[1] = {{
H5Z_CLASS_T_VERS,
- H5Z_FILTER_CAN_APPLY_TEST2, /* Filter id number */
+ H5Z_FILTER_CAN_APPLY_TEST2, /* Filter id number */
1, 1,
- "can_apply_test", /* Filter name for debugging */
+ "can_apply_test", /* Filter name for debugging */
can_apply_bogus, /* The "can apply" callback */
NULL, /* The "set local" callback */
- filter_bogus3, /* The actual filter function */
+ filter_bogus3, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
- * Function: test_can_apply2
+ * Function: test_can_apply2
*
- * Purpose: Tests library behavior when an optional filter indicates
- * it can't apply to certain combinations of creation
+ * Purpose: Tests library behavior when an optional filter indicates
+ * it can't apply to certain combinations of creation
* parameters. The filter function FILTER_BOGUS3 does nothing
- * than returning a failure. Because the filter is optional,
+ * than returning a failure. Because the filter is optional,
* the library skips the filter even though the CAN_APPLY_BOGUS
- * indicates the datatype DOUBLE can't apply to the dataset.
+ * indicates the datatype DOUBLE can't apply to the dataset.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 4 August 2010
*
*-------------------------------------------------------------------------
@@ -5550,131 +5656,131 @@ 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) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_data) < 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) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data) < 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 */
/* Compare data */
/* Check that the values read are the same as the values written */
for(i=0; i<(size_t)dims[0]; i++) {
- 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]);
- goto error;
- } /* end if */
- } /* end for */
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ 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 */
} /* end for */
/* 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 */
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_can_apply2() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_can_apply_szip
+ * Function: test_can_apply_szip
*
- * Purpose: Tests library behavior when szip filter indicates it can't
+ * Purpose: Tests library behavior when szip filter indicates it can't
* apply to certain combinations of creation parameters
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 7, 2003
*
*-------------------------------------------------------------------------
@@ -5707,19 +5813,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 */
@@ -5730,7 +5836,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;
}
@@ -5741,7 +5847,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;
}
@@ -5749,7 +5855,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;
}
@@ -5761,47 +5867,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 */
@@ -5809,7 +5915,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;
}
@@ -5820,7 +5926,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 */
@@ -5828,14 +5934,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 */
@@ -5843,17 +5949,17 @@ 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 0;
+ return SUCCEED;
#ifdef H5_HAVE_FILTER_SZIP
error:
- return -1;
+ return FAIL;
#endif /* H5_HAVE_FILTER_SZIP */
} /* end test_can_apply_szip() */
@@ -5861,24 +5967,24 @@ error:
/* This message derives from H5Z */
const H5Z_class2_t H5Z_SET_LOCAL_TEST[1] = {{
H5Z_CLASS_T_VERS,
- H5Z_FILTER_SET_LOCAL_TEST, /* Filter id number */
+ H5Z_FILTER_SET_LOCAL_TEST, /* Filter id number */
1, 1,
- "set_local_test", /* Filter name for debugging */
+ "set_local_test", /* Filter name for debugging */
NULL, /* The "can apply" callback */
set_local_bogus2, /* The "set local" callback */
- filter_bogus2, /* The actual filter function */
+ filter_bogus2, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
- * Function: test_set_local
+ * Function: test_set_local
*
- * Purpose: Tests library behavior for "set local" filter callback
+ * Purpose: Tests library behavior for "set local" filter callback
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Monday, April 7, 2003
*
*-------------------------------------------------------------------------
@@ -5905,65 +6011,65 @@ test_set_local(hid_t fapl)
/* Initialize the integer & floating-point dataset */
n=1.0F;
for(i = 0; i < DSET_DIM1; i++)
- for(j = 0; j < DSET_DIM2; j++) {
- points[i][j] = (int)n++;
- points_dbl[i][j] = (double)1.5F*n++;
- }
+ for(j = 0; j < DSET_DIM2; j++) {
+ points[i][j] = (int)n++;
+ points_dbl[i][j] = (double)1.5F*n++;
+ }
/* Open file */
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
H5_FAILED();
- printf(" Line %d: Can't open file\n",__LINE__);
- goto error;
+ 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) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_data) < 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 */
@@ -5971,181 +6077,181 @@ 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) {
+ if(H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl_data) < 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) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_data) < 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 */
/* Compare data */
/* Check that the values read are the modified version of what was written */
for(i=0; i<dims[0]; i++) {
- 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]);
- goto error;
- } /* end if */
- } /* end for */
+ for(j=0; j<dims[1]; j++) {
+ if((points[i][j]+(int)sizeof(int)) != check[i][j]) {
+ H5_FAILED();
+ 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 */
} /* end for */
/* 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) {
+ if(H5Dread(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, check_dbl_data) < 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 */
/* Compare data */
/* Check that the values read are the modified version of what was written */
for(i=0; i<dims[0]; i++) {
- for(j=0; j<dims[1]; j++) {
- /* If the difference between two values is greater than 0.001%, they're
+ for(j=0; j<dims[1]; j++) {
+ /* If the difference between two values is greater than 0.001%, they're
* 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]);
- goto error;
- } /* end if */
- } /* end for */
+ H5_FAILED();
+ 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 */
} /* end for */
/* 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 */
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_set_local() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_compare_dcpl
+ * Function: test_compare_dcpl
*
- * Purpose: Verifies that if the same DCPL was used to create two
+ * Purpose: Verifies that if the same DCPL was used to create two
* datasets, the DCPLs retrieved from each dataset should
* compare equal.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Wednesday, January 7, 2004
*
*-------------------------------------------------------------------------
@@ -6206,7 +6312,7 @@ test_compare_dcpl(hid_t file)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6216,22 +6322,22 @@ error:
H5Pclose(dcpl1);
H5Pclose(dcpl2);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_compare_dcpl() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_copy_dcpl
+ * Function: test_copy_dcpl
*
- * Purpose: Verifies whether the copy of dataset creation property
+ * Purpose: Verifies whether the copy of dataset creation property
* list works. It tests the DCPL for chunked layout with
* filter and for contiguous layout with external storage.
* (Please see #1608 in Bugzilla)
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 28 January 2010
*
*-------------------------------------------------------------------------
@@ -6247,7 +6353,7 @@ test_copy_dcpl(hid_t file, hid_t fapl)
hid_t dcpl1_copy=(-1),dcpl2_copy=(-1);/* Copies of creation property list IDs */
const hsize_t dims[2] = {500, 4096}; /* Dataspace dimensions */
const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */
- char filename[FILENAME_BUF_SIZE];
+ char filename[FILENAME_BUF_SIZE];
hid_t new_file=(-1);
TESTING("copying dataset creation property lists");
@@ -6309,10 +6415,10 @@ test_copy_dcpl(hid_t file, hid_t fapl)
TEST_ERROR
if((new_dsid1 = H5Dcreate2(new_file, DSET_COPY_DCPL_NAME_1, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl1_copy, H5P_DEFAULT)) < 0) TEST_ERROR
+ H5P_DEFAULT, dcpl1_copy, H5P_DEFAULT)) < 0) TEST_ERROR
if((new_dsid2 = H5Dcreate2(new_file, DSET_COPY_DCPL_NAME_2, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl2_copy, H5P_DEFAULT)) < 0) TEST_ERROR
+ H5P_DEFAULT, dcpl2_copy, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close dataspace */
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -6333,7 +6439,7 @@ test_copy_dcpl(hid_t file, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6348,10 +6454,10 @@ error:
H5Pclose(dcpl1_copy);
H5Pclose(dcpl2_copy);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_copy_dcpl() */
-
+
/*-------------------------------------------------------------------------
* Function: test_filter_delete
*
@@ -6423,7 +6529,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 */
@@ -6433,7 +6539,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 */
@@ -6465,7 +6571,7 @@ test_filter_delete(hid_t file)
#else
SKIPPED();
#endif
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6474,11 +6580,11 @@ error:
H5Dclose(dsid);
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_filter_delete() */
-
+
/*-------------------------------------------------------------------------
* Function: auxread_fdata
*
@@ -6531,7 +6637,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)
@@ -6547,7 +6653,7 @@ auxread_fdata(hid_t fid, const char *name)
if(buf)
HDfree(buf);
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6559,10 +6665,10 @@ error:
if(buf)
HDfree(buf);
} H5E_END_TRY;
- return -1;
-}
+ return FAIL;
+} /* end auxread_fdata() */
+
-
/*-------------------------------------------------------------------------
* Function: test_filters_endianess
*
@@ -6620,7 +6726,7 @@ test_filters_endianess(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6629,10 +6735,10 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_filters_endianess() */
-
+
/*-------------------------------------------------------------------------
* Function: test_zero_dims
*
@@ -6653,9 +6759,9 @@ test_zero_dims(hid_t file)
hid_t s2 = -1, d2 = -1, dcpl2 = -1;
hsize_t dzero = 0, dmax = H5S_UNLIMITED, csize = 5;
hsize_t dzero2[2] = {0, 0};
- hsize_t dmax2[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
- hsize_t csize2[2] = {5, 5};
- hid_t fapl; /* File access property list */
+ hsize_t dmax2[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t csize2[2] = {5, 5};
+ hid_t fapl; /* File access property list */
H5D_chunk_index_t idx_type; /* Dataset chunk index type */
H5F_libver_t low; /* File format low bound */
herr_t ret;
@@ -6671,8 +6777,8 @@ test_zero_dims(hid_t file)
/* Close FAPL */
if(H5Pclose(fapl) < 0) TEST_ERROR
- /*
- * One-dimensional dataset
+ /*
+ * One-dimensional dataset
*/
if((s = H5Screate_simple(1, &dzero, &dmax)) < 0) FAIL_STACK_ERROR
@@ -6707,10 +6813,10 @@ test_zero_dims(hid_t file)
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
- if(idx_type != H5D_CHUNK_IDX_EARRAY)
- FAIL_PUTS_ERROR("should be using extensible array as index");
+ if(idx_type != H5D_CHUNK_IDX_EARRAY)
+ FAIL_PUTS_ERROR("should be using extensible array as index");
} else if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
/* Various no-op writes */
if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR
@@ -6728,8 +6834,8 @@ test_zero_dims(hid_t file)
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
if(H5Sclose(s) < 0) FAIL_STACK_ERROR
- /*
- * Two-dimensional dataset
+ /*
+ * Two-dimensional dataset
*/
if((s2 = H5Screate_simple(2, dzero2, dmax2)) < 0) FAIL_STACK_ERROR
@@ -6766,10 +6872,10 @@ test_zero_dims(hid_t file)
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
- if(idx_type != H5D_CHUNK_IDX_BT2)
- FAIL_PUTS_ERROR("should be using v2 B-tree as index");
+ if(idx_type != H5D_CHUNK_IDX_BT2)
+ FAIL_PUTS_ERROR("should be using v2 B-tree as index");
} else if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
/* Just a no-op */
if(H5Dwrite(d2, H5T_NATIVE_INT, s2, s2, H5P_DEFAULT, (void*)911) < 0) FAIL_STACK_ERROR
@@ -6779,7 +6885,7 @@ test_zero_dims(hid_t file)
if(H5Sclose(s2) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6793,10 +6899,10 @@ error:
H5Dclose(d2);
H5Sclose(s2);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_zero_dims() */
-
+
/*-------------------------------------------------------------------------
* Function: test_missing_chunk
*
@@ -6815,33 +6921,55 @@ error:
static herr_t
test_missing_chunk(hid_t file)
{
- hid_t d = -1, did2 = -1; /* Dataset IDs */
- hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property IDs */
- hid_t s = -1, sid2 = -1; /* Dataspace ID */
- hsize_t hs_start[1], hs_stride[1], hs_count[1], hs_block[1]; /* Hyperslab setting */
- hsize_t hs_start2[2], hs_stride2[2], hs_count2[2], hs_block2[2];/* Hyperslab setting */
+ hid_t d = -1, did2 = -1; /* Dataset IDs */
+ hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property IDs */
+ hid_t s = -1, sid2 = -1; /* Dataspace ID */
+ hsize_t hs_start[1], hs_stride[1], hs_count[1], hs_block[1]; /* Hyperslab setting */
+ hsize_t hs_start2[2], hs_stride2[2], hs_count2[2], hs_block2[2];/* Hyperslab setting */
/* Buffers for reading/writing dataset */
- int wdata[MISSING_CHUNK_DIM],
- rdata[MISSING_CHUNK_DIM];
- int wdata2[MISSING_CHUNK_DIM][MISSING_CHUNK_DIM],
- rdata2[MISSING_CHUNK_DIM][MISSING_CHUNK_DIM];
+ int *wdata = NULL;
+ int *rdata = NULL;
+ int **wdata2 = NULL;
+ int **rdata2 = NULL;
+ int *wdata2_bytes = NULL;
+ int *rdata2_bytes = NULL;
/* Setting for 1-D dataset */
hsize_t dsize=100, dmax=H5S_UNLIMITED;
- hsize_t csize=5;
+ hsize_t csize=5;
/* Setting for 2-D dataset */
hsize_t dsize2[2] = {100, 100}, dmax2[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
- hsize_t csize2[2] = {5, 5};
- size_t u, i, j; /* Local Index variable */
+ hsize_t csize2[2] = {5, 5};
+ size_t u, i, j; /* Local Index variable */
- hid_t fapl; /* File access property list */
- H5F_libver_t low; /* File format low bound */
- H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index types */
+ hid_t fapl; /* File access property list */
+ H5F_libver_t low; /* File format low bound */
+ H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index types */
TESTING("Read dataset with unwritten chunk & undefined fill value");
+ /* Set up data arrays */
+ if(NULL == (wdata = (int *)HDcalloc(MISSING_CHUNK_DIM, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (rdata = (int *)HDcalloc(MISSING_CHUNK_DIM, sizeof(int))))
+ TEST_ERROR;
+
+ if(NULL == (wdata2_bytes = (int *)HDcalloc(MISSING_CHUNK_DIM * MISSING_CHUNK_DIM, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (wdata2 = (int **)HDcalloc(MISSING_CHUNK_DIM, sizeof(wdata2_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < MISSING_CHUNK_DIM; i++)
+ wdata2[i] = wdata2_bytes + (i * MISSING_CHUNK_DIM);
+
+ if(NULL == (rdata2_bytes = (int *)HDcalloc(MISSING_CHUNK_DIM * MISSING_CHUNK_DIM, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (rdata2 = (int **)HDcalloc(MISSING_CHUNK_DIM, sizeof(rdata2_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < MISSING_CHUNK_DIM; i++)
+ rdata2[i] = rdata2_bytes + (i * MISSING_CHUNK_DIM);
+
/* Get the file's file access property list */
if((fapl = H5Fget_access_plist(file)) < 0) TEST_ERROR;
@@ -6859,10 +6987,10 @@ test_missing_chunk(hid_t file)
/* Initialize data for 2-D dataset */
for(i = 0; i < MISSING_CHUNK_DIM; i++) {
- for(j = 0; j < MISSING_CHUNK_DIM; j++) {
- wdata2[i][j] = (int)(j + (i * MISSING_CHUNK_DIM));
- rdata2[i][j] = 911;
- }
+ for(j = 0; j < MISSING_CHUNK_DIM; j++) {
+ wdata2[i][j] = (int)(j + (i * MISSING_CHUNK_DIM));
+ rdata2[i][j] = 911;
+ }
} /* end for */
/* Create dataspace */
@@ -6895,11 +7023,11 @@ test_missing_chunk(hid_t file)
FAIL_PUTS_ERROR("should be using Extensible Array as index");
if(idx_type2 != H5D_CHUNK_IDX_BT2)
FAIL_PUTS_ERROR("should be using v2 B-tree as index");
- } else {
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- if(idx_type2 != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } else {
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ if(idx_type2 != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
}
/* Select elements in every other chunk for 1-D dataset */
@@ -6908,7 +7036,7 @@ test_missing_chunk(hid_t file)
hs_count[0]=10;
hs_block[0]=5;
if(H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count,
- hs_block) < 0) TEST_ERROR;
+ hs_block) < 0) TEST_ERROR;
/* Select elements in every other chunk for 2-D dataset */
hs_start2[0] = hs_start2[1] = 0;
@@ -6916,27 +7044,27 @@ test_missing_chunk(hid_t file)
hs_count2[0] = hs_count2[1] = 10;
hs_block2[0] = hs_block2[1] = 5;
if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_start2, hs_stride2, hs_count2,
- hs_block2) < 0) TEST_ERROR;
+ hs_block2) < 0) TEST_ERROR;
/* Write selected data to the datasets */
if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, wdata) < 0) TEST_ERROR;
- if(H5Dwrite(did2, H5T_NATIVE_INT, sid2, sid2, H5P_DEFAULT, wdata2) < 0) TEST_ERROR;
+ if(H5Dwrite(did2, H5T_NATIVE_INT, sid2, sid2, H5P_DEFAULT, wdata2_bytes) < 0) TEST_ERROR;
/* Read all data from the datasets */
if(H5Dread(d, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata) < 0) TEST_ERROR;
- if(H5Dread(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2) < 0) TEST_ERROR;
+ if(H5Dread(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata2_bytes) < 0) TEST_ERROR;
/* Validata values read for the 1-D dataset */
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 */
@@ -6944,23 +7072,23 @@ test_missing_chunk(hid_t file)
/* Validata values read for the 2-D dataset */
for(i = 0; i < MISSING_CHUNK_DIM; i++) {
- for(j = 0; j < MISSING_CHUNK_DIM; j++) {
-
- if((i % 10) >= 5 || (j % 10) >= 5) {
- if(rdata2[i][j] != 911) {
- printf(" 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",
- __LINE__,(unsigned)i, (unsigned)j, wdata2[i][j],(unsigned)i, (unsigned)j, rdata2[i][j]);
- TEST_ERROR;
- } /* end if */
- } /* end else */
- } /* end for */
+ for(j = 0; j < MISSING_CHUNK_DIM; j++) {
+
+ if((i % 10) >= 5 || (j % 10) >= 5) {
+ if(rdata2[i][j] != 911) {
+ 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]) {
+ 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 */
+ } /* end else */
+ } /* end for */
} /* end for */
/* Close everything */
@@ -6971,8 +7099,15 @@ test_missing_chunk(hid_t file)
if(H5Dclose(d) < 0) TEST_ERROR;
if(H5Dclose(did2) < 0) TEST_ERROR;
+ HDfree(rdata);
+ HDfree(wdata);
+ HDfree(rdata2);
+ HDfree(wdata2);
+ HDfree(rdata2_bytes);
+ HDfree(wdata2_bytes);
+
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6985,14 +7120,87 @@ error:
H5Sclose(s);
H5Sclose(sid2);
} H5E_END_TRY;
- return -1;
+
+ HDfree(rdata);
+ HDfree(wdata);
+ HDfree(rdata2);
+ HDfree(wdata2);
+ HDfree(rdata2_bytes);
+ HDfree(wdata2_bytes);
+
+ return FAIL;
} /* end test_missing_chunk() */
-
+/* Using Euclid's algorithm, find the greatest common divisor (GCD) of
+ * the two arguments and return it.
+ *
+ * The GCD is negative if the arguments have opposite sign. Otherwise,
+ * it is positive.
+ *
+ * If either argument is zero, then the result is undefined.
+ */
+static H5_ATTR_CONST long
+gcd(long l0, long r0)
+{
+ long magnitude, remainder;
+ bool negative = ((l0 < 0) != (r0 < 0));
+ long l = HDlabs(l0), r = HDlabs(r0);
+
+ do {
+ if (l < r) {
+ r = r % l;
+ remainder = r;
+ } else /* r <= l */ {
+ l = l % r;
+ remainder = l;
+ }
+ } while (remainder != 0);
+
+ magnitude = (l == 0) ? r : l;
+ return negative ? -magnitude : magnitude;
+}
+
+/* Choose a random offset into an array `nelts` elements long, and store
+ * it at `offsetp`. The offset will be in the range [0, nelts - 1].
+ * Also choose a random increment, `inc`, that "generates" all
+ * indices in [0, nelts - 1] when it is added to itself repeatedly.
+ * That is, the range of the discrete function `f(i) = (i * inc)
+ * mod nelts` on the domain [0, nelts - 1] is [0, nelts - 1]. Store
+ * `inc` at `incp`.
+ *
+ * If `nelts <= 0`, results are undefined.
+ */
+static void
+make_random_offset_and_increment(long nelts, long *offsetp, long *incp)
+{
+ long inc;
+ long maxinc;
+
+ HDassert(0 < nelts);
+
+ *offsetp = HDrandom() % nelts;
+
+ /* `maxinc` is chosen so that for any `x` in [0, nelts - 1],
+ * `x + maxinc` does not overflow a long.
+ */
+ maxinc = MIN(nelts - 1, LONG_MAX - nelts);
+
+ /* Choose a random number in [1, nelts - 1]. If its greatest divisor
+ * in common with `nelts` is 1, then it will "generate" the additive ring
+ * [0, nelts - 1], so let it be our increment. Otherwise, choose a new
+ * number.
+ */
+ do {
+ inc = 1 + HDrandom() % maxinc;
+ } while (gcd(inc, nelts) != 1);
+
+ *incp = inc;
+}
+
/*-------------------------------------------------------------------------
* Function: test_random_chunks_real
*
- * Purpose: Tests that write/read on randomly selected chunks
+ * Purpose: Tests that write/read on randomly selected chunks
*
*
* Return: Success: 0
@@ -7012,15 +7220,17 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
rbuf[NPOINTS],
check2[20][20];
hsize_t coord[NPOINTS][2];
- hsize_t dsize[2]={100,100}, dmax[2]={H5S_UNLIMITED, H5S_UNLIMITED}, csize[2]={10,10}, nsize[2]={200,200};
- hsize_t fixed_dmax[2] = {1000, 1000};
+ const hsize_t dsize[2]={100,100}, dmax[2]={H5S_UNLIMITED, H5S_UNLIMITED}, csize[2]={10,10}, nsize[2]={200,200};
+ hsize_t fixed_dmax[2] = {1000, 1000};
hsize_t msize[1]={NPOINTS};
const char dname[]="dataset";
int chunk_row, chunk_col;
size_t i, j;
H5D_chunk_index_t idx_type; /* Dataset chunk index type */
H5F_libver_t low; /* File format low bound */
-
+ long ofs, inc;
+ long rows;
+ long cols;
TESTING(testname);
@@ -7054,12 +7264,16 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j=0; j<dsize[1]/csize[1]; j++)
check2[i][j] = 0;
+ rows = (long)(dsize[0]/csize[0]);
+ cols = (long)(dsize[1]/csize[1]);
+ make_random_offset_and_increment(rows * cols, &ofs, &inc);
+
/* Generate random point coordinates. Only one point is selected per chunk */
for(i=0; i<NPOINTS; i++){
- do {
- chunk_row = (int)HDrandom () % (int)(dsize[0]/csize[0]);
- chunk_col = (int)HDrandom () % (int)(dsize[1]/csize[1]);
- } while (check2[chunk_row][chunk_col]);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
+ ofs = (ofs + inc) % (rows * cols);
+ HDassert(!check2[chunk_row][chunk_col]);
wbuf[i] = check2[chunk_row][chunk_col] = chunk_row+chunk_col+1;
coord[i][0] = (hsize_t)chunk_row * csize[0];
@@ -7101,8 +7315,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
if(idx_type != H5D_CHUNK_IDX_FARRAY)
FAIL_PUTS_ERROR("should be using Fixed Array as index");
} /* end else */
- } else if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } else if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
/* Get dataset dataspace */
if((s = H5Dget_space(d)) < 0) TEST_ERROR;
@@ -7119,8 +7333,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 */
@@ -7136,9 +7350,9 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Create dataspace with unlimited maximum dimensions */
if(early_alloc) {
- if((s = H5Screate_simple(2, dsize, fixed_dmax)) < 0) TEST_ERROR;
+ if((s = H5Screate_simple(2, dsize, fixed_dmax)) < 0) TEST_ERROR;
} else
- if((s = H5Screate_simple(2, dsize, dmax)) < 0) TEST_ERROR;
+ if((s = H5Screate_simple(2, dsize, dmax)) < 0) TEST_ERROR;
/* Create dataset creation property list */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
@@ -7158,13 +7372,13 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
- if(early_alloc) {
- if(idx_type != H5D_CHUNK_IDX_NONE)
- FAIL_PUTS_ERROR("should be using implicit indexing");
- } else if(idx_type != H5D_CHUNK_IDX_BT2)
- FAIL_PUTS_ERROR("should be using v2 B-tree as index");
- } else if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ if(early_alloc) {
+ if(idx_type != H5D_CHUNK_IDX_NONE)
+ FAIL_PUTS_ERROR("should be using implicit indexing");
+ } else if(idx_type != H5D_CHUNK_IDX_BT2)
+ FAIL_PUTS_ERROR("should be using v2 B-tree as index");
+ } else if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
/* Extend both dimensions of the dataset */
if(H5Dset_extent(d, nsize) < 0) TEST_ERROR;
@@ -7177,12 +7391,16 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j = 0; j < nsize[1] / csize[1]; j++)
check2[i][j] = 0;
+ H5_CHECKED_ASSIGN(rows, int, nsize[0] / csize[0], long);
+ H5_CHECKED_ASSIGN(cols, int, nsize[1] / csize[1], long);
+ make_random_offset_and_increment(rows * cols, &ofs, &inc);
+
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < NPOINTS; i++){
- do {
- chunk_row = (int)HDrandom() % (int)(nsize[0] / csize[0]);
- chunk_col = (int)HDrandom() % (int)(nsize[1] / csize[1]);
- } while (check2[chunk_row][chunk_col]);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
+ ofs = (ofs + inc) % (rows * cols);
+ HDassert(!check2[chunk_row][chunk_col]);
wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1;
coord[i][0] = (hsize_t)chunk_row * csize[0];
@@ -7226,7 +7444,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 */
@@ -7269,8 +7487,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
if(idx_type != H5D_CHUNK_IDX_FARRAY)
FAIL_PUTS_ERROR("should be using Fixed Array as index");
} /* end else */
- } else if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } else if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
/* Extend both dimensions of the dataset */
if(H5Dset_extent(d, nsize) < 0) TEST_ERROR;
@@ -7283,12 +7501,16 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j = 0; j < nsize[1] / csize[1]; j++)
check2[i][j] = 0;
+ rows = (long)(nsize[0] / csize[0]);
+ cols = (long)(nsize[1] / csize[1]);
+ make_random_offset_and_increment(rows * cols, &ofs, &inc);
+
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < NPOINTS; i++){
- do {
- chunk_row = (int)HDrandom() % (int)(nsize[0] / csize[0]);
- chunk_col = (int)HDrandom() % (int)(nsize[1] / csize[1]);
- } while (check2[chunk_row][chunk_col]);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
+ ofs = (ofs + inc) % (rows * cols);
+ HDassert(!check2[chunk_row][chunk_col]);
wbuf[i] = check2[chunk_row][chunk_col] = chunk_row + chunk_col + 1;
coord[i][0] = (hsize_t)chunk_row * csize[0];
@@ -7332,7 +7554,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 */
@@ -7343,7 +7565,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR;
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7353,23 +7575,23 @@ error:
H5Dclose(d);
H5Fclose(file);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_random_chunks_real() */
-
+
/*-------------------------------------------------------------------------
* Function: test_random_chunks
*
- * Purpose: Tests that write/read on randomly selected chunks
+ * Purpose: Tests that write/read on randomly selected chunks
* First file:
* One dataset has fixed dimensions without max. dims & H5D_ALLOC_TIME_EARLY
* One dataset has fixed dimensions without max. dims & default alloc time
- * Second file:
- * One extendible dataset with unlimited max. dims & H5D_ALLOC_TIME_EARLY
- * One extendible dataset with unlimited max. dims & default alloc time
- * third file:
- * one extendible dataset with fixed max. dims & H5D_ALLOC_TIME_EARLY
- * one extendible dataset with fixed max. dims & default alloc time
+ * Second file:
+ * One extendible dataset with unlimited max. dims & H5D_ALLOC_TIME_EARLY
+ * One extendible dataset with unlimited max. dims & default alloc time
+ * third file:
+ * one extendible dataset with fixed max. dims & H5D_ALLOC_TIME_EARLY
+ * one extendible dataset with fixed max. dims & default alloc time
*
* All the datasets in second & third files are extended before write/read operations
*
@@ -7409,14 +7631,14 @@ set_local_deprec(hid_t H5_ATTR_UNUSED dcpl_id, hid_t H5_ATTR_UNUSED type_id, hid
/* Old style H5Z_class_t, essentially a copy of the "bogus" filter */
const H5Z_class1_t H5Z_DEPREC[1] = {{
- H5Z_FILTER_DEPREC, /* Filter id number */
- "deprec", /* Filter name for debugging */
+ H5Z_FILTER_DEPREC, /* Filter id number */
+ "deprec", /* Filter name for debugging */
can_apply_deprec, /* The "can apply" callback */
set_local_deprec, /* The "set local" callback */
- filter_bogus, /* The actual filter function */
+ filter_bogus, /* The actual filter function */
}};
-
+
/*-------------------------------------------------------------------------
* Function: test_deprec
*
@@ -7433,11 +7655,11 @@ const H5Z_class1_t H5Z_DEPREC[1] = {{
static herr_t
test_deprec(hid_t file)
{
- hid_t dataset, space, small_space, create_parms, dcpl;
- hsize_t dims[2], small_dims[2];
- hsize_t deprec_size;
- herr_t status;
- hsize_t csize[2];
+ hid_t dataset, space, small_space, create_parms, dcpl;
+ hsize_t dims[2], small_dims[2];
+ hsize_t deprec_size;
+ herr_t H5_ATTR_NDEBUG_UNUSED status;
+ hsize_t csize[2];
TESTING("deprecated API routines");
@@ -7454,7 +7676,7 @@ test_deprec(hid_t file)
assert(space>=0);
/*
- * Create a dataset using the default dataset creation properties. We're
+ * Create a dataset using the default dataset creation properties. We're
* not sure what they are, so we won't check.
*/
if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT)) < 0) goto error;
@@ -7468,13 +7690,13 @@ test_deprec(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT);
+ dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
- H5_FAILED();
- puts(" Library allowed overwrite of existing dataset.");
- goto error;
+ H5_FAILED();
+ HDputs(" Library allowed overwrite of existing dataset.");
+ goto error;
}
/*
@@ -7490,12 +7712,12 @@ test_deprec(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dopen1(file, "does_not_exist");
+ dataset = H5Dopen1(file, "does_not_exist");
} H5E_END_TRY;
if(dataset >= 0) {
- H5_FAILED();
- puts(" Opened a non-existent dataset.");
- goto error;
+ H5_FAILED();
+ HDputs(" Opened a non-existent dataset.");
+ goto error;
}
/*
@@ -7539,12 +7761,12 @@ test_deprec(hid_t file)
assert(status >= 0);
H5E_BEGIN_TRY {
dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space,
- create_parms);
+ create_parms);
} H5E_END_TRY;
if(dataset >= 0) {
- H5_FAILED();
- puts(" Opened a dataset with incorrect chunking parameters.");
- goto error;
+ H5_FAILED();
+ HDputs(" Opened a dataset with incorrect chunking parameters.");
+ goto error;
}
csize[0] = 5;
@@ -7595,19 +7817,19 @@ 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;
- return 0;
+ return SUCCEED;
error:
- return -1;
+ return FAIL;
} /* end test_deprec() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
+
/*-------------------------------------------------------------------------
* Function: test_huge_chunks
*
@@ -7649,7 +7871,7 @@ test_huge_chunks(hid_t fapl)
ret = H5Pset_chunk(dcpl, 1, &chunk_dim);
} H5E_END_TRY;
if(ret >= 0)
- FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.")
+ FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.")
/* Try to set too large of a chunk for n-D dataset (# of elements) */
chunk_dim2[0] = TOO_HUGE_CHUNK_DIM2_0;
@@ -7659,7 +7881,7 @@ test_huge_chunks(hid_t fapl)
ret = H5Pset_chunk(dcpl, 3, chunk_dim2);
} H5E_END_TRY;
if(ret >= 0)
- FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.")
+ FAIL_PUTS_ERROR(" Set chunk size with too large of chunk dimensions.")
/* Set 1-D chunk size */
chunk_dim = HUGE_CHUNK_DIM;
@@ -7674,7 +7896,7 @@ test_huge_chunks(hid_t fapl)
dsid = H5Dcreate2(fid, HUGE_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
if(dsid >= 0)
- FAIL_PUTS_ERROR(" 1-D Dataset with too large of chunk dimensions created.")
+ FAIL_PUTS_ERROR(" 1-D Dataset with too large of chunk dimensions created.")
/* Close 1-D dataspace */
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
@@ -7697,7 +7919,7 @@ test_huge_chunks(hid_t fapl)
dsid = H5Dcreate2(fid, HUGE_DATASET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
if(dsid >= 0)
- FAIL_PUTS_ERROR(" n-D Dataset with too large of chunk dimensions created.")
+ FAIL_PUTS_ERROR(" n-D Dataset with too large of chunk dimensions created.")
/* Close n-D dataspace */
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
@@ -7707,7 +7929,7 @@ test_huge_chunks(hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7716,10 +7938,10 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_huge_chunks() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_cache
*
@@ -7911,7 +8133,7 @@ test_chunk_cache(hid_t fapl)
if (H5Fclose(fid) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7924,10 +8146,10 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: test_big_chunks_bypass_cache
*
@@ -7950,24 +8172,28 @@ static herr_t
test_big_chunks_bypass_cache(hid_t fapl)
{
char filename[FILENAME_BUF_SIZE];
- hid_t fid = -1; /* File ID */
- hid_t fapl_local = -1; /* File access property list ID */
- hid_t dcpl = -1, t_dcpl = -1; /* Dataset creation property list ID */
- hid_t sid = -1, t_sid = -1; /* Dataspace ID */
- hid_t mid; /* Memory space ID */
- hid_t dsid = -1, t_dsid = -1; /* Dataset ID */
- hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl_local = -1; /* File access property list ID */
+ hid_t dcpl = -1, t_dcpl = -1; /* Dataset creation property list ID */
+ hid_t sid = -1, t_sid = -1; /* Dataspace ID */
+ hid_t mid; /* Memory space ID */
+ hid_t dsid = -1, t_dsid = -1; /* Dataset ID */
+ hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */
hsize_t t_dim[2], t_max[2], t_chunk_dim[2]; /* Dataset and chunk dimensions */
- size_t rdcc_nelmts, rdcc_nbytes; /* Chunk cache parameters */
- int fvalue = BYPASS_FILL_VALUE; /* Fill value */
- hsize_t count, stride, offset, block; /* Setting for hyperslab (1-D) */
+ size_t rdcc_nelmts, rdcc_nbytes; /* Chunk cache parameters */
+ int fvalue = BYPASS_FILL_VALUE; /* Fill value */
+ hsize_t count, stride, offset, block; /* Setting for hyperslab (1-D) */
hsize_t t_count[2], t_stride[2], t_offset[2], t_block[2]; /* Setting for hyperslab (2-D) */
- /* Buffers for reading and writing data (1-D) */
- int *wdata = NULL, *rdata1 = NULL, *rdata2 = NULL;
- /* Buffer for reading and writing data (2-D) */
- static int t_wdata[BYPASS_CHUNK_DIM/2][BYPASS_CHUNK_DIM/2], t_rdata1[BYPASS_DIM][BYPASS_DIM],
- t_rdata2[BYPASS_CHUNK_DIM/2][BYPASS_CHUNK_DIM/2];
- int i, j; /* Local index variables */
+ /* Buffers for reading and writing data (1-D) */
+ int *wdata = NULL, *rdata1 = NULL, *rdata2 = NULL;
+ /* Buffers for reading and writing data (2-D) */
+ int **t_wdata = NULL;
+ int **t_rdata1 = NULL;
+ int **t_rdata2 = NULL;
+ int *t_wdata_bytes = NULL;
+ int *t_rdata1_bytes = NULL;
+ int *t_rdata2_bytes = NULL;
+ int i, j; /* Local index variables */
H5F_libver_t low; /* File format low bound */
H5D_chunk_index_t idx_type, t_idx_type; /* Dataset chunk index types */
@@ -7976,6 +8202,29 @@ test_big_chunks_bypass_cache(hid_t fapl)
h5_fixname(FILENAME[9], fapl, filename, sizeof filename);
+ /* Set up data arrays */
+ if(NULL == (t_wdata_bytes = (int *)HDcalloc((BYPASS_CHUNK_DIM/2) * (BYPASS_CHUNK_DIM/2), sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (t_wdata = (int **)HDcalloc((BYPASS_CHUNK_DIM/2), sizeof(t_wdata_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < (BYPASS_CHUNK_DIM/2); i++)
+ t_wdata[i] = t_wdata_bytes + (i * (BYPASS_CHUNK_DIM/2));
+
+ if(NULL == (t_rdata1_bytes = (int *)HDcalloc(BYPASS_DIM * BYPASS_DIM, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (t_rdata1 = (int **)HDcalloc(BYPASS_DIM, sizeof(t_rdata1_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < BYPASS_DIM; i++)
+ t_rdata1[i] = t_rdata1_bytes + (i * BYPASS_DIM);
+
+ if(NULL == (t_rdata2_bytes = (int *)HDcalloc((BYPASS_CHUNK_DIM/2) * (BYPASS_CHUNK_DIM/2), sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (t_rdata2 = (int **)HDcalloc((BYPASS_CHUNK_DIM/2), sizeof(t_rdata2_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < (BYPASS_CHUNK_DIM/2); i++)
+ t_rdata2[i] = t_rdata2_bytes + (i * (BYPASS_CHUNK_DIM/2));
+
+
/* Check if we are using the latest version of the format */
if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) FAIL_STACK_ERROR
@@ -8030,13 +8279,13 @@ test_big_chunks_bypass_cache(hid_t fapl)
/* Chunk index type expected depends on whether we are using the latest version of the format */
if(low == H5F_LIBVER_LATEST) {
- /* Verify index type */
- if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using Fixed Array as index");
- if(t_idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("should be using v2 B-tree as index");
+ /* Verify index type */
+ if(idx_type != H5D_CHUNK_IDX_FARRAY) FAIL_PUTS_ERROR("should be using Fixed Array as index");
+ if(t_idx_type != H5D_CHUNK_IDX_BT2) FAIL_PUTS_ERROR("should be using v2 B-tree as index");
} else {
- /* Verify index type */
- if(idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- if(t_idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ /* Verify index type */
+ if(idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ if(t_idx_type != H5D_CHUNK_IDX_BTREE) FAIL_PUTS_ERROR("should be using v1 B-tree as index");
} /* end else */
/* Select first chunk to write the data */
@@ -8064,8 +8313,8 @@ test_big_chunks_bypass_cache(hid_t fapl)
/* Initialize data to write for 2-D dataset */
for(i = 0; i < BYPASS_CHUNK_DIM / 2; i++)
- for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++)
- t_wdata[i][j] = j;
+ for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++)
+ t_wdata[i][j] = j;
/* Set up memory space for the 2-D dataset */
mid = H5Screate_simple(2, t_block, NULL);
@@ -8074,7 +8323,7 @@ test_big_chunks_bypass_cache(hid_t fapl)
/* This write should go through the cache because fill value is used. */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, wdata) < 0)
FAIL_STACK_ERROR
- if(H5Dwrite(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_wdata) < 0)
+ if(H5Dwrite(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_wdata_bytes) < 0)
FAIL_STACK_ERROR
/* Close the first 1-D & 2-D datasets */
@@ -8089,42 +8338,42 @@ test_big_chunks_bypass_cache(hid_t fapl)
* chunk is bigger than the cache size and it isn't allocated on disk. */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata1) < 0)
FAIL_STACK_ERROR
- if(H5Dread(t_dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, t_rdata1) < 0)
+ if(H5Dread(t_dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, t_rdata1_bytes) < 0)
FAIL_STACK_ERROR
/* 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 */
/* Verify data for the first 2-D dataset */
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",
- __LINE__, i, j, t_rdata1[i][j], j);
- TEST_ERROR
- } /* end if */
+ for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++)
+ if(t_rdata1[i][j] != j) {
+ 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 */
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",
- __LINE__, i, j, t_rdata1[i][j], fvalue);
+ for(j = BYPASS_CHUNK_DIM / 2; j < BYPASS_DIM; j++)
+ if(t_rdata1[i][j] != fvalue) {
+ 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 */
+ } /* end if */
/* Close the first 1-D & 2-D datasets */
if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
@@ -8145,7 +8394,7 @@ test_big_chunks_bypass_cache(hid_t fapl)
/* Write to the second 1-D & 2-D dataset */
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, wdata) < 0)
FAIL_STACK_ERROR
- if(H5Dwrite(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_wdata) < 0)
+ if(H5Dwrite(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_wdata_bytes) < 0)
FAIL_STACK_ERROR
/* Close the second 1-D & 2-D dataset */
@@ -8160,27 +8409,27 @@ test_big_chunks_bypass_cache(hid_t fapl)
* half chunk should bypass the cache because the chunk is bigger than
* the cache size. */
if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, rdata2) < 0)
- FAIL_STACK_ERROR
- if(H5Dread(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_rdata2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
+ if(H5Dread(t_dsid, H5T_NATIVE_INT, mid, t_sid, H5P_DEFAULT, t_rdata2_bytes) < 0)
+ FAIL_STACK_ERROR
/* 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);
+ if(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 */
/* Verify data for the second 2-D dataset */
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",
- __LINE__, i, j, t_rdata2[i][j], j);
- TEST_ERROR
- } /* end if */
+ for(j = 0; j < BYPASS_CHUNK_DIM / 2; j++)
+ if(t_rdata2[i][j] != j) {
+ 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 */
/* Close IDs */
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
@@ -8196,9 +8445,15 @@ test_big_chunks_bypass_cache(hid_t fapl)
HDfree(wdata);
HDfree(rdata1);
HDfree(rdata2);
+ HDfree(t_wdata);
+ HDfree(t_rdata1);
+ HDfree(t_rdata2);
+ HDfree(t_wdata_bytes);
+ HDfree(t_rdata1_bytes);
+ HDfree(t_rdata2_bytes);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8211,16 +8466,21 @@ error:
H5Sclose(t_sid);
H5Fclose(fid);
} H5E_END_TRY;
- if(wdata)
- HDfree(wdata);
- if(rdata1)
- HDfree(rdata1);
- if(rdata2)
- HDfree(rdata2);
- return -1;
+
+ HDfree(wdata);
+ HDfree(rdata1);
+ HDfree(rdata2);
+ HDfree(t_wdata);
+ HDfree(t_rdata1);
+ HDfree(t_rdata2);
+ HDfree(t_wdata_bytes);
+ HDfree(t_rdata1_bytes);
+ HDfree(t_rdata2_bytes);
+
+ return FAIL;
} /* end test_big_chunks_bypass_cache() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_fast
*
@@ -8285,29 +8545,29 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
/* Loop over using SWMR access to write */
for(swmr = 0; swmr <= 1; swmr++) {
- int compress; /* Whether chunks should be compressed */
+ int compress; /* Whether chunks should be compressed */
/* SWMR is now supported with/without latest format: */
- /* (1) write+latest-format (2) SWMR-write+non-latest-format */
+ /* (1) write+latest-format (2) SWMR-write+non-latest-format */
/* Skip this iteration if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(swmr && !H5FD_supports_swmr_test(env_h5_driver))
+ if(swmr && !H5FD__supports_swmr_test(env_h5_driver))
continue;
#ifdef H5_HAVE_FILTER_DEFLATE
/* Loop over compressing chunks */
for(compress = 0; compress <= 1; compress++)
#else
- /* Loop over without compression */
+ /* Loop over without compression */
for(compress = 0; compress <= 0; compress++)
#endif /* H5_HAVE_FILTER_DEFLATE */
- {
+ {
H5D_alloc_time_t alloc_time; /* Storage allocation time */
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
unsigned ndims; /* Current # of dims to test */
/* Loop over dataspace ranks to test */
@@ -8553,7 +8813,7 @@ test_chunk_fast(const char *env_h5_driver, hid_t fapl)
if(H5Pclose(my_fapl) < 0) FAIL_STACK_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8564,19 +8824,19 @@ error:
H5Fclose(fid);
H5Pclose(my_fapl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_fast() */
-
+
/*-------------------------------------------------------------------------
* Function: test_reopen_chunk_fast
*
* Purpose: To verify a bug in extensible arrays as chunk index.
- * When the dataset is closed in H5D_close(), the pointer
- * to the extensible array struct in the layout message
- * is copied via H5D_flush_real() before H5D_chunk_dest().
- * This causes an abort from "Assertion `ea->hdr' failed."
- * later when the dataset is re-opened and read.
+ * When the dataset is closed in H5D_close(), the pointer
+ * to the extensible array struct in the layout message
+ * is copied via H5D_flush_real() before H5D_chunk_dest().
+ * This causes an abort from "Assertion `ea->hdr' failed."
+ * later when the dataset is re-opened and read.
*
* Return: Success: 0
* Failure: -1
@@ -8596,8 +8856,8 @@ test_reopen_chunk_fast(hid_t fapl)
hid_t scalar_sid = -1;/* Scalar dataspace ID */
hid_t dsid = -1; /* Dataset ID */
hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */
- hsize_t hs_offset; /* Hyperslab offset */
- hsize_t hs_size; /* Hyperslab size */
+ hsize_t hs_offset; /* Hyperslab offset */
+ hsize_t hs_size; /* Hyperslab size */
H5D_alloc_time_t alloc_time; /* Storage allocation time */
unsigned write_elem, read_elem; /* Element written/read */
unsigned u; /* Local index variable */
@@ -8607,77 +8867,77 @@ test_reopen_chunk_fast(hid_t fapl)
h5_fixname(FILENAME[10], fapl, filename, sizeof filename);
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
- /* Create file */
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
-
- /* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
-
- /* Set chunking */
- chunk_dim = 10;
- if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR
-
- /* Set fill time */
- if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) FAIL_STACK_ERROR
-
- /* Set allocation time */
- if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR
-
- /* Create scalar dataspace */
- if((scalar_sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR
-
- /* Create 1-D dataspace */
- dim = 100;
- max_dim = H5S_UNLIMITED;
- if((sid = H5Screate_simple(1, &dim, &max_dim)) < 0) FAIL_STACK_ERROR
-
- /* Create chunked dataset */
- if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
-
- /* Fill existing elements */
- hs_size = 1;
- for(u = 0; u < 100; u++) {
- /* Select a single element in the dataset */
- hs_offset = u;
- if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0)
- FAIL_STACK_ERROR
- /* Write element to dataset */
- write_elem = u;
- if(H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem) < 0)
- FAIL_STACK_ERROR
- } /* end for */
-
- /* Close everything */
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
-
- /* Reopen the dataset */
- if((dsid = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- hs_size = 1;
-
- /* Read from dataset */
- for(u = 0; u < 100; u++) {
- /* Select a single element in the dataset */
- hs_offset = u;
- if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0)
- FAIL_STACK_ERROR
-
- /* Read element from dataset */
- if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0)
- FAIL_STACK_ERROR
- } /* end for */
-
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
- if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
- if(H5Sclose(scalar_sid) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
+ /* Create file */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+
+ /* Create dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
+
+ /* Set chunking */
+ chunk_dim = 10;
+ if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR
+
+ /* Set fill time */
+ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) FAIL_STACK_ERROR
+
+ /* Set allocation time */
+ if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR
+
+ /* Create scalar dataspace */
+ if((scalar_sid = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR
+
+ /* Create 1-D dataspace */
+ dim = 100;
+ max_dim = H5S_UNLIMITED;
+ if((sid = H5Screate_simple(1, &dim, &max_dim)) < 0) FAIL_STACK_ERROR
+
+ /* Create chunked dataset */
+ if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Fill existing elements */
+ hs_size = 1;
+ for(u = 0; u < 100; u++) {
+ /* Select a single element in the dataset */
+ hs_offset = u;
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0)
+ FAIL_STACK_ERROR
+ /* Write element to dataset */
+ write_elem = u;
+ if(H5Dwrite(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &write_elem) < 0)
+ FAIL_STACK_ERROR
+ } /* end for */
+
+ /* Close everything */
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+
+ /* Reopen the dataset */
+ if((dsid = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ hs_size = 1;
+
+ /* Read from dataset */
+ for(u = 0; u < 100; u++) {
+ /* Select a single element in the dataset */
+ hs_offset = u;
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &hs_offset, NULL, &hs_size, NULL) < 0)
+ FAIL_STACK_ERROR
+
+ /* Read element from dataset */
+ if(H5Dread(dsid, H5T_NATIVE_UINT, scalar_sid, sid, H5P_DEFAULT, &read_elem) < 0)
+ FAIL_STACK_ERROR
+ } /* end for */
+
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(scalar_sid) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
} /* end for */
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8687,10 +8947,10 @@ error:
H5Sclose(scalar_sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_reopen_chunk_fast() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_fast_bug1
*
@@ -8718,13 +8978,33 @@ test_chunk_fast_bug1(hid_t fapl)
hid_t dsid = -1; /* Dataset ID */
hsize_t dim[2], max_dim[2], chunk_dim[2]; /* Dataset and chunk dimensions */
H5D_alloc_time_t alloc_time; /* Storage allocation time */
- static unsigned wbuf[40][20], rbuf[40][20]; /* Element written/read */
+
+ unsigned **wbuf = NULL;
+ unsigned **rbuf = NULL;
+ unsigned *wbuf_bytes = NULL;
+ unsigned *rbuf_bytes = NULL;
+
unsigned i, j; /* Local index variables */
TESTING("datasets w/extensible array chunk indexing bug");
h5_fixname(FILENAME[10], fapl, filename, sizeof filename);
+ /* Set up data array */
+ if(NULL == (wbuf_bytes = (unsigned *)HDcalloc(40 * 20, sizeof(unsigned))))
+ TEST_ERROR;
+ if(NULL == (wbuf = (unsigned **)HDcalloc(40, sizeof(wbuf_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < 40; i++)
+ wbuf[i] = wbuf_bytes + (i * 20);
+
+ if(NULL == (rbuf_bytes = (unsigned *)HDcalloc(40 * 20, sizeof(unsigned))))
+ TEST_ERROR;
+ if(NULL == (rbuf = (unsigned **)HDcalloc(40, sizeof(rbuf_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < 40; i++)
+ rbuf[i] = rbuf_bytes + (i * 20);
+
/* Initialize write buffer */
for(i=0; i<40; i++)
for(j=0; j<20; j++)
@@ -8738,7 +9018,7 @@ test_chunk_fast_bug1(hid_t fapl)
if((sid = H5Screate_simple(2, dim, max_dim)) < 0) FAIL_STACK_ERROR
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -8758,7 +9038,7 @@ test_chunk_fast_bug1(hid_t fapl)
FAIL_STACK_ERROR
/* Write buffer to dataset */
- if(H5Dwrite(dsid, H5T_NATIVE_UINT, sid, sid, H5P_DEFAULT, &wbuf) < 0)
+ if(H5Dwrite(dsid, H5T_NATIVE_UINT, sid, sid, H5P_DEFAULT, wbuf_bytes) < 0)
FAIL_STACK_ERROR
/* Close everything */
@@ -8768,7 +9048,7 @@ test_chunk_fast_bug1(hid_t fapl)
if((dsid = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Read from dataset */
- if(H5Dread(dsid, H5T_NATIVE_UINT, sid, sid, H5P_DEFAULT, &rbuf) < 0)
+ if(H5Dread(dsid, H5T_NATIVE_UINT, sid, sid, H5P_DEFAULT, rbuf_bytes) < 0)
FAIL_STACK_ERROR
/* Verify read data */
@@ -8785,8 +9065,13 @@ test_chunk_fast_bug1(hid_t fapl)
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(wbuf_bytes);
+ HDfree(rbuf_bytes);
+
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -8795,39 +9080,45 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(wbuf_bytes);
+ HDfree(rbuf_bytes);
+
+ return FAIL;
} /* end test_chunk_fast_bug1() */
/* This message derives from H5Z */
const H5Z_class2_t H5Z_EXPAND[1] = {{
H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_EXPAND, /* Filter id number */
+ H5Z_FILTER_EXPAND, /* Filter id number */
1, 1, /* Encoding and decoding enabled */
- "expand", /* Filter name for debugging */
+ "expand", /* Filter name for debugging */
NULL, /* The "can apply" callback */
NULL, /* The "set local" callback */
- filter_expand, /* The actual filter function */
+ filter_expand, /* The actual filter function */
}};
/* Global "expansion factor" for filter_expand() routine */
static size_t filter_expand_factor_g = 0;
-
+
/*-------------------------------------------------------------------------
* Function: filter_expand
*
* Purpose: For testing library's behavior when a filter expands a chunk
* too much.
*
- * Note: This filter doesn't actually re-allocate the buffer to be
- * larger, it just changes the buffer size to a value that's too
- * large. The library should throw an error before using the
- * incorrect buffer information.
+ * Note: This filter doesn't actually re-allocate the buffer to be
+ * larger, it just changes the buffer size to a value that's too
+ * large. The library should throw an error before using the
+ * incorrect buffer information.
*
- * Return: Success: Data chunk size
- * Failure: 0
+ * Return: Success: Data chunk size
+ * Failure: 0
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Mar 31, 2009
*
*-------------------------------------------------------------------------
@@ -8861,7 +9152,7 @@ filter_expand(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
return ret_value;
} /* end filter_expand() */
-
+
/*-------------------------------------------------------------------------
* Function: test_chunk_expand
*
@@ -8880,22 +9171,22 @@ static herr_t
test_chunk_expand(hid_t fapl)
{
char filename[FILENAME_BUF_SIZE];
- hid_t fid = -1; /* File ID */
- hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list ID */
- hid_t sid = -1, sid2 = -1; /* Dataspace ID */
- hid_t scalar_sid = -1; /* Scalar dataspace ID */
- hid_t dsid = -1, dsid2 = -1; /* Dataset ID */
- hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */
- hsize_t dim2[2], max_dim2[2], chunk_dim2[2]; /* Dataset and chunk dimensions */
- H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index type */
- H5F_libver_t low, high; /* File format bounds */
- hsize_t hs_offset, hs_offset2[2]; /* Hyperslab offset */
- hsize_t hs_size, hs_size2[2]; /* Hyperslab size */
- H5D_alloc_time_t alloc_time; /* Storage allocation time */
- unsigned write_elem, read_elem; /* Element written/read */
- unsigned write_elem2, read_elem2; /* Element written/read */
- unsigned u; /* Local index variable */
- herr_t status; /* Generic return value */
+ hid_t fid = -1; /* File ID */
+ hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list ID */
+ hid_t sid = -1, sid2 = -1; /* Dataspace ID */
+ hid_t scalar_sid = -1; /* Scalar dataspace ID */
+ hid_t dsid = -1, dsid2 = -1; /* Dataset ID */
+ hsize_t dim, max_dim, chunk_dim; /* Dataset and chunk dimensions */
+ hsize_t dim2[2], max_dim2[2], chunk_dim2[2]; /* Dataset and chunk dimensions */
+ H5D_chunk_index_t idx_type, idx_type2; /* Dataset chunk index type */
+ H5F_libver_t low, high; /* File format bounds */
+ hsize_t hs_offset, hs_offset2[2]; /* Hyperslab offset */
+ hsize_t hs_size, hs_size2[2]; /* Hyperslab size */
+ H5D_alloc_time_t alloc_time; /* Storage allocation time */
+ unsigned write_elem, read_elem; /* Element written/read */
+ unsigned write_elem2, read_elem2; /* Element written/read */
+ unsigned u; /* Local index variable */
+ herr_t status; /* Generic return value */
TESTING("filter expanding chunks too much");
@@ -8905,8 +9196,8 @@ test_chunk_expand(hid_t fapl)
if(H5Pget_libver_bounds(fapl, &low, &high) < 0) FAIL_STACK_ERROR
if(sizeof(size_t) <= 4 && low != H5F_LIBVER_LATEST) {
- SKIPPED();
- puts(" Current machine can't test for error w/old file format");
+ SKIPPED();
+ HDputs(" Current machine can't test for error w/old file format");
} /* end if */
else {
/* Register "expansion" filter */
@@ -8916,7 +9207,7 @@ test_chunk_expand(hid_t fapl)
if(TRUE != H5Zfilter_avail(H5Z_FILTER_EXPAND)) FAIL_STACK_ERROR
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -9241,7 +9532,7 @@ test_chunk_expand(hid_t fapl)
PASSED();
} /* end else */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -9254,32 +9545,32 @@ error:
H5Sclose(scalar_sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_chunk_expand() */
-
+
/*-------------------------------------------------------------------------
* Function: test_fixed_array
*
- * Purpose: Tests support for Fixed Array and Implicit Indexing
+ * Purpose: Tests support for Fixed Array and Implicit Indexing
*
- * Create the following 3 datasets:
- * 1) extendible chunked dataset with fixed max. dims
- * 2) extendible chunked dataset with NULL max. dims
- * 3) extendible chunked dataset with same max. dims
- * (Note that the third dataset is created with bigger size for curr & max. dims
- * so that Fixed Array Indexing with paging is exercised)
+ * Create the following 3 datasets:
+ * 1) extendible chunked dataset with fixed max. dims
+ * 2) extendible chunked dataset with NULL max. dims
+ * 3) extendible chunked dataset with same max. dims
+ * (Note that the third dataset is created with bigger size for curr & max. dims
+ * so that Fixed Array Indexing with paging is exercised)
*
* Repeat the following test with/without compression filter
* Repeat the following test with H5D_ALLOC_TIME_EARLY/H5D_ALLOC_TIME_LATE/H5D_ALLOC_TIME_INCR
- * For the old format,
- * verify that v1 btree indexing type is used for
- * all 3 datasets with all settings
+ * For the old format,
+ * verify that v1 btree indexing type is used for
+ * all 3 datasets with all settings
* For the new format:
- * Verify that Implicit Index type is used for
- * #1, #2, #3 datasets when ALLOC_TIME_EARLY and compression are true
- * Verify Fixed Array indexing type is used for
- * #1, #2, #3 datasets with all other settings
+ * Verify that Implicit Index type is used for
+ * #1, #2, #3 datasets when ALLOC_TIME_EARLY and compression are true
+ * Verify Fixed Array indexing type is used for
+ * #1, #2, #3 datasets with all other settings
*
* Return: Success: 0
* Failure: -1
@@ -9291,7 +9582,7 @@ error:
static herr_t
test_fixed_array(hid_t fapl)
{
- char filename[FILENAME_BUF_SIZE]; /* File name */
+ char filename[FILENAME_BUF_SIZE]; /* File name */
hid_t fid = -1; /* File ID */
hid_t dcpl = -1; /* Dataset creation property list ID */
@@ -9300,51 +9591,89 @@ test_fixed_array(hid_t fapl)
hid_t sid_max = -1; /* Dataspace ID for dataset with maximum dimensions set */
hid_t dsid = -1; /* Dataset ID for dataset with fixed dimensions */
- hid_t dsid_big = -1; /* Dataset ID for big dataset with fixed dimensions */
- hid_t dsid_max = -1; /* Dataset ID for dataset with maximum dimensions set */
+ hid_t dsid_big = -1; /* Dataset ID for big dataset with fixed dimensions */
+ hid_t dsid_max = -1; /* Dataset ID for dataset with maximum dimensions set */
- hsize_t dim2[2] = {48, 18}; /* Dataset dimensions */
- hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */
- hsize_t dim2_max[2] = {120, 50}; /* Maximum dataset dimensions */
+ hsize_t dim2[2] = {48, 18}; /* Dataset dimensions */
+ const hsize_t dim2_big[2] = {500, 60}; /* Big dataset dimensions */
+ hsize_t dim2_max[2] = {120, 50}; /* Maximum dataset dimensions */
- hid_t mem_id; /* Memory space ID */
- hid_t big_mem_id; /* Memory space ID for big dataset */
+ hid_t mem_id; /* Memory space ID */
+ hid_t big_mem_id; /* Memory space ID for big dataset */
- hsize_t msize[1] = {POINTS}; /* Size of memory space */
+ hsize_t msize[1] = {POINTS}; /* Size of memory space */
hsize_t msize_big[1] = {POINTS_BIG}; /* Size of memory space for big dataset */
int wbuf[POINTS]; /* write buffer */
- int *wbuf_big = NULL; /* write buffer for big dataset */
- int rbuf[POINTS]; /* read buffer */
- int *rbuf_big = NULL; /* read buffer for big dataset */
+ int *wbuf_big = NULL; /* write buffer for big dataset */
+ int rbuf[POINTS]; /* read buffer */
+ int *rbuf_big = NULL; /* read buffer for big dataset */
+
+ const hsize_t chunk_dim2[2] = {4, 3}; /* Chunk dimensions */
+
+ int **chunks = NULL; /* # of chunks for dataset dimensions */
+ int **chunks_big = NULL; /* # of chunks for big dataset dimensions */
+ int *chunks_bytes = NULL;
+ int *chunks_big_bytes = NULL;
- hsize_t chunk_dim2[2] = {4, 3}; /* Chunk dimensions */
- int chunks[12][6]; /* # of chunks for dataset dimensions */
- int chunks_big[125][20]; /* # of chunks for big dataset dimensions */
int chunk_row; /* chunk row index */
int chunk_col; /* chunk column index */
- hsize_t coord[POINTS][2]; /* datdaset coordinates */
- hsize_t coord_big[POINTS_BIG][2]; /* big dataset coordinates */
+ hsize_t **coord = NULL; /* datdaset coordinates */
+ hsize_t **coord_big = NULL; /* big datdaset coordinates */
+ hsize_t *coord_bytes = NULL;
+ hsize_t *coord_big_bytes = NULL;
- H5D_chunk_index_t idx_type; /* Dataset chunk index type */
- H5F_libver_t low, high; /* File format bounds */
+ H5D_chunk_index_t idx_type; /* Dataset chunk index type */
+ H5F_libver_t low, high; /* File format bounds */
H5D_alloc_time_t alloc_time; /* Storage allocation time */
#ifdef H5_HAVE_FILTER_DEFLATE
- unsigned compress; /* Whether chunks should be compressed */
+ unsigned compress; /* Whether chunks should be compressed */
#endif /* H5_HAVE_FILTER_DEFLATE */
- h5_stat_size_t empty_size; /* Size of an empty file */
- h5_stat_size_t file_size; /* Size of each file created */
+ h5_stat_size_t empty_size; /* Size of an empty file */
+ h5_stat_size_t file_size; /* Size of each file created */
- size_t i, j; /* local index variables */
- herr_t ret; /* Generic return value */
+ size_t i, j; /* local index variables */
+ herr_t ret; /* Generic return value */
+ long ofs, inc;
+ long rows;
+ long cols;
TESTING("datasets w/fixed array as chunk index");
h5_fixname(FILENAME[12], fapl, filename, sizeof filename);
+ /* Set up 2D data arrays */
+ if(NULL == (chunks_bytes = (int *)HDcalloc(12 * 6, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (chunks = (int **)HDcalloc(12, sizeof(chunks_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < 12; i++)
+ chunks[i] = chunks_bytes + (i * 6);
+
+ if(NULL == (chunks_big_bytes = (int *)HDcalloc(125 * 20, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (chunks_big = (int **)HDcalloc(125, sizeof(chunks_big_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < 125; i++)
+ chunks_big[i] = chunks_big_bytes + (i * 20);
+
+ if(NULL == (coord_bytes = (hsize_t *)HDcalloc(POINTS * 2, sizeof(hsize_t))))
+ TEST_ERROR;
+ if(NULL == (coord = (hsize_t **)HDcalloc(POINTS, sizeof(coord_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < POINTS; i++)
+ coord[i] = coord_bytes + (i * 2);
+
+ if(NULL == (coord_big_bytes = (hsize_t *)HDcalloc(POINTS_BIG * 2, sizeof(hsize_t))))
+ TEST_ERROR;
+ if(NULL == (coord_big = (hsize_t **)HDcalloc(POINTS_BIG, sizeof(coord_big_bytes))))
+ TEST_ERROR;
+ for (i = 0; i < POINTS_BIG; i++)
+ coord_big[i] = coord_big_bytes + (i * 2);
+
/* Check if we are using the latest version of the format */
if(H5Pget_libver_bounds(fapl, &low, &high) < 0) FAIL_STACK_ERROR
@@ -9370,7 +9699,7 @@ test_fixed_array(hid_t fapl)
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -9378,8 +9707,8 @@ test_fixed_array(hid_t fapl)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
/* Set chunking */
- if((ret = H5Pset_chunk(dcpl, 2, chunk_dim2)) < 0)
- FAIL_PUTS_ERROR(" Problem with setting chunk.")
+ if((ret = H5Pset_chunk(dcpl, 2, chunk_dim2)) < 0)
+ FAIL_PUTS_ERROR(" Problem with setting chunk.")
#ifdef H5_HAVE_FILTER_DEFLATE
/* Check if we should compress the chunks */
@@ -9393,243 +9722,251 @@ test_fixed_array(hid_t fapl)
/* Set allocation time */
if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR
- /* Initialization of chunk array for repeated coordinates */
- for(i = 0; i < dim2[0]/chunk_dim2[0]; i++)
- for(j = 0; j < dim2[1]/chunk_dim2[1]; j++)
- chunks[i][j] = 0;
-
- /* Generate random point coordinates. Only one point is selected per chunk */
- for(i = 0; i < POINTS; i++){
- do {
- chunk_row = (int)HDrandom () % (int)(dim2[0]/chunk_dim2[0]);
- chunk_col = (int)HDrandom () % (int)(dim2[1]/chunk_dim2[1]);
- } while (chunks[chunk_row][chunk_col]);
-
- wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row+chunk_col+1;
- coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
- coord[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
- } /* end for */
-
- /* Create first dataset with cur and max dimensions */
- if((sid_max = H5Screate_simple(2, dim2, dim2_max)) < 0) FAIL_STACK_ERROR
- dsid_max = H5Dcreate2(fid, DSET_FIXED_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if(dsid_max < 0)
- FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.")
-
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(dsid_max, &idx_type) < 0) FAIL_STACK_ERROR
-
- /* Chunk index type depends on whether we are using the latest version of the format */
- if(low == H5F_LIBVER_LATEST) {
- if(alloc_time == H5D_ALLOC_TIME_EARLY
+ /* Initialization of chunk array for repeated coordinates */
+ for(i = 0; i < dim2[0]/chunk_dim2[0]; i++)
+ for(j = 0; j < dim2[1]/chunk_dim2[1]; j++)
+ chunks[i][j] = 0;
+
+ rows = (long)(dim2[0]/chunk_dim2[0]);
+ cols = (long)(dim2[1]/chunk_dim2[1]);
+ make_random_offset_and_increment(rows * cols, &ofs, &inc);
+
+ /* Generate random point coordinates. Only one point is selected per chunk */
+ for(i = 0; i < POINTS; i++){
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
+ ofs = (ofs + inc) % (rows * cols);
+ HDassert(!chunks[chunk_row][chunk_col]);
+
+ wbuf[i] = chunks[chunk_row][chunk_col] = chunk_row+chunk_col+1;
+ coord[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
+ coord[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
+ } /* end for */
+
+ /* Create first dataset with cur and max dimensions */
+ if((sid_max = H5Screate_simple(2, dim2, dim2_max)) < 0) FAIL_STACK_ERROR
+ dsid_max = H5Dcreate2(fid, DSET_FIXED_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if(dsid_max < 0)
+ FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.")
+
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(dsid_max, &idx_type) < 0) FAIL_STACK_ERROR
+
+ /* Chunk index type depends on whether we are using the latest version of the format */
+ if(low == H5F_LIBVER_LATEST) {
+ if(alloc_time == H5D_ALLOC_TIME_EARLY
#ifdef H5_HAVE_FILTER_DEFLATE
- && !compress
+ && !compress
#endif /* H5_HAVE_FILTER_DEFLATE */
- ) {
- if(idx_type != H5D_CHUNK_IDX_NONE)
- FAIL_PUTS_ERROR("should be using Non Index as index");
- } else if (idx_type != H5D_CHUNK_IDX_FARRAY)
- FAIL_PUTS_ERROR("should be using Fixed Array as index");
- } /* end if */
- else {
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- } /* end else */
-
- /* Create dataspace for write buffer */
- if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
-
- /* Select the random points for writing */
- if(H5Sselect_elements(sid_max, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0)
- TEST_ERROR;
-
- /* Write into dataset */
- if(H5Dwrite(dsid_max, H5T_NATIVE_INT, mem_id, sid_max, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
-
- /* Closing */
- if(H5Dclose(dsid_max) < 0) FAIL_STACK_ERROR
- if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR
- if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR
-
-
- /* Create second dataset with curr dim but NULL max dim */
- if((sid = H5Screate_simple(2, dim2, NULL)) < 0) FAIL_STACK_ERROR
- dsid = H5Dcreate2(fid, DSET_FIXED_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if(dsid < 0)
- FAIL_PUTS_ERROR(" Creating Chunked Dataset.")
-
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR
-
- /* Chunk index type depends on whether we are using the latest version of the format */
- if(low == H5F_LIBVER_LATEST) {
- if(alloc_time == H5D_ALLOC_TIME_EARLY
+ ) {
+ if(idx_type != H5D_CHUNK_IDX_NONE)
+ FAIL_PUTS_ERROR("should be using Non Index as index");
+ } else if (idx_type != H5D_CHUNK_IDX_FARRAY)
+ FAIL_PUTS_ERROR("should be using Fixed Array as index");
+ } /* end if */
+ else {
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } /* end else */
+
+ /* Create dataspace for write buffer */
+ if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
+
+ /* Select the random points for writing */
+ if(H5Sselect_elements(sid_max, H5S_SELECT_SET, POINTS, (const hsize_t *)coord_bytes) < 0)
+ TEST_ERROR;
+
+ /* Write into dataset */
+ if(H5Dwrite(dsid_max, H5T_NATIVE_INT, mem_id, sid_max, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(dsid_max) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR
+
+
+ /* Create second dataset with curr dim but NULL max dim */
+ if((sid = H5Screate_simple(2, dim2, NULL)) < 0) FAIL_STACK_ERROR
+ dsid = H5Dcreate2(fid, DSET_FIXED_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if(dsid < 0)
+ FAIL_PUTS_ERROR(" Creating Chunked Dataset.")
+
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR
+
+ /* Chunk index type depends on whether we are using the latest version of the format */
+ if(low == H5F_LIBVER_LATEST) {
+ if(alloc_time == H5D_ALLOC_TIME_EARLY
#ifdef H5_HAVE_FILTER_DEFLATE
- && !compress
+ && !compress
#endif /* H5_HAVE_FILTER_DEFLATE */
- ) {
- if(idx_type != H5D_CHUNK_IDX_NONE)
- FAIL_PUTS_ERROR("should be using Non Index as index");
- } else if(idx_type != H5D_CHUNK_IDX_FARRAY)
- FAIL_PUTS_ERROR("should be using Fixed Array as index");
- } else {
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- } /* end else */
-
- /* Create dataspace for write buffer */
- if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
-
- /* Select the random points for writing */
- if(H5Sselect_elements(sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0)
- TEST_ERROR;
-
- /* Write into dataset */
- if(H5Dwrite(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
-
- /* Closing */
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
- if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
- if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR
-
- /* Create the third dataset with bigger size and both curr & max dimensions are the same */
- if((sid_big = H5Screate_simple(2, dim2_big, dim2_big)) < 0) FAIL_STACK_ERROR
- dsid_big = H5Dcreate2(fid, DSET_FIXED_BIG, H5T_NATIVE_INT, sid_big, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if(dsid_big < 0)
- FAIL_PUTS_ERROR(" Creating Big Chunked Dataset.")
-
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(dsid_big, &idx_type) < 0) FAIL_STACK_ERROR
-
- /* Chunk index type depends on whether we are using the latest version of the format */
- if(low == H5F_LIBVER_LATEST) {
- if(alloc_time == H5D_ALLOC_TIME_EARLY
+ ) {
+ if(idx_type != H5D_CHUNK_IDX_NONE)
+ FAIL_PUTS_ERROR("should be using Non Index as index");
+ } else if(idx_type != H5D_CHUNK_IDX_FARRAY)
+ FAIL_PUTS_ERROR("should be using Fixed Array as index");
+ } else {
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } /* end else */
+
+ /* Create dataspace for write buffer */
+ if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
+
+ /* Select the random points for writing */
+ if(H5Sselect_elements(sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord_bytes) < 0)
+ TEST_ERROR;
+
+ /* Write into dataset */
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR
+
+ /* Create the third dataset with bigger size and both curr & max dimensions are the same */
+ if((sid_big = H5Screate_simple(2, dim2_big, dim2_big)) < 0) FAIL_STACK_ERROR
+ dsid_big = H5Dcreate2(fid, DSET_FIXED_BIG, H5T_NATIVE_INT, sid_big, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if(dsid_big < 0)
+ FAIL_PUTS_ERROR(" Creating Big Chunked Dataset.")
+
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(dsid_big, &idx_type) < 0) FAIL_STACK_ERROR
+
+ /* Chunk index type depends on whether we are using the latest version of the format */
+ if(low == H5F_LIBVER_LATEST) {
+ if(alloc_time == H5D_ALLOC_TIME_EARLY
#ifdef H5_HAVE_FILTER_DEFLATE
- && !compress
+ && !compress
#endif /* H5_HAVE_FILTER_DEFLATE */
- ) {
- if(idx_type != H5D_CHUNK_IDX_NONE)
- FAIL_PUTS_ERROR("should be using Non Index as index");
- } else if(idx_type != H5D_CHUNK_IDX_FARRAY)
- FAIL_PUTS_ERROR("should be using Fixed Array as index");
- } /* end if */
- else {
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- } /* end else */
-
- /* Initialization of chunk array for repeated coordinates */
- for(i = 0; i < dim2_big[0]/chunk_dim2[0]; i++)
- for(j = 0; j < dim2_big[1]/chunk_dim2[1]; j++)
- chunks_big[i][j] = 0;
-
- /* Generate random point coordinates. Only one point is selected per chunk */
- for(i = 0; i < POINTS_BIG; i++){
- do {
- chunk_row = (int)HDrandom () % (int)(dim2_big[0]/chunk_dim2[0]);
- chunk_col = (int)HDrandom () % (int)(dim2_big[1]/chunk_dim2[1]);
- } while (chunks_big[chunk_row][chunk_col]);
-
- wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row+chunk_col+1;
- coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
- coord_big[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
- } /* end for */
-
- /* Create dataspace for write buffer */
- if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR;
-
- /* Select the random points for writing */
- if(H5Sselect_elements(sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big) < 0)
- TEST_ERROR;
-
- /* Write into dataset */
- if(H5Dwrite(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, wbuf_big) < 0) TEST_ERROR;
-
- /* Closing */
- if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR
- if(H5Sclose(sid_big) < 0) FAIL_STACK_ERROR
- if(H5Sclose(big_mem_id) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
-
- /* Open the first dataset */
- if((dsid = H5Dopen2(fid, DSET_FIXED_MAX, H5P_DEFAULT)) < 0) TEST_ERROR;
-
- /* Get dataset dataspace */
- if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR;
-
- /* Create dataspace for read buffer */
- if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
-
- /* Select the random points for reading */
- if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) TEST_ERROR;
-
- /* Read from dataset */
- if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
-
- /* 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",
- __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
- TEST_ERROR;
- } /* end if */
-
- /* Closing */
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ ) {
+ if(idx_type != H5D_CHUNK_IDX_NONE)
+ FAIL_PUTS_ERROR("should be using Non Index as index");
+ } else if(idx_type != H5D_CHUNK_IDX_FARRAY)
+ FAIL_PUTS_ERROR("should be using Fixed Array as index");
+ } /* end if */
+ else {
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } /* end else */
+
+ /* Initialization of chunk array for repeated coordinates */
+ for(i = 0; i < dim2_big[0]/chunk_dim2[0]; i++)
+ for(j = 0; j < dim2_big[1]/chunk_dim2[1]; j++)
+ chunks_big[i][j] = 0;
+
+ rows = (long)(dim2_big[0]/chunk_dim2[0]);
+ cols = (long)(dim2_big[1]/chunk_dim2[1]);
+ make_random_offset_and_increment(rows * cols, &ofs, &inc);
+
+ /* Generate random point coordinates. Only one point is selected per chunk */
+ for(i = 0; i < POINTS_BIG; i++){
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
+ ofs = (ofs + inc) % (rows * cols);
+ HDassert(!chunks_big[chunk_row][chunk_col]);
+
+ wbuf_big[i] = chunks_big[chunk_row][chunk_col] = chunk_row+chunk_col+1;
+ coord_big[i][0] = (hsize_t)chunk_row * chunk_dim2[0];
+ coord_big[i][1] = (hsize_t)chunk_col * chunk_dim2[1];
+ } /* end for */
+
+ /* Create dataspace for write buffer */
+ if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR;
+
+ /* Select the random points for writing */
+ if(H5Sselect_elements(sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big_bytes) < 0)
+ TEST_ERROR;
+
+ /* Write into dataset */
+ if(H5Dwrite(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, wbuf_big) < 0) TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid_big) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(big_mem_id) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+
+ /* Open the first dataset */
+ if((dsid = H5Dopen2(fid, DSET_FIXED_MAX, H5P_DEFAULT)) < 0) TEST_ERROR;
+
+ /* Get dataset dataspace */
+ if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR;
+
+ /* Create dataspace for read buffer */
+ if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
+
+ /* Select the random points for reading */
+ if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord_bytes) < 0) TEST_ERROR;
+
+ /* Read from dataset */
+ if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
+
+ /* Verify that written and read data are the same */
+ for(i = 0; i < POINTS; i++)
+ if(rbuf[i] != wbuf[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 */
+
+ /* Closing */
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR
- /* Open the second dataset */
- if((dsid = H5Dopen2(fid, DSET_FIXED_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR;
+ /* Open the second dataset */
+ if((dsid = H5Dopen2(fid, DSET_FIXED_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR;
- /* Get dataset dataspace */
- if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR;
+ /* Get dataset dataspace */
+ if((sid = H5Dget_space(dsid)) < 0) TEST_ERROR;
- /* Create dataspace for read buffer */
- if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
+ /* Create dataspace for read buffer */
+ if((mem_id = H5Screate_simple(1, msize, NULL)) < 0) TEST_ERROR;
- /* Select the random points for reading */
- if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord) < 0) TEST_ERROR;
+ /* Select the random points for reading */
+ if(H5Sselect_elements (sid, H5S_SELECT_SET, POINTS, (const hsize_t *)coord_bytes) < 0) TEST_ERROR;
- /* Read from dataset */
- if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
+ /* Read from dataset */
+ if(H5Dread(dsid, H5T_NATIVE_INT, mem_id, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
- /* 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",
- __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
- TEST_ERROR;
- } /* end if */
+ /* Verify that written and read data are the same */
+ for(i = 0; i < POINTS; i++)
+ if(rbuf[i] != wbuf[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 */
- /* Closing */
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ /* Closing */
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
if(H5Sclose(mem_id) < 0) FAIL_STACK_ERROR
- /* Open the third dataset */
- if((dsid_big = H5Dopen2(fid, DSET_FIXED_BIG, H5P_DEFAULT)) < 0) TEST_ERROR;
- /* Get dataset dataspace */
- if((sid_big = H5Dget_space(dsid_big)) < 0) TEST_ERROR;
-
- /* Create dataspace for read buffer */
- if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR;
-
- /* Select the random points for reading */
- if(H5Sselect_elements (sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big) < 0) TEST_ERROR;
- /* Read from dataset */
- if(H5Dread(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, rbuf_big) < 0) TEST_ERROR;
-
- /* 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",
- __LINE__,(unsigned)i,wbuf_big[i],(unsigned)i,rbuf_big[i]);
- TEST_ERROR;
- } /* end if */
-
- /* Closing */
- if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR
+ /* Open the third dataset */
+ if((dsid_big = H5Dopen2(fid, DSET_FIXED_BIG, H5P_DEFAULT)) < 0) TEST_ERROR;
+ /* Get dataset dataspace */
+ if((sid_big = H5Dget_space(dsid_big)) < 0) TEST_ERROR;
+
+ /* Create dataspace for read buffer */
+ if((big_mem_id = H5Screate_simple(1, msize_big, NULL)) < 0) TEST_ERROR;
+
+ /* Select the random points for reading */
+ if(H5Sselect_elements (sid_big, H5S_SELECT_SET, POINTS_BIG, (const hsize_t *)coord_big_bytes) < 0) TEST_ERROR;
+ /* Read from dataset */
+ if(H5Dread(dsid_big, H5T_NATIVE_INT, big_mem_id, sid_big, H5P_DEFAULT, rbuf_big) < 0) TEST_ERROR;
+
+ /* Verify that written and read data are the same */
+ for(i = 0; i < POINTS_BIG; i++)
+ if(rbuf_big[i] != wbuf_big[i]) {
+ 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 */
+
+ /* Closing */
+ if(H5Dclose(dsid_big) < 0) FAIL_STACK_ERROR
if(H5Sclose(sid_big) < 0) FAIL_STACK_ERROR
if(H5Sclose(big_mem_id) < 0) FAIL_STACK_ERROR
@@ -9641,13 +9978,13 @@ test_fixed_array(hid_t fapl)
/* Close everything */
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
- /* Get the size of the file */
- if((file_size = h5_get_file_size(filename, fapl)) < 0)
- TEST_ERROR
+ /* Get the size of the file */
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
+ TEST_ERROR
- /* Verify the file is correct size */
- if(file_size != empty_size)
- TEST_ERROR
+ /* Verify the file is correct size */
+ if(file_size != empty_size)
+ TEST_ERROR
} /* end for */
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -9658,8 +9995,17 @@ test_fixed_array(hid_t fapl)
HDfree(wbuf_big);
HDfree(rbuf_big);
+ HDfree(chunks);
+ HDfree(chunks_big);
+ HDfree(coord);
+ HDfree(coord_big);
+ HDfree(chunks_bytes);
+ HDfree(chunks_big_bytes);
+ HDfree(coord_bytes);
+ HDfree(coord_big_bytes);
+
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -9669,31 +10015,39 @@ error:
H5Sclose(mem_id);
H5Fclose(fid);
} H5E_END_TRY;
- if(wbuf_big)
- HDfree(wbuf_big);
- if(rbuf_big)
- HDfree(rbuf_big);
- return -1;
+
+ HDfree(wbuf_big);
+ HDfree(rbuf_big);
+ HDfree(chunks);
+ HDfree(chunks_big);
+ HDfree(coord);
+ HDfree(coord_big);
+ HDfree(chunks_bytes);
+ HDfree(chunks_big_bytes);
+ HDfree(coord_bytes);
+ HDfree(coord_big_bytes);
+
+ return FAIL;
} /* end test_fixed_array() */
-
+
/*-------------------------------------------------------------------------
* Function: test_single_chunk
*
* Purpose: Tests support for Single Chunk indexing type
*
- * Create the following 2 datasets:
- * 1) chunked dataset with NULL max dims and cur_dims = chunk_dims
- * 2) chunked dataset with cur_dims = max_dims = chunk_dims
+ * Create the following 2 datasets:
+ * 1) chunked dataset with NULL max dims and cur_dims = chunk_dims
+ * 2) chunked dataset with cur_dims = max_dims = chunk_dims
*
* Repeat the following test with/without compression filter
* Repeat the following test with H5D_ALLOC_TIME_EARLY/H5D_ALLOC_TIME_LATE/H5D_ALLOC_TIME_INCR
- * For the old format,
- * verify that v1 btree indexing type is used for
- * all datasets with all settings
+ * For the old format,
+ * verify that v1 btree indexing type is used for
+ * all datasets with all settings
* For the new format:
- * Verify that Single Chunk indexing type is used for
- * all datasets with all settings
+ * Verify that Single Chunk indexing type is used for
+ * all datasets with all settings
*
* Return: Success: 0
* Failure: -1
@@ -9705,30 +10059,30 @@ error:
static herr_t
test_single_chunk(hid_t fapl)
{
- char filename[FILENAME_BUF_SIZE]; /* File name */
+ char filename[FILENAME_BUF_SIZE]; /* File name */
hid_t fid = -1; /* File ID */
hid_t dcpl = -1; /* Dataset creation property list ID */
hid_t t_dcpl = -1; /* Dataset creation property list ID */
- hid_t sid = -1, sid_max = -1; /* Dataspace ID for dataset with fixed dimensions */
- hid_t did = -1, did_max = -1; /* Dataset ID for dataset with fixed dimensions */
- hsize_t dim2[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */
+ hid_t sid = -1, sid_max = -1; /* Dataspace ID for dataset with fixed dimensions */
+ hid_t did = -1, did_max = -1; /* Dataset ID for dataset with fixed dimensions */
+ hsize_t dim2[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */
hsize_t t_dim2[2] = {DSET_TMP_DIM1, DSET_TMP_DIM2}; /* Dataset dimensions */
int *wbuf = NULL; /* write buffer */
int *t_wbuf = NULL; /* write buffer */
- int *rbuf = NULL; /* read buffer */
+ int *rbuf = NULL; /* read buffer */
int *t_rbuf = NULL; /* read buffer */
- H5D_chunk_index_t idx_type; /* Dataset chunk index type */
- H5F_libver_t low, high; /* File format bounds */
+ H5D_chunk_index_t idx_type; /* Dataset chunk index type */
+ H5F_libver_t low, high; /* File format bounds */
H5D_alloc_time_t alloc_time; /* Storage allocation time */
#ifdef H5_HAVE_FILTER_DEFLATE
- unsigned compress; /* Whether chunks should be compressed */
+ unsigned compress; /* Whether chunks should be compressed */
#endif /* H5_HAVE_FILTER_DEFLATE */
- size_t n, i; /* local index variables */
- herr_t ret; /* Generic return value */
+ size_t n, i; /* local index variables */
+ herr_t ret; /* Generic return value */
h5_stat_size_t empty_size; /* Size of an empty file */
h5_stat_size_t file_size; /* Size of each file created */
@@ -9760,10 +10114,10 @@ test_single_chunk(hid_t fapl)
TEST_ERROR
for(i = n = 0; i < (DSET_DIM1 * DSET_DIM2); i++)
- wbuf[i] = (int)n++;
+ wbuf[i] = (int)n++;
for(i = n = 0; i < (DSET_TMP_DIM1* DSET_TMP_DIM2); i++)
- t_wbuf[i] = (int)n++;
+ t_wbuf[i] = (int)n++;
#ifdef H5_HAVE_FILTER_DEFLATE
/* Loop over compressing chunks */
@@ -9771,7 +10125,7 @@ test_single_chunk(hid_t fapl)
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Loop over storage allocation time */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
@@ -9780,18 +10134,18 @@ test_single_chunk(hid_t fapl)
if((t_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
/* Set chunking */
- if((ret = H5Pset_chunk(dcpl, 2, dim2)) < 0)
- FAIL_PUTS_ERROR(" Problem with setting chunk.")
+ if((ret = H5Pset_chunk(dcpl, 2, dim2)) < 0)
+ FAIL_PUTS_ERROR(" Problem with setting chunk.")
- if((ret = H5Pset_chunk(t_dcpl, 2, t_dim2)) < 0)
- FAIL_PUTS_ERROR(" Problem with setting chunk.")
+ if((ret = H5Pset_chunk(t_dcpl, 2, t_dim2)) < 0)
+ FAIL_PUTS_ERROR(" Problem with setting chunk.")
#ifdef H5_HAVE_FILTER_DEFLATE
/* Check if we should compress the chunks */
if(compress) {
if(H5Pset_deflate(dcpl, 9) < 0) FAIL_STACK_ERROR
if(H5Pset_deflate(t_dcpl, 9) < 0) FAIL_STACK_ERROR
- }
+ }
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Set fill time */
@@ -9802,94 +10156,94 @@ test_single_chunk(hid_t fapl)
if(H5Pset_alloc_time(dcpl, alloc_time) < 0) FAIL_STACK_ERROR
if(H5Pset_alloc_time(t_dcpl, alloc_time) < 0) FAIL_STACK_ERROR
- /* Create first dataset with cur and max dimensions */
- if((sid_max = H5Screate_simple(2, dim2, dim2)) < 0) FAIL_STACK_ERROR
- did_max = H5Dcreate2(fid, DSET_SINGLE_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if(did_max < 0)
- FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.")
-
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(did_max, &idx_type) < 0) FAIL_STACK_ERROR
-
- /* Chunk index type depends on whether we are using the latest version of the format */
- if(low == H5F_LIBVER_LATEST) {
- if(idx_type != H5D_CHUNK_IDX_SINGLE)
- FAIL_PUTS_ERROR("should be using Single Chunk indexing");
- } /* end if */
- else {
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- } /* end else */
-
- /* Write into dataset */
- if(H5Dwrite(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
-
- /* Closing */
- if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR
- if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR
-
- /* Create second dataset with curr dim but NULL max dim */
- if((sid = H5Screate_simple(2, t_dim2, NULL)) < 0) FAIL_STACK_ERROR
- did = H5Dcreate2(fid, DSET_SINGLE_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, t_dcpl, H5P_DEFAULT);
- if(did < 0)
- FAIL_PUTS_ERROR(" Creating Chunked Dataset.")
-
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR
-
- /* Chunk index type depends on whether we are using the latest version of the format */
- if(low == H5F_LIBVER_LATEST) {
- if(idx_type != H5D_CHUNK_IDX_SINGLE)
- FAIL_PUTS_ERROR("should be using Single Chunk indexing");
- } else {
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index");
- } /* end else */
-
- /* Write into dataset */
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, t_wbuf) < 0) TEST_ERROR;
-
- /* Closing */
- if(H5Dclose(did) < 0) FAIL_STACK_ERROR
- if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
-
- /* Open the first dataset */
- if((did_max = H5Dopen2(fid, DSET_SINGLE_MAX, H5P_DEFAULT)) < 0) TEST_ERROR;
-
- /* Read from dataset */
- if(H5Dread(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
-
- /* 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",
- __LINE__,(unsigned)i,wbuf[i],(unsigned)i,rbuf[i]);
- TEST_ERROR;
- } /* end if */
-
- /* Closing */
- if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR
-
- /* Open the second dataset */
- if((did = H5Dopen2(fid, DSET_SINGLE_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR;
-
- HDmemset(rbuf, 0, sizeof(int) * (DSET_DIM1 * DSET_DIM2));
-
- /* Read from dataset */
- if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, t_rbuf) < 0) TEST_ERROR;
-
- /* 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",
- __LINE__,(unsigned)i,t_wbuf[i],(unsigned)i,t_rbuf[i]);
- TEST_ERROR;
- } /* end if */
-
- /* Closing */
- if(H5Dclose(did) < 0) FAIL_STACK_ERROR
-
- /* Delete datasets */
+ /* Create first dataset with cur and max dimensions */
+ if((sid_max = H5Screate_simple(2, dim2, dim2)) < 0) FAIL_STACK_ERROR
+ did_max = H5Dcreate2(fid, DSET_SINGLE_MAX, H5T_NATIVE_INT, sid_max, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if(did_max < 0)
+ FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.")
+
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(did_max, &idx_type) < 0) FAIL_STACK_ERROR
+
+ /* Chunk index type depends on whether we are using the latest version of the format */
+ if(low == H5F_LIBVER_LATEST) {
+ if(idx_type != H5D_CHUNK_IDX_SINGLE)
+ FAIL_PUTS_ERROR("should be using Single Chunk indexing");
+ } /* end if */
+ else {
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } /* end else */
+
+ /* Write into dataset */
+ if(H5Dwrite(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid_max) < 0) FAIL_STACK_ERROR
+
+ /* Create second dataset with curr dim but NULL max dim */
+ if((sid = H5Screate_simple(2, t_dim2, NULL)) < 0) FAIL_STACK_ERROR
+ did = H5Dcreate2(fid, DSET_SINGLE_NOMAX, H5T_NATIVE_INT, sid, H5P_DEFAULT, t_dcpl, H5P_DEFAULT);
+ if(did < 0)
+ FAIL_PUTS_ERROR(" Creating Chunked Dataset.")
+
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR
+
+ /* Chunk index type depends on whether we are using the latest version of the format */
+ if(low == H5F_LIBVER_LATEST) {
+ if(idx_type != H5D_CHUNK_IDX_SINGLE)
+ FAIL_PUTS_ERROR("should be using Single Chunk indexing");
+ } else {
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index");
+ } /* end else */
+
+ /* Write into dataset */
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, t_wbuf) < 0) TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+
+ /* Open the first dataset */
+ if((did_max = H5Dopen2(fid, DSET_SINGLE_MAX, H5P_DEFAULT)) < 0) TEST_ERROR;
+
+ /* Read from dataset */
+ if(H5Dread(did_max, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR;
+
+ /* Verify that written and read data are the same */
+ for(i = 0; i < (DSET_DIM1 * DSET_DIM2); i++)
+ if(rbuf[i] != wbuf[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 */
+
+ /* Closing */
+ if(H5Dclose(did_max) < 0) FAIL_STACK_ERROR
+
+ /* Open the second dataset */
+ if((did = H5Dopen2(fid, DSET_SINGLE_NOMAX, H5P_DEFAULT)) < 0) TEST_ERROR;
+
+ HDmemset(rbuf, 0, sizeof(int) * (DSET_DIM1 * DSET_DIM2));
+
+ /* Read from dataset */
+ if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, t_rbuf) < 0) TEST_ERROR;
+
+ /* 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]) {
+ 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 */
+
+ /* Closing */
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
+
+ /* Delete datasets */
if(H5Ldelete(fid, DSET_SINGLE_NOMAX, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Ldelete(fid, DSET_SINGLE_MAX, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -9909,6 +10263,7 @@ test_single_chunk(hid_t fapl)
} /* end for */
#endif /* H5_HAVE_FILTER_DEFLATE */
+
/* Release buffers */
HDfree(wbuf);
HDfree(rbuf);
@@ -9916,7 +10271,7 @@ test_single_chunk(hid_t fapl)
HDfree(t_rbuf);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -9936,25 +10291,25 @@ error:
HDfree(t_wbuf);
if(t_rbuf)
HDfree(t_rbuf);
- return -1;
+ return FAIL;
} /* end test_single_chunk() */
-
+
/*-------------------------------------------------------------------------
*
- * test_idx_compatible():
- * Verify that the library can read datasets created with
- * 1.6/1.8 library that use the B-tree indexing method.
+ * test_idx_compatible():
+ * Verify that the library can read datasets created with
+ * 1.6/1.8 library that use the B-tree indexing method.
*
* Programmer: Vailin Choi; 26th August, 2009
*
*-------------------------------------------------------------------------
*/
-static herr_t
+static herr_t
test_idx_compatible(void)
{
- hid_t fid = -1; /* File id */
- hid_t did = -1; /* Dataset id */
+ hid_t fid = -1; /* File id */
+ hid_t did = -1; /* Dataset id */
const char *filename = NULL; /* old test file name */
unsigned j; /* Local index variable */
H5D_chunk_index_t idx_type; /* Chunked dataset index type */
@@ -9964,53 +10319,53 @@ test_idx_compatible(void)
for(j = 0; j < NELMTS(OLD_FILENAME); j++) {
- /* Generate correct name for test file by prepending the source path */
- filename = H5_get_srcdir_filename(OLD_FILENAME[j]);
+ /* Generate correct name for test file by prepending the source path */
+ filename = H5_get_srcdir_filename(OLD_FILENAME[j]);
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ /* Open the file */
+ if((fid = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ TEST_ERROR
- /* Should be able to read the dataset w/o filter created under 1.8/1.6 */
- if((did = H5Dopen2(fid, DSET, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ /* Should be able to read the dataset w/o filter created under 1.8/1.6 */
+ if((did = H5Dopen2(fid, DSET, H5P_DEFAULT)) < 0)
+ TEST_ERROR
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR
- /* Verify index type */
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index")
+ /* Verify index type */
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index")
- if(H5Dclose(did) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
- /* Should be able to read the dataset w/ filter created under 1.8/1.6 */
- if((did = H5Dopen2(fid, DSET_FILTER, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ /* Should be able to read the dataset w/ filter created under 1.8/1.6 */
+ if((did = H5Dopen2(fid, DSET_FILTER, H5P_DEFAULT)) < 0)
+ TEST_ERROR
- /* Get the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR
+ /* Get the chunk index type */
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR
- /* Verify index type */
- if(idx_type != H5D_CHUNK_IDX_BTREE)
- FAIL_PUTS_ERROR("should be using v1 B-tree as index")
+ /* Verify index type */
+ if(idx_type != H5D_CHUNK_IDX_BTREE)
+ FAIL_PUTS_ERROR("should be using v1 B-tree as index")
- if(H5Dclose(did) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
- /* Close the file */
- if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+ /* Close the file */
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
}
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Dclose(did);
- H5Fclose(fid);
+ H5Fclose(fid);
} H5E_END_TRY;
- return -1;
-} /* test_idx_compatible */
+ return FAIL;
+} /* end test_idx_compatible() */
/*-------------------------------------------------------------------------
*
@@ -10140,7 +10495,7 @@ test_unfiltered_edge_chunks(hid_t fapl)
TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10149,10 +10504,10 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
-} /* test_unfiltered_edge_chunks */
+ return FAIL;
+} /* end test_unfiltered_edge_chunks() */
+
-
/*-------------------------------------------------------------------------
* Function: test_large_chunk_shrink
*
@@ -10254,7 +10609,7 @@ test_large_chunk_shrink(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10264,14 +10619,14 @@ error:
H5Sclose(scalar_sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_large_chunk_shrink() */
-
+
/*-------------------------------------------------------------------------
* Function: test_zero_dim_dset
*
- * Purpose: Tests support for reading a 1D chunled dataset with
+ * Purpose: Tests support for reading a 1D chunked dataset with
* dimension size = 0.
*
* Return: Success: 0
@@ -10292,44 +10647,63 @@ test_zero_dim_dset(hid_t fapl)
hid_t dsid = -1; /* Dataset ID */
hsize_t dim, chunk_dim; /* Dataset and chunk dimensions */
int data[1];
+ H5F_libver_t low, high; /* File format bounds */
+ herr_t ret; /* Generic return value */
- TESTING("shrinking large chunk");
+ TESTING("chunked dataset with zero dimension");
- h5_fixname(FILENAME[16], fapl, filename, sizeof filename);
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combination, and verify support for reading a 1D
+ chunked dataset with dimension size = 0 */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- /* Create file */
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ /* Set version bounds before opening the file */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
- /* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
- /* Set 1 chunk size */
- chunk_dim = 1;
- if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR
+ h5_fixname(FILENAME[16], fapl, filename, sizeof filename);
- /* Create 1D dataspace with 0 dim size */
- dim = 0;
- if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR
+ /* Create file */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- /* Create chunked dataset */
- if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ /* Create dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
- /* write 0 elements from dataset */
- if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+ /* Set 1 chunk size */
+ chunk_dim = 1;
+ if(H5Pset_chunk(dcpl, 1, &chunk_dim) < 0) FAIL_STACK_ERROR
- /* Read 0 elements from dataset */
- if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+ /* Create 1D dataspace with 0 dim size */
+ dim = 0;
+ if((sid = H5Screate_simple(1, &dim, NULL)) < 0) FAIL_STACK_ERROR
- /* Close everything */
- if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+ /* Create chunked dataset */
+ if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ /* write 0 elements from dataset */
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+
+ /* Read 0 elements from dataset */
+ if(H5Dread(dsid, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
+
+ /* Close everything */
+ if(H5Sclose(sid) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(dsid) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+
+ } /* end for high */
+ } /* end for low */
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10338,17 +10712,17 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_zero_dim_dset() */
-
+
/*-------------------------------------------------------------------------
* Function: test_swmr_non_latest
*
* Purpose: Checks that a file created with either:
- * (a) SWMR-write + non-latest-format
- * (b) write + latest format
- * will generate datset with latest chunk indexing type.
+ * (a) SWMR-write + non-latest-format
+ * (b) write + latest format
+ * will generate datset with latest chunk indexing type.
*
* Return: Success: 0
* Failure: -1
@@ -10359,59 +10733,60 @@ static herr_t
test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
{
char filename[FILENAME_BUF_SIZE];
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t dcpl = -1; /* Dataset creation property list ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t did = -1; /* Dataset ID */
- hsize_t dim[1], dims2[2]; /* Size of dataset */
- hsize_t max_dim[1], max_dims2[2]; /* Maximum size of dataset */
- hsize_t chunk_dim[1], chunk_dims2[2]; /* Chunk dimensions */
- H5D_chunk_index_t idx_type; /* Chunk index type */
- int data; /* Data to be written to the dataset */
- H5F_libver_t low; /* File format low bound */
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t did = -1; /* Dataset ID */
+ hsize_t dim[1], dims2[2]; /* Size of dataset */
+ hsize_t max_dim[1], max_dims2[2]; /* Maximum size of dataset */
+ hsize_t chunk_dim[1], chunk_dims2[2]; /* Chunk dimensions */
+ H5D_chunk_index_t idx_type; /* Chunk index type */
+ int data; /* Data to be written to the dataset */
+ H5F_libver_t low; /* File format low bound */
TESTING("File created with write+latest-format/SWMR-write+non-latest-format: dataset with latest chunk index");
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
/* Check if we are using the latest version of the format */
- if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
+ if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
FAIL_STACK_ERROR
h5_fixname(FILENAME[18], fapl, filename, sizeof filename);
if(low == H5F_LIBVER_LATEST) {
/* Create file with write+latest-format */
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- } else {
+ }
+ else {
/* Create file with SWMR-write+non-latest-format */
- if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
} /* end else */
/* Create a chunked dataset: this will use extensible array chunk indexing */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
chunk_dim[0] = 6;
- if(H5Pset_chunk(dcpl, 1, chunk_dim) < 0)
+ if(H5Pset_chunk(dcpl, 1, chunk_dim) < 0)
FAIL_STACK_ERROR
dim[0] = 1;
max_dim[0] = H5S_UNLIMITED;
- if((sid = H5Screate_simple(1, dim, max_dim)) < 0)
+ if((sid = H5Screate_simple(1, dim, max_dim)) < 0)
FAIL_STACK_ERROR
- if((did = H5Dcreate2(fid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Write to the dataset */
@@ -10420,9 +10795,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR
/* Verify the dataset's indexing type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR
- if(idx_type != H5D_CHUNK_IDX_EARRAY)
+ if(idx_type != H5D_CHUNK_IDX_EARRAY)
FAIL_PUTS_ERROR("created dataset not indexed by extensible array")
/* Closing */
@@ -10432,7 +10807,7 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
/* Open the file again */
- if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
FAIL_STACK_ERROR
/* Open the dataset in the file */
@@ -10440,9 +10815,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR
/* Verify the dataset's indexing type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR
- if(idx_type != H5D_CHUNK_IDX_EARRAY)
+ if(idx_type != H5D_CHUNK_IDX_EARRAY)
FAIL_PUTS_ERROR("created dataset not indexed by extensible array")
/* Read from the dataset and verify data read is correct */
@@ -10459,25 +10834,25 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR
/* Create a chunked dataset in the group: this will use v2 B-tree chunk indexing */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
chunk_dims2[0] = chunk_dims2[1] = 10;
- if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0)
+ if(H5Pset_chunk(dcpl, 2, chunk_dims2) < 0)
FAIL_STACK_ERROR
dims2[0] = dims2[1] = 1;
max_dims2[0] = max_dims2[1] = H5S_UNLIMITED;
- if((sid = H5Screate_simple(2, dims2, max_dims2)) < 0)
+ if((sid = H5Screate_simple(2, dims2, max_dims2)) < 0)
FAIL_STACK_ERROR
- if((did = H5Dcreate2(gid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(gid, DSET_CHUNKED_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Verify the dataset's indexing type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR
- if(idx_type != H5D_CHUNK_IDX_BT2)
+ if(idx_type != H5D_CHUNK_IDX_BT2)
FAIL_PUTS_ERROR("created dataset not indexed by v2 B-tree")
/* Closing */
@@ -10500,9 +10875,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR
/* Verify the dataset's indexing type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR
- if(idx_type != H5D_CHUNK_IDX_BT2)
+ if(idx_type != H5D_CHUNK_IDX_BT2)
FAIL_PUTS_ERROR("created dataset not indexed by v2 B-tree")
/* Closing */
@@ -10520,9 +10895,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR
/* Verify the dataset's indexing type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR
- if(idx_type != H5D_CHUNK_IDX_EARRAY)
+ if(idx_type != H5D_CHUNK_IDX_EARRAY)
FAIL_PUTS_ERROR("created dataset not indexed by extensible array")
/* Close the dataset */
@@ -10537,9 +10912,9 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR
/* Verify the dataset's indexing type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR
- if(idx_type != H5D_CHUNK_IDX_BT2)
+ if(idx_type != H5D_CHUNK_IDX_BT2)
FAIL_PUTS_ERROR("created dataset not indexed by v2 B-tree")
/* Write to the dataset in the group */
@@ -10553,7 +10928,7 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
/* Open the file again with SWMR read access */
- if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
+ if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0)
FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
@@ -10577,7 +10952,7 @@ test_swmr_non_latest(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10587,10 +10962,10 @@ error:
H5Gclose(gid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* test_swmr_non_latest() */
-
+
/*-------------------------------------------------------------------------
* Function: test_earray_hdr_fd
*
@@ -10618,18 +10993,18 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
const hsize_t maxshape[1] = { H5S_UNLIMITED };
const hsize_t chunk[1] = { 8 };
const int buffer[8] = {0, 1, 2, 3, 4, 5, 6, 7};
- H5O_info_t info;
+ H5O_info2_t info;
TESTING("Extensible array chunk index header flush dependencies handled correctly");
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10653,7 +11028,7 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR;
/* Verify the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR;
if(idx_type != H5D_CHUNK_IDX_EARRAY)
FAIL_PUTS_ERROR("should be using extensible array as index");
@@ -10683,9 +11058,9 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR;
/* The second call triggered a bug in the library (JIRA issue: SWMR-95) */
- if(H5Oget_info_by_name(fid, DSET_EARRAY_HDR_FD, &info, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(fid, DSET_EARRAY_HDR_FD, &info, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if(H5Oget_info_by_name(fid, DSET_EARRAY_HDR_FD, &info, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(fid, DSET_EARRAY_HDR_FD, &info, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
if(H5Pclose(fapl) < 0)
@@ -10695,7 +11070,7 @@ test_earray_hdr_fd(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10707,10 +11082,10 @@ error:
H5Sclose(sid);
H5Sclose(msid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* test_earray_hdr_fd() */
-
+
/*-------------------------------------------------------------------------
* Function: test_farray_hdr_fd
*
@@ -10738,18 +11113,18 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
const hsize_t maxshape[1] = { 64 };
const hsize_t chunk[1] = { 8 };
const int buffer[8] = {0, 1, 2, 3, 4, 5, 6, 7};
- H5O_info_t info;
+ H5O_info2_t info;
TESTING("Fixed array chunk index header flush dependencies handled correctly");
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10773,7 +11148,7 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR;
/* Verify the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR;
if(idx_type != H5D_CHUNK_IDX_FARRAY)
FAIL_PUTS_ERROR("should be using fixed array as index");
@@ -10803,9 +11178,9 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR;
/* The second call triggered a bug in the library (JIRA issue: SWMR-95) */
- if(H5Oget_info_by_name(fid, DSET_FARRAY_HDR_FD, &info, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(fid, DSET_FARRAY_HDR_FD, &info, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if(H5Oget_info_by_name(fid, DSET_FARRAY_HDR_FD, &info, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(fid, DSET_FARRAY_HDR_FD, &info, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
if(H5Pclose(fapl) < 0)
@@ -10815,7 +11190,7 @@ test_farray_hdr_fd(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10827,10 +11202,10 @@ error:
H5Sclose(sid);
H5Sclose(msid);
} H5E_END_TRY;
- return -1;
-} /* test_farray_hdr_fd() */
+ return FAIL;
+} /* end test_farray_hdr_fd() */
+
-
/*-------------------------------------------------------------------------
* Function: test_bt2_hdr_fd
*
@@ -10858,18 +11233,18 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
const hsize_t maxshape[2] = { H5S_UNLIMITED, H5S_UNLIMITED };
const hsize_t chunk[2] = { 8, 8 };
const int buffer[8] = {0, 1, 2, 3, 4, 5, 6, 7};
- H5O_info_t info;
+ H5O_info2_t info;
TESTING("Version 2 B-tree chunk index header flush dependencies handled correctly");
/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
*/
- if(!H5FD_supports_swmr_test(env_h5_driver)) {
+ if(!H5FD__supports_swmr_test(env_h5_driver)) {
SKIPPED();
HDputs(" Test skipped due to VFD not supporting SWMR I/O.");
- return 0;
- } /* end if */
+ return SUCCEED;
+ }
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR;
@@ -10893,7 +11268,7 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR;
/* Verify the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
FAIL_STACK_ERROR;
if(idx_type != H5D_CHUNK_IDX_BT2)
FAIL_PUTS_ERROR("should be using fixed array as index");
@@ -10923,9 +11298,9 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
FAIL_STACK_ERROR;
/* The second call triggered a bug in the library (JIRA issue: SWMR-95) */
- if(H5Oget_info_by_name(fid, DSET_BT2_HDR_FD, &info, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(fid, DSET_BT2_HDR_FD, &info, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if(H5Oget_info_by_name(fid, DSET_BT2_HDR_FD, &info, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(fid, DSET_BT2_HDR_FD, &info, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
if(H5Pclose(fapl) < 0)
@@ -10935,7 +11310,7 @@ test_bt2_hdr_fd(const char *env_h5_driver, hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10947,10 +11322,10 @@ error:
H5Sclose(sid);
H5Sclose(msid);
} H5E_END_TRY;
- return -1;
-} /* test_bt2_hdr_fd() */
+ return FAIL;
+} /* end test_bt2_hdr_fd() */
+
-
/*-------------------------------------------------------------------------
* Function: test_storage_size
*
@@ -11331,7 +11706,7 @@ test_storage_size(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11341,14 +11716,14 @@ error:
H5Sclose(sid);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_storage_size() */
-
+
/*-------------------------------------------------------------------------
* Function: test_power2up
*
- * Purpose: Tests that the H5VM_power2up(n) function does not result in an
+ * Purpose: Tests that the H5VM_power2up(n) function does not result in an
* infinite loop when input n exceeds 2^63. (HDFFV-10217)
* H5VM_power2up() is used to calculate the next power of 2 for
* a dataset's scaled dimension sizes.
@@ -11388,12 +11763,12 @@ test_power2up(hid_t fapl)
sid = H5Screate_simple(2, dims, max_dims);
/* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
/* Set chunk size */
chunk_dims[0] = chunk_dims[1] = 1;
- if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
TEST_ERROR
/* Create chunked dataset */
@@ -11411,18 +11786,18 @@ test_power2up(hid_t fapl)
TEST_ERROR
/* Closing */
- if(H5Dclose(did) < 0)
+ if(H5Dclose(did) < 0)
TEST_ERROR
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
TEST_ERROR
- if(H5Pclose(dcpl) < 0)
+ if(H5Pclose(dcpl) < 0)
TEST_ERROR
- if(H5Fclose(fid) < 0)
+ if(H5Fclose(fid) < 0)
TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11432,10 +11807,10 @@ error:
H5Pclose(dcpl);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_power2up() */
-
+
/*-------------------------------------------------------------------------
* Function: test_scatter
*
@@ -11462,7 +11837,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; \
}
@@ -11744,16 +12119,16 @@ test_scatter(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_scatter() */
-
+
/*-------------------------------------------------------------------------
* Function: test_gather
*
@@ -11812,7 +12187,7 @@ gather_cb(const void *dst_buf, size_t dst_buf_bytes_used,
error:
return FAIL;
-}
+} /* end gather_cb() */
static herr_t
test_gather(void)
@@ -12106,16 +12481,16 @@ test_gather(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_gather() */
-
+
/*-------------------------------------------------------------------------
* Function: test_scatter_error
*
@@ -12146,7 +12521,7 @@ scatter_error_cb_fail(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/,
*src_buf_bytes_used = nelmts * sizeof(scatter_info->src_buf[0]);
return FAIL;
-}
+} /* end scatter_error_cb_fail() */
static herr_t
scatter_error_cb_null(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/,
@@ -12164,7 +12539,7 @@ scatter_error_cb_null(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/,
*src_buf_bytes_used = nelmts * sizeof(scatter_info->src_buf[0]);
return SUCCEED;
-}
+} /* end scatter_error_cb_null() */
static herr_t
scatter_error_cb_unalign(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*/,
@@ -12175,7 +12550,7 @@ scatter_error_cb_unalign(void **src_buf/*out*/, size_t *src_buf_bytes_used/*out*
*src_buf_bytes_used = *(size_t *)_src_buf_bytes_used;
return SUCCEED;
-}
+} /* endscatter_error_cb_unalign() */
static herr_t
test_scatter_error(void)
@@ -12309,16 +12684,16 @@ test_scatter_error(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_scatter_error() */
-
+
/*-------------------------------------------------------------------------
* Function: test_gather_error
*
@@ -12338,7 +12713,7 @@ gather_error_cb_fail(const void H5_ATTR_UNUSED *dst_buf,
size_t H5_ATTR_UNUSED dst_buf_bytes_used, void H5_ATTR_UNUSED *op_data)
{
return FAIL;
-}
+} /* end gather_error_cb_fail() */
static herr_t
test_gather_error(void)
@@ -12448,45 +12823,45 @@ test_gather_error(void)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
H5Sclose(sid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end test_gather_error() */
/*-------------------------------------------------------------------------
* DLS bug -- HDFFV-9672
*
- * The following functions replicate the test code provided by DLS to
+ * The following functions replicate the test code provided by DLS to
* expose bug hdffv-9672. All functions associated with this test
* have the prefix DLS_01_
*
* The note documenting the bug is reproduced below:
*
* ------------------------------------------------------
- *
+ *
* Hi,
* We've found an issue regarding fixed length strings.
*
- * If we create a chunked dataset of large fixed length strings
- * (up to 1kb per string) with small chunk sizes (~8 elements per
+ * If we create a chunked dataset of large fixed length strings
+ * (up to 1kb per string) with small chunk sizes (~8 elements per
* chunk) then the resulting dataset may not be read later.
- * This only happens if the file is created with LIBVER_LATEST
+ * This only happens if the file is created with LIBVER_LATEST
* for the version bounds.
*
* Calling H5Oget_info(...) on the dataset results in the following:
- *
- * H5Dearray.c:250: H5D__earray_crt_context: Assertion
+ *
+ * H5Dearray.c:250: H5D__earray_crt_context: Assertion
* `udata->chunk_size > 0' failed.
- *
+ *
* Example:
- * void create_data(...)
+ * void create_data(...)
* {
* ...
- *
+ *
* hsize_t chunks[1] = {8} ;
*
* err = H5Tset_size( tid, 256 );
@@ -12494,45 +12869,45 @@ error:
* err = H5Pset_chunk( dcpl, 1, chunks );
*
* H5Dcreate2( fid, "data", tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT );
- *
+ *
* // write data
- * }
- *
- * void read_data(...)
- * {
- * ...
- *
+ * }
+ *
+ * void read_data(...)
+ * {
+ * ...
+ *
* H5O_into_t info; status = H5Oget_info( did, &info ) // crash
- * ...
- * }
- *
- * If the size of the chunk is increased (usually matching the
- * string length) then this problem disappears.
- *
- * A full program that produces such a file (and crashes trying to
+ * ...
+ * }
+ *
+ * If the size of the chunk is increased (usually matching the
+ * string length) then this problem disappears.
+ *
+ * A full program that produces such a file (and crashes trying to
* read it) is attached.
- *
+ *
* Tested with 1.10.0-alpha1.
- *
+ *
* Regards,
- *
+ *
* Charles Mita
* Software Engineer
* Diamond Light Source Ltd.
* +44 1235 778029
*
* ------------------------------------------------------
- *
+ *
* The bug in question turned out to be caused by a failure to update
- * the enc_bytes_per_dim field in the layout if the size of the
- * underlying type required more bytes to encode than any of the
+ * the enc_bytes_per_dim field in the layout if the size of the
+ * underlying type required more bytes to encode than any of the
* chunk dimensions.
*
- * At least in debug builds, the following test code exposes the
+ * At least in debug builds, the following test code exposes the
* failure via an assertion failure.
*
- * Note that the test code make no attempt to run with different
- * file drivers, as the bug is in the actual on disk encoding of
+ * Note that the test code make no attempt to run with different
+ * file drivers, as the bug is in the actual on disk encoding of
* the chunk layout.
*
* JRM -- 2/5/16
@@ -12540,10 +12915,10 @@ error:
*-------------------------------------------------------------------------
*/
-#define DLS_01_DATASET "data"
-#define DLS_01_STR_SIZE 256
-#define DLS_01_CHUNK_SIZE 8
-#define DLS_01_DIMS 4
+#define DLS_01_DATASET "data"
+#define DLS_01_STR_SIZE 256
+#define DLS_01_CHUNK_SIZE 8
+#define DLS_01_DIMS 4
static herr_t dls_01_setup_file( hid_t fid );
static herr_t dls_01_write_data( hid_t fid, char* buffer );
@@ -12551,8 +12926,8 @@ static herr_t dls_01_read_stuff( hid_t fid );
static herr_t dls_01_main( void );
static herr_t
-dls_01_setup_file( hid_t fid ) {
-
+dls_01_setup_file( hid_t fid )
+{
int status = 0;
hid_t sid = 0, did = 0, tid = 0, dcpl = 0;
int ndims = 1;
@@ -12590,17 +12965,15 @@ dls_01_setup_file( hid_t fid ) {
status = H5Sclose( sid );
if ( status != 0 ) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
-
- return -1;
-
-} /* dls_01_setup_file */
+ return FAIL;
+} /* end dls_01_setup_file() */
static herr_t
-dls_01_write_data( hid_t fid, char* buffer ) {
-
+dls_01_write_data( hid_t fid, char* buffer )
+{
int status = 0;
hid_t did = 0, tid = 0;
hsize_t extent[1] = {4};
@@ -12626,56 +12999,55 @@ dls_01_write_data( hid_t fid, char* buffer ) {
status = H5Dclose( did );
if ( status != 0 ) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
-
- return -1;
-
-} /* dls_01_write_data */
+ return FAIL;
+} /* end dls_01_write_data() */
static herr_t
-dls_01_read_stuff( hid_t fid ) {
-
+dls_01_read_stuff(hid_t fid)
+{
int status = 0;
hid_t did = 0;
- H5O_info_t info;
+ H5O_info2_t info;
- did = H5Dopen2( fid, DLS_01_DATASET, H5P_DEFAULT );
- if ( did <= 0 ) TEST_ERROR
+ did = H5Dopen2(fid, DLS_01_DATASET, H5P_DEFAULT);
+ if(did <= 0)
+ TEST_ERROR
- status = H5Oget_info( did, &info );
- if ( status != 0 ) TEST_ERROR
+ status = H5Oget_info3(did, &info, H5O_INFO_BASIC);
+ if(status != 0)
+ TEST_ERROR
- status = H5Dclose( did );
- if ( status != 0 ) TEST_ERROR
+ status = H5Dclose(did);
+ if(status != 0)
+ TEST_ERROR
- return 0;
+ return SUCCEED;
error:
-
- return -1;
-
-} /* dls_01_read_stuff() */
+ return FAIL;
+} /* end dls_01_read_stuff() */
static herr_t
-dls_01_main( void ) {
-
+dls_01_main( void )
+{
char filename[512];
int status = 0;
hid_t fapl = 0, fid = 0;
- const char* strings[DLS_01_DIMS] =
- { "String 1", "Test string 2", "Another string", "Final String" };
+ const char* strings[DLS_01_DIMS] =
+ { "String 1", "Test string 2", "Another string", "Final String" };
char* buffer = NULL;
TESTING("Testing DLS bugfix 1");
- if ( NULL == h5_fixname(FILENAME[23], H5P_DEFAULT, filename,
+ if ( NULL == h5_fixname(FILENAME[23], H5P_DEFAULT, filename,
sizeof(filename)) )
- TEST_ERROR
+ TEST_ERROR
buffer = (char *)HDcalloc( DLS_01_DIMS, DLS_01_STR_SIZE );
- if ( NULL == buffer )
+ if ( NULL == buffer )
TEST_ERROR
HDstrcpy( buffer, strings[0] );
@@ -12693,10 +13065,10 @@ dls_01_main( void ) {
if ( fid <= 0 ) TEST_ERROR
if ( 0 != dls_01_setup_file( fid ) )
- goto error;
+ goto error;
if ( 0 != dls_01_write_data( fid, buffer ) )
- goto error;
+ goto error;
status = H5Fclose( fid );
if ( status != 0 ) TEST_ERROR
@@ -12705,7 +13077,7 @@ dls_01_main( void ) {
if ( fid <= 0 ) TEST_ERROR
if ( 0 != dls_01_read_stuff( fid ) )
- goto error;
+ goto error;
status = H5Fclose( fid );
if ( status != 0 ) TEST_ERROR
@@ -12717,15 +13089,12 @@ dls_01_main( void ) {
PASSED();
- return 0;
+ return SUCCEED;
error:
-
if ( buffer ) HDfree(buffer);
-
- return -1;
-
-} /* dls_01_main() */
+ return FAIL;
+} /* end dls_01_main() */
/*-------------------------------------------------------------------------
* Function: test_compact_open_close_dirty
@@ -12754,7 +13123,7 @@ test_compact_open_close_dirty(hid_t fapl)
hid_t dcpl = -1; /* Dataset creation property list */
hsize_t dims[1] = {10}; /* Dimension */
int wbuf[10]; /* Data buffer */
- char filename[FILENAME_BUF_SIZE]; /* Filename */
+ char filename[FILENAME_BUF_SIZE]; /* Filename */
int i; /* Local index variable */
hbool_t dirty; /* The dirty flag */
@@ -12770,15 +13139,15 @@ test_compact_open_close_dirty(hid_t fapl)
wbuf[i] = i;
/* Create dataspace */
- if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
TEST_ERROR
/* Set compact layout */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
TEST_ERROR
- if(H5Pset_layout(dcpl, H5D_COMPACT) < 0)
+ if(H5Pset_layout(dcpl, H5D_COMPACT) < 0)
TEST_ERROR
- if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0)
TEST_ERROR
/* Create a compact dataset */
@@ -12790,7 +13159,7 @@ test_compact_open_close_dirty(hid_t fapl)
TEST_ERROR
/* Close the dataset */
- if(H5Dclose(did) < 0)
+ if(H5Dclose(did) < 0)
TEST_ERROR
/* Verify the repeated open/close of the dataset will not fail */
@@ -12802,7 +13171,7 @@ test_compact_open_close_dirty(hid_t fapl)
TEST_ERROR
if(H5Dclose(did) < 0)
TEST_ERROR
- }
+ }
/* Open the dataset */
if((did = H5Dopen2(fid, DSET_COMPACT_MAX_NAME, H5P_DEFAULT)) < 0)
@@ -12817,11 +13186,11 @@ test_compact_open_close_dirty(hid_t fapl)
TEST_ERROR
/* Close the dataset */
- if(H5Dclose(did) < 0)
+ if(H5Dclose(did) < 0)
TEST_ERROR
/* Close the dataspace */
- if(H5Sclose(sid) < 0)
+ if(H5Sclose(sid) < 0)
TEST_ERROR
/* Close the dataset creation property list */
@@ -12833,7 +13202,7 @@ test_compact_open_close_dirty(hid_t fapl)
TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -12842,39 +13211,500 @@ error:
H5Dclose(did);
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
-} /* test_compact_open_close_dirty() */
+ return FAIL;
+} /* end test_compact_open_close_dirty() */
+
-
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: test_versionbounds
+ *
+ * Purpose: Tests various format versions.
+ * (Currently, only virtual dataset feature)
+ *
+ * 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
+ * of virtual dataset should only succeed in H5F_LIBVER_V110.
+ * -BMR, January 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+#define VDS_FNAME1 "virtual_file1"
+#define VDS_FNAME2 "virtual_file2"
+#define SRC_FNAME "source_file"
+#define SRC_DSET "src_dset"
+#define V_DSET "v_dset"
+static herr_t
+test_versionbounds(void)
+{
+ hid_t fapl = -1;
+ hid_t srcfile = -1; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t srcspace = -1; /* Source dataspaces */
+ hid_t vspace = -1; /* Virtual dset dataspaces */
+ hid_t srcdset = -1; /* Source datset */
+ hid_t vdset = -1; /* Virtual dataset */
+ hsize_t dims[1] = {3}; /* Data space current size */
+ char srcfilename[FILENAME_BUF_SIZE];
+ char vfilename1[FILENAME_BUF_SIZE];
+ char vfilename2[FILENAME_BUF_SIZE];
+ H5F_libver_t low, high; /* File format bounds */
+ herr_t ret; /* Generic return value */
+
+ TESTING("version bounds of datasets");
+
+ /* Create a copy of file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+
+ h5_fixname(VDS_FNAME1, fapl, vfilename1, sizeof vfilename1);
+ h5_fixname(VDS_FNAME2, fapl, vfilename2, sizeof vfilename2);
+ h5_fixname(SRC_FNAME, fapl, srcfilename, sizeof srcfilename);
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ if((srcspace = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace, srcfilename, SRC_DSET, srcspace) < 0)
+ TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds */
+ /* Create a source file and a dataset in it. Create a virtual file and
+ virtual dataset. Creation of virtual dataset should only succeed in
+ H5F_LIBVER_V110 */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds, skip for invalid low/high combination */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a source file and dataset */
+ if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ if((srcdset = H5Dcreate2(srcfile, SRC_DSET, H5T_NATIVE_INT, srcspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create a virtual file */
+ if((vfile = H5Fcreate(vfilename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create the virtual dataset */
+ H5E_BEGIN_TRY {
+ vdset = H5Dcreate2(vfile, V_DSET, H5T_NATIVE_INT, vspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ if (vdset > 0) /* dataset created successfully */
+ {
+ /* Virtual dataset is only available starting in V110 */
+ VERIFY(high >= H5F_LIBVER_V110, TRUE, "virtual dataset");
+
+ if(H5Dclose(vdset) < 0) TEST_ERROR
+ vdset = -1;
+ }
+
+ /* Close virtual file */
+ if(H5Fclose(vfile) < 0) TEST_ERROR
+ vfile = -1;
+
+ /* Close srcdset and srcfile */
+ if(H5Dclose(srcdset) < 0) TEST_ERROR
+ srcdset = -1;
+
+ if(H5Fclose(srcfile) < 0) TEST_ERROR
+ srcfile = -1;
+
+ } /* for high */
+ } /* for low */
+
+ /* Close dataspaces and properties */
+ if(H5Sclose(srcspace) < 0)
+ TEST_ERROR
+ srcspace = -1;
+ if(H5Sclose(vspace) < 0)
+ TEST_ERROR
+ vspace = -1;
+ if(H5Pclose(fapl) < 0)
+ TEST_ERROR
+ fapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+ PASSED();
+ return SUCCEED;
+
+ error:
+ H5E_BEGIN_TRY {
+ H5Sclose(srcspace);
+ H5Sclose(vspace);
+ H5Pclose(dcpl);
+ H5Pclose(fapl);
+ H5Dclose(srcdset);
+ H5Dclose(vdset);
+ H5Fclose(srcfile);
+ H5Fclose(vfile);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end test_versionbounds() */
+
+
+/*-----------------------------------------------------------------------------
+ * Function: test_object_header_minimization_dcpl
+ *
+ * Purpose: Test the "datset object header minimization" property as part of
+ * the DCPL.
+ *
+ * Return: Success/pass: 0
+ * Failure/error: -1
*
- * Purpose: Tests the dataset interface (H5D)
+ * Programmer: Jacob Smith
+ * 2018 August 15
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Changes: None.
+ *-----------------------------------------------------------------------------
+ */
+static herr_t
+test_object_header_minimization_dcpl(void)
+{
+ hid_t dcpl_id = -1;
+ hid_t file_id = -1;
+ char filename[FILENAME_BUF_SIZE] = "";
+ hbool_t minimize = FALSE;
+ herr_t ret;
+
+ TESTING("dcpl flags to minimize dataset object header");
+
+ /*********/
+ /* SETUP */
+ /*********/
+
+ if(NULL == h5_fixname(OHMIN_FILENAME_A, H5P_DEFAULT, filename, sizeof(filename)))
+ TEST_ERROR
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (file_id == H5I_INVALID_HID)
+ TEST_ERROR
+
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ if (dcpl_id == H5I_INVALID_HID)
+ TEST_ERROR
+
+ /*********/
+ /* TESTS */
+ /*********/
+
+ /* default value (not set explicitly)
+ */
+ 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 (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 (TRUE != minimize)
+ TEST_ERROR
+
+ /* error cases
+ */
+ H5E_BEGIN_TRY {
+ ret = H5Pget_dset_no_attrs_hint(-1, &minimize);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR /* Invalid DCPL ID should fail */
+
+ H5E_BEGIN_TRY {
+ ret = H5Pset_dset_no_attrs_hint(-1, FALSE);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR /* Invalid DCPL ID should fail */
+
+ H5E_BEGIN_TRY {
+ ret = H5Pset_dset_no_attrs_hint(-1, TRUE);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR /* Invalid DCPL ID should fail */
+
+ H5E_BEGIN_TRY {
+ ret = H5Pget_dset_no_attrs_hint(dcpl_id, NULL);
+ } H5E_END_TRY;
+ if (ret == SUCCEED)
+ TEST_ERROR /* NULL out pointer should fail */
+
+ /************/
+ /* TEARDOWN */
+ /************/
+
+ if (H5Fclose(file_id) == FAIL)
+ TEST_ERROR
+
+ if (H5Pclose(dcpl_id) == FAIL)
+ TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(dcpl_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end test_object_header_minimization_dcpl() */
+
+
+/*-----------------------------------------------------------------------------
+ * Function: test_0sized_dset_metadata_alloc
+ *
+ * Purpose: Tests the metadata allocation for 0-sized datasets.
+ *
+ * Return: Success/pass: 0
+ * Failure/error: -1
+ *
+ * Programmer: Quincey Koziol
+ * 2020 April 30
+ *
+ *-----------------------------------------------------------------------------
+ */
+static herr_t
+test_0sized_dset_metadata_alloc(hid_t fapl_id)
+{
+ char filename[FILENAME_BUF_SIZE] = "";
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id_copy = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t dcpl_id_copy = H5I_INVALID_HID;
+ hid_t dset_space_id = H5I_INVALID_HID;
+ hid_t buf_space_id = H5I_INVALID_HID;
+ unsigned new_format; /* Whether to use latest file format */
+
+ TESTING("allocation of metadata for 0-sized datasets");
+
+ /*********/
+ /* SETUP */
+ /*********/
+
+ if(NULL == h5_fixname(FILENAME[26], fapl_id, filename, sizeof(filename)))
+ FAIL_STACK_ERROR
+
+ /* Create DCPL for the dataset */
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+
+ /*************/
+ /* RUN TESTS */
+ /*************/
+
+ /* Iterate over file format versions */
+ for(new_format = FALSE; new_format <= TRUE; new_format++) {
+ H5D_layout_t layout; /* Dataset layout type */
+ H5D_alloc_time_t alloc_time; /* Storage allocation time */
+
+ /* Copy the file access property list */
+ if((fapl_id_copy = H5Pcopy(fapl_id)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Set the "use the latest version of the format" bounds for creating objects in the file */
+ if(new_format)
+ if(H5Pset_libver_bounds(fapl_id_copy, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ FAIL_STACK_ERROR
+
+ /* Create test file */
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id_copy)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Close the copy of the FAPL */
+ if(H5Pclose(fapl_id_copy) < 0)
+ FAIL_STACK_ERROR
+
+ /* Iterate over combinations of testing parameters */
+ for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
+ const hsize_t dims[1] = {0}; /* Dataset dimensions */
+ const hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dataset dimensions */
+ const hsize_t chunk_dims[1] = {100}; /* Chunk dimensions */
+ char dset_name[32]; /* Dataset name */
+ H5O_native_info_t nat_info; /* Information about the dataset */
+
+ /* Compact storage must have early allocation */
+ if(H5D_COMPACT == layout && H5D_ALLOC_TIME_EARLY != alloc_time)
+ continue;
+
+ /* Compose dataset name */
+ HDsnprintf(dset_name, sizeof(dset_name), "/Dataset-%u-%u", (unsigned)alloc_time, (unsigned)layout);
+
+ /* Set up DCPL */
+ if((dcpl_id_copy = H5Pcopy(dcpl_id)) < 0)
+ FAIL_STACK_ERROR
+ if(H5Pset_alloc_time(dcpl_id_copy, alloc_time) < 0)
+ FAIL_STACK_ERROR
+ if(H5Pset_layout(dcpl_id_copy, layout) < 0)
+ FAIL_STACK_ERROR
+ if(H5D_CHUNKED == layout)
+ if(H5Pset_chunk(dcpl_id_copy, 1, chunk_dims) < 0)
+ FAIL_STACK_ERROR
+
+ /* Create the dataspace for the dataset */
+ if((dset_space_id = H5Screate_simple(1, dims, (H5D_CHUNKED == layout ? max_dims : NULL))) < 0)
+ FAIL_STACK_ERROR
+
+ /* Create the dataset with the appropriate parameters */
+ if((dset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dset_space_id, H5P_DEFAULT, dcpl_id_copy, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Close objects used to create dataset */
+ if(H5Pclose(dcpl_id_copy) < 0)
+ FAIL_STACK_ERROR
+ if(H5Sclose(dset_space_id) < 0)
+ FAIL_STACK_ERROR
+
+ /* Retrieve & verify the dataset's index info */
+ HDmemset(&nat_info, 0, sizeof(nat_info));
+ if(H5Oget_native_info(dset_id, &nat_info, H5O_NATIVE_INFO_META_SIZE) < 0)
+ FAIL_STACK_ERROR
+ if(0 != nat_info.meta_size.obj.index_size)
+ FAIL_PUTS_ERROR("dataset index allocation size is non-zero")
+
+ /* If chunked, try extending and verify that the index is allocated */
+ if(H5D_CHUNKED == layout) {
+ const hsize_t new_dims[1] = {1500}; /* New dataset dimensions */
+ const hsize_t mem_dims[1] = {1}; /* Memory buffer dataset dimensions */
+ const hsize_t coord = 0; /* Dataset selection coordinate */
+ int val = 0; /* Data value */
+
+ /* Extend dataset */
+ if(H5Dset_extent(dset_id, new_dims) < 0)
+ FAIL_STACK_ERROR
+
+ /* Get the dataspace for the dataset & set single point selection */
+ if((dset_space_id = H5Dget_space(dset_id)) < 0)
+ FAIL_STACK_ERROR
+ if(H5Sselect_elements(dset_space_id, H5S_SELECT_SET, (size_t)1, (const hsize_t *)&coord) < 0)
+ FAIL_STACK_ERROR
+
+ /* Create memory dataspace, with only one element */
+ if((buf_space_id = H5Screate_simple(1, mem_dims, NULL)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Write the data to the dataset */
+ if(H5Dwrite(dset_id, H5T_NATIVE_INT, buf_space_id, dset_space_id, H5P_DEFAULT, &val) < 0)
+ FAIL_STACK_ERROR
+
+ /* Close objects used to perform I/O */
+ if(H5Sclose(dset_space_id) < 0)
+ FAIL_STACK_ERROR
+ if(H5Sclose(buf_space_id) < 0)
+ FAIL_STACK_ERROR
+
+ /* Retrieve & verify the dataset's index info */
+ HDmemset(&nat_info, 0, sizeof(nat_info));
+ if(H5Oget_native_info(dset_id, &nat_info, H5O_NATIVE_INFO_META_SIZE) < 0)
+ FAIL_STACK_ERROR
+ if(0 == nat_info.meta_size.obj.index_size)
+ FAIL_PUTS_ERROR("dataset index allocation size is zero")
+ } /* end if */
+
+ /* Close dataset */
+ if(H5Dclose(dset_id) < 0)
+ FAIL_STACK_ERROR
+ } /* end for */
+ } /* end for */
+
+ /* Close test file */
+ if(H5Fclose(file_id) < 0)
+ FAIL_STACK_ERROR
+ } /* end for */
+
+
+ /************/
+ /* TEARDOWN */
+ /************/
+
+ if(H5Pclose(dcpl_id) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(dset_space_id);
+ H5Pclose(buf_space_id);
+ H5Pclose(fapl_id_copy);
+ H5Pclose(dcpl_id_copy);
+ H5Pclose(dcpl_id);
+ H5Dclose(dset_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+} /* end test_0sized_dset_metadata_alloc() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests the dataset interface (H5D)
*
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: Robb Matzke
- * Tuesday, December 9, 1997
+ * Programmer: Robb Matzke
+ * Tuesday, December 9, 1997
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- char filename[FILENAME_BUF_SIZE];
- hid_t file, grp, fapl, fapl2;
- hid_t fcpl = -1, fcpl2 = -1;
+ char filename[FILENAME_BUF_SIZE];
+ hid_t file, grp, fapl, fapl2;
+ hid_t fcpl = -1, fcpl2 = -1;
unsigned new_format;
unsigned paged;
- int mdc_nelmts;
- size_t rdcc_nelmts;
- size_t rdcc_nbytes;
- double rdcc_w0;
- int nerrors = 0;
+ unsigned minimized_ohdr;
+ int mdc_nelmts;
+ size_t rdcc_nelmts;
+ size_t rdcc_nbytes;
+ double rdcc_w0;
+ int nerrors = 0;
const char *envval;
- 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 */
+ int i;
/* Don't run this test using certain file drivers */
envval = HDgetenv("HDF5_DRIVER");
@@ -12887,6 +13717,39 @@ main(void)
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
+ /* Initialize global arrays */
+ /* points */
+ if(NULL == (points_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (points = (int **)HDcalloc(DSET_DIM1, sizeof(points_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ points[i] = points_data + (i * DSET_DIM2);
+
+ /* check */
+ if(NULL == (check_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (check = (int **)HDcalloc(DSET_DIM1, sizeof(check_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ check[i] = check_data + (i * DSET_DIM2);
+
+ /* points_dbl */
+ if(NULL == (points_dbl_data = (double *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(double))))
+ TEST_ERROR;
+ if(NULL == (points_dbl = (double **)HDcalloc(DSET_DIM1, sizeof(points_dbl_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ points_dbl[i] = points_dbl_data + (i * DSET_DIM2);
+
+ /* check_dbl */
+ if(NULL == (check_dbl_data = (double *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(double))))
+ TEST_ERROR;
+ if(NULL == (check_dbl = (double **)HDcalloc(DSET_DIM1, sizeof(check_dbl_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ check_dbl[i] = check_dbl_data + (i * DSET_DIM2);
+
/* Testing setup */
h5_reset();
fapl = h5_fileaccess();
@@ -12923,113 +13786,122 @@ main(void)
if(!contig_addr_vfd && paged)
continue;
- /* 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 */
+ 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 */
- /* Create the file for this test */
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, my_fcpl, my_fapl)) < 0)
- goto error;
+ /* Create the file for this test */
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, my_fcpl, my_fapl)) < 0)
+ goto error;
- /* 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)");
+ }
- 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);
+ /* 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);
#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 */
+ 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 */
@@ -13043,27 +13915,53 @@ main(void)
nerrors += (test_scatter_error() < 0 ? 1 : 0);
nerrors += (test_gather_error() < 0 ? 1 : 0);
+ /* Tests version bounds using its own file */
+ nerrors += (test_versionbounds() < 0 ? 1 : 0);
+
+ nerrors += (test_object_header_minimization_dcpl() < 0 ? 1 : 0);
+
/* Run misc tests */
- nerrors += dls_01_main();
+ nerrors += (dls_01_main() < 0 ? 1 : 0);
+ nerrors += (test_0sized_dset_metadata_alloc(fapl) < 0 ? 1 : 0);
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
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 0;
+ HDfree(points);
+ HDfree(check);
+ HDfree(points_dbl);
+ HDfree(check_dbl);
+
+ HDfree(points_data);
+ HDfree(check_data);
+ HDfree(points_dbl_data);
+ HDfree(check_dbl_data);
+
+ HDexit(EXIT_SUCCESS);
error:
+ HDfree(points);
+ HDfree(check);
+ HDfree(points_dbl);
+ HDfree(check_dbl);
+
+ HDfree(points_data);
+ HDfree(check_data);
+ HDfree(points_dbl_data);
+ HDfree(check_dbl_data);
+
nerrors = MAX(1, nerrors);
- printf("***** %d DATASET TEST%s FAILED! *****\n",
+ HDprintf("***** %d DATASET TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- return 1;
-}
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/dt_arith.c b/test/dt_arith.c
index c7f2986..8d04770 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,25 +621,25 @@ 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;
}
/* Unregister the hard conversion from int to float. Verify the conversion
* is a soft conversion. */
- H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T__conv_int_float);
+ 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;
}
/* Register the hard conversion from int to float. Verify the conversion
* is a hard conversion. */
- H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T__conv_int_float);
+ 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,48 +748,48 @@ 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) {
- double x;
+ double x = 0.;
signed char y;
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,34 +806,34 @@ 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) {
- float x;
+ float x = 0.;
int y;
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,40 +2566,40 @@ 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*)hw));
+ HDprintf(" %29d\n", (int)*((signed char*)((void *)hw)));
break;
case INT_UCHAR:
- printf(" %29u\n", (unsigned)*((unsigned char*)hw));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw)));
break;
case INT_SHORT:
- printf(" %29hd\n", *((short*)hw));
+ HDprintf(" %29hd\n", *((short*)((void *)hw)));
break;
case INT_USHORT:
- printf(" %29hu\n", *((unsigned short*)hw));
+ HDprintf(" %29hu\n", *((unsigned short*)((void *)hw)));
break;
case INT_INT:
- printf(" %29d\n", *((int*)hw));
+ HDprintf(" %29d\n", *((int*)((void *)hw)));
break;
case INT_UINT:
- printf(" %29u\n", *((unsigned*)hw));
+ HDprintf(" %29u\n", *((unsigned*)((void *)hw)));
break;
case INT_LONG:
- printf(" %29ld\n", *((long*)hw));
+ HDprintf(" %29ld\n", *((long*)((void *)hw)));
break;
case INT_ULONG:
- printf(" %29lu\n", *((unsigned long*)hw));
+ HDprintf(" %29lu\n", *((unsigned long*)((void *)hw)));
break;
case INT_LLONG:
- HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw));
+ HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)((void *)hw)));
break;
case INT_ULLONG:
- HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw));
+ HDfprintf(stdout," %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)((void *)hw)));
break;
case FLT_FLOAT:
case FLT_DOUBLE:
@@ -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 = 0.;
+ 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 = 0.;
+ 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 = 0.;
+ 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 = 0.;
- 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 = 0.;
- 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 = 0.;
- 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,34 +3193,34 @@ 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;
+ float x = 0.;
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) {
- double x;
+ double x = 0.;
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)
} else {
- long double x;
+ long double x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(long double));
/* dst is largest float, no need to check underflow. */
check_mant[0] = (double)HDfrexpl(x, check_expo+0);
@@ -3264,56 +3258,56 @@ 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;
+ float x = 0.;
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;
+ double x = 0.;
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;
+ long double x = 0.;
HDmemcpy(&x, &saved[j*src_size], sizeof(long double));
HDfprintf(stdout," %29.20Le\n", x);
#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;
+ float x = 0.;
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;
+ double x = 0.;
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;
+ long double x = 0.;
HDmemcpy(&x, &buf[j*dst_size], sizeof(long double));
HDfprintf(stdout," %29.20Le\n", x);
#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,50 +4473,50 @@ 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*)hw));
+ HDprintf(" %29d\n", (int)*((signed char*)((void *)hw)));
break;
case INT_UCHAR:
- printf(" %29u\n", (unsigned)*((unsigned char*)hw));
+ HDprintf(" %29u\n", (unsigned)*((unsigned char*)((void *)hw)));
break;
case INT_SHORT:
- printf(" %29hd\n", *((short*)hw));
+ HDprintf(" %29hd\n", *((short*)((void *)hw)));
break;
case INT_USHORT:
- printf(" %29hu\n", *((unsigned short*)hw));
+ HDprintf(" %29hu\n", *((unsigned short*)((void *)hw)));
break;
case INT_INT:
- printf(" %29d\n", *((int*)hw));
+ HDprintf(" %29d\n", *((int*)((void *)hw)));
break;
case INT_UINT:
- printf(" %29u\n", *((unsigned int*)hw));
+ HDprintf(" %29u\n", *((unsigned int*)((void *)hw)));
break;
case INT_LONG:
- printf(" %29ld\n", *((long*)hw));
+ HDprintf(" %29ld\n", *((long*)((void *)hw)));
break;
case INT_ULONG:
- printf(" %29lu\n", *((unsigned long*)hw));
+ HDprintf(" %29lu\n", *((unsigned long*)((void *)hw)));
break;
case INT_LLONG:
- HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw));
+ HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)((void *)hw)));
break;
case INT_ULLONG:
- HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw));
+ HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)((void *)hw)));
break;
case FLT_FLOAT:
- printf(" %29f\n", (double)*((float*)hw));
+ HDprintf(" %29f\n", (double)*((float*)((void *)hw)));
break;
case FLT_DOUBLE:
- printf(" %29f\n", *((double*)hw));
+ HDprintf(" %29f\n", *((double*)((void *)hw)));
break;
#if H5_SIZEOF_LONG_DOUBLE !=0
case FLT_LDOUBLE:
- printf(" %29Lf\n", *((long double*)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);
@@ -4883,7 +4877,24 @@ run_fp_tests(const char *name)
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE);
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT);
+#else
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions",
+ name, "long double", "float");
+ HDprintf("%-70s", str);
+ SKIPPED();
+#if H5_SIZEOF_LONG_DOUBLE!=0
+ HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu.");
+#else
+ HDputs(" Test skipped due to disabled long double.");
+#endif
+ }
+#endif
+
nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE);
#endif
@@ -4893,23 +4904,39 @@ run_fp_tests(const char *name)
#if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE);
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT);
nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE);
+#else
+ {
+ char str[256]; /*string */
+
+ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions",
+ name, "long double", "float or double");
+ HDprintf("%-70s", str);
+ SKIPPED();
+#if H5_SIZEOF_LONG_DOUBLE!=0
+ HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu.");
+#else
+ HDputs(" Test skipped due to disabled long double.");
+#endif
+ }
+#endif
#endif
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:
@@ -4919,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);
@@ -4963,16 +4990,16 @@ run_int_fp_conv(const char *name)
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_INT, H5T_NATIVE_LDOUBLE);
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_LDOUBLE);
#if H5_SIZEOF_LONG!=H5_SIZEOF_INT
-#ifndef H5_LONG_TO_LDOUBLE_SPECIAL
+#if !defined(H5_LONG_TO_LDOUBLE_SPECIAL) && !defined(H5_DISABLE_SOME_LDOUBLE_CONV)
nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE);
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.");
@@ -4987,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.");
}
@@ -5000,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.");
}
@@ -5015,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:
@@ -5033,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++) {
@@ -5077,23 +5104,53 @@ run_fp_int_conv(const char *name)
#endif
#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_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);
+ 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 {
+#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_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 */
+
+ HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions",
+ name, "long double", "signed and unsigned char, short, int, long");
+ HDprintf("%-70s", str);
+ SKIPPED();
+#if H5_SIZEOF_LONG_DOUBLE!=0
+ HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu.");
+#else
+ HDputs(" Test skipped due to disabled long double.");
+#endif
+#endif
+ }
#if H5_SIZEOF_LONG!=H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE!=0
#ifndef H5_LDOUBLE_TO_LONG_SPECIAL
- nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG);
- nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG);
+ if(test_values != TEST_SPECIAL && test_values != TEST_NORMAL) {
+ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG);
+ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG);
+ } else {
+#ifndef H5_DISABLE_SOME_LDOUBLE_CONV
+ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG);
+ nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG);
+#endif
+ }
#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.");
@@ -5109,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.");
@@ -5126,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.");
@@ -5146,7 +5203,7 @@ run_fp_int_conv(const char *name)
return nerrors;
}
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -5170,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));
@@ -5178,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 */
@@ -5247,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 0381bb8..bc61232 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,11 +696,11 @@ 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");
}
- PASSED()
+ PASSED();
TESTING("data transform, trivial transform, with type conversion")
if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
@@ -708,11 +708,11 @@ 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")
}
- PASSED()
+ PASSED();
return 0;
error:
@@ -739,12 +739,12 @@ test_getset(const hid_t dxpl_id_c_to_f)
if(HDstrcmp(c_to_f, ptrgetTest) != 0)
FAIL_PUTS_ERROR(" ERROR: Data transform failed to match what was set\n")
- PASSED()
-
+ PASSED();
+
HDfree(ptrgetTest);
ptrgetTest = NULL;
- TESTING("data transform, read after reseting of transform property")
+ TESTING("data transform, read after resetting of transform property")
if(H5Pset_data_transform(dxpl_id_c_to_f, simple) < 0)
TEST_ERROR
@@ -752,14 +752,14 @@ 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")
}
- PASSED()
+ PASSED();
TESTING("H5Pget_data_transform, after resetting transform property")
@@ -767,10 +767,10 @@ 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()
+ PASSED();
HDfree(ptrgetTest);
ptrgetTest = NULL;
@@ -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 */
@@ -806,8 +806,8 @@ test_set(void)
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
if(H5Pget_data_transform(dxpl_id, ptrgetTest, HDstrlen(str) + 1) < 0)
- PASSED()
- else
+ PASSED();
+ 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 7e8047d..0f95830 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -18,12 +18,12 @@
* Purpose: Tests the datatype interface (H5T)
*/
-#include "h5test.h"
+#include "testhdf5.h"
#include "H5srcdir.h"
#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,9 +43,19 @@
/* 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
+
+/* Use in version bound test */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
+/* Use in version bound test */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#include "H5Opkg.h" /* Object headers */
+
#define SET_ALIGNMENT(TYPE,VAL) \
H5T_NATIVE_##TYPE##_ALIGN_g=MAX(H5T_NATIVE_##TYPE##_ALIGN_g, VAL)
@@ -61,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; \
}
@@ -92,7 +102,15 @@ typedef enum dtype_t {
INT_SCHAR, INT_UCHAR, INT_SHORT, INT_USHORT, INT_INT, INT_UINT,
INT_LONG, INT_ULONG, INT_LLONG, INT_ULLONG, FLT_FLOAT, FLT_DOUBLE,
FLT_LDOUBLE, OTHER
-} dtype_t;
+} dtype_t; /* This doesn't seem to be used anywhere... -BMR */
+
+typedef enum {
+ E1_RED,
+ E1_GREEN,
+ E1_BLUE,
+ E1_ORANGE,
+ E1_YELLOW
+} color_t;
/* Constant for size of conversion buffer for int <-> float exception test */
#define CONVERT_SIZE 4
@@ -118,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:
@@ -164,7 +182,7 @@ reset_hdf5(void)
}
-
+
/*-------------------------------------------------------------------------
* Function: test_classes
*
@@ -265,7 +283,7 @@ test_classes(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_copy
*
@@ -286,7 +304,7 @@ static int
test_copy(void)
{
hid_t a_copy;
- herr_t status;
+ herr_t status;
TESTING("H5Tcopy()");
@@ -295,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();
@@ -310,7 +328,7 @@ test_copy(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_detect
*
@@ -487,7 +505,7 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_1
*
@@ -651,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:
@@ -674,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");
@@ -698,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*)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));
@@ -736,26 +754,26 @@ test_compound_2(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)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 */
@@ -782,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:
@@ -805,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");
@@ -829,7 +847,7 @@ test_compound_3(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*)orig) + 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;
@@ -866,24 +884,24 @@ test_compound_3(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)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 */
@@ -909,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:
@@ -933,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");
@@ -960,7 +978,7 @@ test_compound_4(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*)orig) + i;
+ s_ptr = ((struct st*)((void *)orig)) + i;
s_ptr->a = i*8+0;
s_ptr->b = (i*8+1) & 0x7fff;
s_ptr->c[0] = i*8+2;
@@ -999,26 +1017,26 @@ test_compound_4(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)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 */
@@ -1044,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:
@@ -1149,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:
@@ -1181,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");
@@ -1197,9 +1215,9 @@ test_compound_6(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*)orig) + i;
- s_ptr->b = (i*8+1) & 0x7fff;
- s_ptr->d = (i*8+6) & 0x7fff;
+ s_ptr = ((struct st*)((void *)orig)) + i;
+ s_ptr->b = (int16_t)((i*8+1) & 0x7fff);
+ s_ptr->d = (int16_t)((i*8+6) & 0x7fff);
}
HDmemcpy(buf, orig, nelmts*sizeof(struct st));
@@ -1226,18 +1244,18 @@ test_compound_6(void)
/* Compare results */
for (i=0; i<(int)nelmts; i++) {
- s_ptr = ((struct st*)orig) + i;
- d_ptr = ((struct dt*)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 */
@@ -1264,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:
@@ -1307,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 */
@@ -1353,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 */
@@ -1363,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 */
@@ -1410,7 +1428,7 @@ error:
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_8
*
@@ -1455,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 */
@@ -1517,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 */
@@ -1581,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 */
@@ -1604,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 */
@@ -1656,7 +1674,7 @@ test_compound_8(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_9
*
@@ -1676,14 +1694,20 @@ test_compound_8(void)
static int
test_compound_9(void)
{
- typedef struct cmpd_struct {
+ typedef struct cmpd_struct_w {
int i1;
- char* str;
+ const char* str;
int i2;
- } cmpd_struct;
+ } cmpd_struct_w;
- cmpd_struct wdata = {11, "variable-length string", 22};
- cmpd_struct rdata;
+ typedef struct cmpd_struct_r {
+ int i1;
+ char* str;
+ int i2;
+ } cmpd_struct_r;
+
+ cmpd_struct_w wdata = {11, "variable-length string", 22};
+ cmpd_struct_r rdata;
hid_t file;
hid_t cmpd_tid, str_id, dup_tid;
hid_t space_id;
@@ -1697,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))) < 0) {
+ 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,i1),H5T_NATIVE_INT) < 0) {
+ 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, str), str_id) < 0) {
+ 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, i2), H5T_NATIVE_INT) < 0) {
+ 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 */
@@ -1750,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) {
+ if(H5Treclaim(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;
@@ -1808,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 */
@@ -1841,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) {
+ if(H5Treclaim(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;
@@ -1878,7 +1902,7 @@ test_compound_9(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_10
*
@@ -1936,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 */
@@ -2021,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 */
@@ -2035,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) {
+ if(H5Treclaim(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) {
+ if(H5Treclaim(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 */
@@ -2072,7 +2096,7 @@ test_compound_10(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_11
*
@@ -2157,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 */
@@ -2166,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 */
@@ -2182,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) {
+ if(H5Treclaim(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 */
@@ -2226,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) {
+ if(H5Treclaim(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 */
@@ -2264,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) {
+ if(H5Treclaim(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 */
@@ -2315,7 +2339,7 @@ error:
return retval;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_12
*
@@ -2357,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;
@@ -2398,7 +2422,7 @@ test_compound_12(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_13
*
@@ -2500,7 +2524,7 @@ error:
return 1;
} /* end test_compound_13() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_14
*
@@ -2523,27 +2547,42 @@ error:
static int
test_compound_14(void)
{
- typedef struct cmpd_struct_1 {
+ typedef struct cmpd_struct_1_w {
char c1;
char c2;
- char* str;
- } cmpd_struct_1;
+ const char* str;
+ } cmpd_struct_1_w;
- typedef struct cmpd_struct_2 {
+ typedef struct cmpd_struct_1_r {
char c1;
char c2;
char* str;
+ } cmpd_struct_1_r;
+
+ typedef struct cmpd_struct_2_w {
+ char c1;
+ char c2;
+ const char* str;
long l1;
long l2;
long l3;
long l4;
- } cmpd_struct_2;
+ } cmpd_struct_2_w;
- cmpd_struct_1 wdata1 = {'A', 'B', "variable-length string"};
+ typedef struct cmpd_struct_2_r {
+ char c1;
+ char c2;
+ char* str;
+ long l1;
+ long l2;
+ long l3;
+ long l4;
+ } cmpd_struct_2_r;
- cmpd_struct_1 rdata1;
- cmpd_struct_2 wdata2 = {'C', 'D', "another vlen!", 1, 2, -1, 9001};
- cmpd_struct_2 rdata2;
+ cmpd_struct_1_w wdata1 = {'A', 'B', "variable-length string"};
+ cmpd_struct_1_r rdata1;
+ cmpd_struct_2_w wdata2 = {'C', 'D', "another vlen!", 1, 2, -1, 9001};
+ cmpd_struct_2_r rdata2;
hid_t file;
hid_t cmpd_m1_tid, cmpd_f1_tid, cmpd_m2_tid, cmpd_f2_tid, str_id;
hid_t space_id;
@@ -2557,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))) < 0) {
+ 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,c1),H5T_NATIVE_CHAR) < 0) {
+ 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,c2),H5T_NATIVE_CHAR) < 0) {
+ 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, str), str_id) < 0) {
+ 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))) < 0) {
+ 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,c1),H5T_NATIVE_CHAR) < 0) {
+ 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,c2),H5T_NATIVE_CHAR) < 0) {
+ 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, str), str_id) < 0) {
+ 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,l1),H5T_NATIVE_LONG) < 0) {
+ 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,l2),H5T_NATIVE_LONG) < 0) {
+ 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,l3),H5T_NATIVE_LONG) < 0) {
+ 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,l4),H5T_NATIVE_LONG) < 0) {
+ 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) {
+ if(H5Treclaim(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) {
+ if(H5Treclaim(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;
@@ -2802,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 */
@@ -2836,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) {
+ if(H5Treclaim(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) {
+ if(H5Treclaim(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;
@@ -2892,7 +2931,7 @@ test_compound_14(void)
return 1;
} /* end test_compound_14() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_15
*
@@ -2935,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 */
@@ -2975,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 */
@@ -2995,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 */
@@ -3021,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 */
@@ -3051,7 +3090,7 @@ test_compound_15(void)
return 1;
} /* end test_compound_15() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_16
*
@@ -3116,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;
}
@@ -3124,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;
}
@@ -3143,7 +3182,7 @@ error:
return 1;
} /* end test_compound_16() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_17
*
@@ -3195,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
@@ -3205,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
@@ -3239,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
@@ -3249,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
@@ -3266,7 +3305,7 @@ error:
return 1;
} /* end test_compound_17() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compound_18
*
@@ -3299,7 +3338,7 @@ test_compound_18(void)
/* Create compound datatype, but don't insert fields */
tid = H5Tcreate(H5T_COMPOUND, (size_t)8);
- assert(tid > 0);
+ HDassert(tid > 0);
/* Attempt to create file with compound datatype that has no fields */
/* Create File */
@@ -3308,7 +3347,7 @@ test_compound_18(void)
/* Create a dataspace to use */
sid = H5Screate_simple(1, &dim, NULL);
- assert(sid > 0);
+ HDassert(sid > 0);
/* Create a dataset with the bad compound datatype */
H5E_BEGIN_TRY {
@@ -3321,7 +3360,7 @@ test_compound_18(void)
/* Create a group */
gid = H5Gcreate2(file, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(gid > 0);
+ HDassert(gid > 0);
/* Create an attribute with the bad compound datatype */
H5E_BEGIN_TRY {
@@ -3332,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;
@@ -3392,7 +3431,7 @@ error:
return 1;
} /* end test_compound_18() */
-
+
/*-------------------------------------------------------------------------
* Function: test_query
*
@@ -3437,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 */
@@ -3550,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 */
@@ -3599,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 */
@@ -3638,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:
@@ -3658,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 */
@@ -3696,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;
@@ -3730,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;
@@ -3758,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:
@@ -3787,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 */
@@ -3817,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);
@@ -3858,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;
@@ -3873,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 */
@@ -3900,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;
}
/*
@@ -3919,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;
@@ -3940,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;
@@ -3995,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
*
*-------------------------------------------------------------------------
@@ -4022,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;
@@ -4034,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
*
*-------------------------------------------------------------------------
@@ -4084,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;
@@ -4100,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
*
*-------------------------------------------------------------------------
@@ -4117,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");
@@ -4133,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;
@@ -4157,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;
@@ -4181,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;
@@ -4208,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;
@@ -4242,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;
@@ -4274,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;
@@ -4298,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;
@@ -4330,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;
@@ -4354,7 +4393,7 @@ test_conv_str_1(void)
error:
H5E_BEGIN_TRY {
- H5Tclose(src_type);
+ H5Tclose(src_type);
H5Tclose(dst_type);
} H5E_END_TRY;
@@ -4369,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
*
*-------------------------------------------------------------------------
@@ -4386,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.
@@ -4400,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;
@@ -4436,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
*
*-------------------------------------------------------------------------
@@ -4454,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;
@@ -4475,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 */
@@ -4541,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 */
@@ -4554,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:
@@ -4575,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 */
@@ -4587,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 */
@@ -4599,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();
@@ -4630,7 +4669,7 @@ error:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_conv_enum_2
*
@@ -4656,7 +4695,7 @@ test_conv_enum_2(void)
"PURPLE",
"ORANGE",
"WHITE" };
-
+
TESTING("non-native enumeration type conversion");
/* Source enum type */
@@ -4672,7 +4711,7 @@ test_conv_enum_2(void)
/* Destination enum type */
dsttype = H5Tenum_create(H5T_NATIVE_INT);
- assert(H5Tget_size(dsttype) > H5Tget_size(srctype));
+ HDassert(H5Tget_size(dsttype) > H5Tget_size(srctype));
for (i=0; i<8; i++)
H5Tenum_insert(dsttype, mname[i], &i);
@@ -4692,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);
}
}
@@ -4706,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;
}
@@ -4715,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:
@@ -4735,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");
@@ -4751,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;
}
/*
@@ -4770,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;
}
/*
@@ -4784,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);
@@ -4812,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:
@@ -4833,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;
@@ -4866,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 */
@@ -4875,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 */
@@ -4884,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 */
@@ -4893,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 */
@@ -4902,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 */
@@ -4911,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 */
@@ -4920,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 */
@@ -4941,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:
@@ -4960,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:
@@ -5011,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
*
*-------------------------------------------------------------------------
@@ -5030,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;
@@ -5049,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);
@@ -5084,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
*
*-------------------------------------------------------------------------
@@ -5101,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 */
@@ -5115,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
@@ -5136,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:
@@ -5157,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;
@@ -5175,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 */
@@ -5183,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 */
@@ -5191,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 */
@@ -5199,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 */
@@ -5207,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 */
@@ -5215,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 */
@@ -5223,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 */
@@ -5231,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 */
@@ -5239,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 */
@@ -5252,7 +5291,7 @@ opaque_funcs(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_encode
*
@@ -5293,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");
@@ -5310,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 */
@@ -5385,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 */
@@ -5394,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 */
@@ -5415,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 */
@@ -5435,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 */
@@ -5444,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 */
@@ -5478,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 */
@@ -5487,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 */
@@ -5517,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);
@@ -5536,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);
@@ -5555,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);
@@ -5586,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 */
@@ -5595,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 */
@@ -5606,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 */
@@ -5634,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 */
@@ -5676,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);
@@ -5691,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 */
@@ -5706,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;
}
@@ -5779,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 */
@@ -5818,7 +5857,7 @@ test_encode(void)
return 1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_latest
*
@@ -5845,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_native_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 */
@@ -5879,7 +5918,7 @@ test_latest(void)
FAIL_STACK_ERROR
/* Get information about datatype on disk */
- if(H5Oget_info_by_name(file, compnd_type, &oi, H5P_DEFAULT) < 0)
+ if(H5Oget_native_info_by_name(file, compnd_type, &oi, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
old_dtype_oh_size = oi.hdr.space.total;
@@ -5904,7 +5943,7 @@ test_latest(void)
FAIL_STACK_ERROR
/* Get information about datatype on disk */
- if(H5Oget_info_by_name(file, compnd_type, &oi, H5P_DEFAULT) < 0)
+ if(H5Oget_native_info_by_name(file, compnd_type, &oi, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Check that the object header info is still the same */
@@ -5940,7 +5979,7 @@ test_latest(void)
FAIL_STACK_ERROR
/* Get information about datatype on disk */
- if(H5Oget_info_by_name(file, compnd_type, &oi, H5P_DEFAULT) < 0)
+ if(H5Oget_native_info_by_name(file, compnd_type, &oi, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
new_dtype_oh_size = oi.hdr.space.total;
@@ -5969,7 +6008,7 @@ test_latest(void)
FAIL_STACK_ERROR
/* Get information about datatype on disk */
- if(H5Oget_info_by_name(file, compnd_type, &oi, H5P_DEFAULT) < 0)
+ if(H5Oget_native_info_by_name(file, compnd_type, &oi, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Check that the object header info is still the same */
@@ -6036,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
*
@@ -6179,7 +6218,7 @@ error:
#endif /* H5_SIZEOF_INT==4 && H5_SIZEOF_FLOAT==4 */
} /* end test_int_float_except() */
-
+
/*-------------------------------------------------------------------------
* Function: test_set_order
*
@@ -6340,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
@@ -6376,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
@@ -6402,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
@@ -6432,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);
@@ -6473,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:
@@ -6499,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");
@@ -6669,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);
@@ -6682,7 +6721,7 @@ error:
} /* end test_named_indirect_reopen() */
static void create_del_obj_named_test_file(const char *filename, hid_t fapl,
- hbool_t new_format)
+ H5F_libver_t low, H5F_libver_t high)
{
hid_t file; /* File ID */
hid_t type; /* Datatype ID */
@@ -6692,106 +6731,110 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl,
hid_t fcpl; /* File creation property list ID */
hid_t my_fapl; /* Copy of file access property list ID */
hid_t dcpl; /* Dataset creation property list ID */
- herr_t status; /* Generic return value */
+ unsigned use_at_least_v18;/* Whether to use old or new format */
+ herr_t H5_ATTR_NDEBUG_UNUSED status; /* Generic return value */
/* Make copy of FAPL */
my_fapl = H5Pcopy(fapl);
- assert(my_fapl > 0);
+ HDassert(my_fapl > 0);
- if(new_format) {
- /* Use latest version of file format */
- status = H5Pset_libver_bounds(my_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
- assert(status >= 0);
- } /* end if */
+ /* Use low/high version of file format */
+ status = H5Pset_libver_bounds(my_fapl, low, high);
+ HDassert(status >= 0);
+
+ /* Set new format flag. Note: the case high < low should be caught in the caller */
+ use_at_least_v18 = 0;
+ if (low >= H5F_LIBVER_V18)
+ use_at_least_v18 = 1;
/* Create a file creation property list (used for the root group's creation property list) */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- assert(fcpl > 0);
+ HDassert(fcpl > 0);
- if(new_format) {
+ if(use_at_least_v18) {
/* Use dense link storage for all links in root group */
status = H5Pset_link_phase_change(fcpl, 0, 0);
- assert(status >= 0);
+ HDassert(status >= 0);
} /* end if */
/* Create file with attribute that uses committed datatype */
file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, my_fapl);
- assert(file > 0);
+ HDassert(file > 0);
/* Close FCPL */
status = H5Pclose(fcpl);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Close FAPL */
status = H5Pclose(my_fapl);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Create datatype to commit */
type = H5Tvlen_create(H5T_NATIVE_INT);
- assert(type > 0);
+ HDassert(type > 0);
/* Commit datatype */
status = H5Tcommit2(file, DEL_OBJ_NAMED_NAMED_DTYPE, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Create scalar dataspace */
space = H5Screate(H5S_SCALAR);
- assert(space > 0);
+ HDassert(space > 0);
/* Create a dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- assert(dcpl > 0);
+ HDassert(dcpl > 0);
- if(new_format) {
+ if(use_at_least_v18) {
/* Use dense attribute storage for all attributes on dataset */
status = H5Pset_attr_phase_change(dcpl, 0, 0);
- assert(status >= 0);
+ HDassert(status >= 0);
} /* end if */
/* Create dataset */
dset = H5Dcreate2(file, DEL_OBJ_NAMED_DATASET, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- assert(dset > 0);
+ HDassert(dset > 0);
/* Close DCPL */
status = H5Pclose(dcpl);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Close dataset */
status = H5Dclose(dset);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Create attribute */
attr = H5Acreate_by_name(file, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(attr > 0);
+ HDassert(attr > 0);
/* Close dataspace */
status = H5Sclose(space);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Close datatype */
status = H5Tclose(type);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Close attribute */
status = H5Aclose(attr);
- assert(status >= 0);
+ HDassert(status >= 0);
/* Close file */
status = H5Fclose(file);
- assert(status >= 0);
+ 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
*
*-------------------------------------------------------------------------
@@ -6803,7 +6846,7 @@ test_delete_obj_named(hid_t fapl)
hid_t attr = -1; /* Attribute ID */
hid_t dset = -1; /* Dataset ID */
hid_t fapl2 = -1; /* File access property list ID */
- unsigned new_format; /* Whether to use old or new format */
+ H5F_libver_t low, high; /* File format bounds */
char filename[1024], filename2[1024];
TESTING("deleting objects that use named datatypes");
@@ -6813,47 +6856,54 @@ test_delete_obj_named(hid_t fapl)
h5_fixname(FILENAME[8], fapl, filename, sizeof filename);
h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2);
- /* Loop over old & new format files */
- for(new_format = FALSE; new_format <= TRUE; new_format++) {
- /* Create test file, with attribute that uses committed datatype */
- create_del_obj_named_test_file(filename, fapl, new_format);
+ /* Loop through all valid the combinations of low/high library format bounds,
+ to test delete objects that use named datatypes through different file IDs */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
-/* Test deleting dataset opened through different file ID */
- if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ /* Skip invalid low/high combination */
+ if ((high == H5F_LIBVER_EARLIEST) || (low > high))
+ continue;
- if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+ /* Create test file, with attribute that uses committed datatype */
+ create_del_obj_named_test_file(filename, fapl, low, high);
- if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
+ /* Test deleting dataset opened through different file ID */
+ if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
+ if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
- if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
+ if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
+ if(H5Ldelete(filea2, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- /* Create test file, with attribute that uses committed datatype */
- create_del_obj_named_test_file(filename, fapl, new_format);
+ if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
-/* Test deleting attribute opened through different file ID */
- if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ /* Create test file, with attribute that uses committed datatype */
+ create_del_obj_named_test_file(filename, fapl, low, high);
- if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
+ /* Test deleting attribute opened through different file ID */
+ if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
+ if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
- if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
- if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
- if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
- } /* end for */
+ if(H5Adelete_by_name(filea2, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
+ } /* end high */
+ } /* end low */
if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR
@@ -6862,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
*
*-------------------------------------------------------------------------
@@ -6898,7 +6948,7 @@ test_delete_obj_named_fileid(hid_t fapl)
hid_t attr = -1; /* Attribute ID */
hid_t dset = -1; /* Dataset ID */
hid_t fapl2 = -1; /* File access property list ID */
- unsigned new_format; /* Whether to use old or new format */
+ H5F_libver_t low, high; /* File format bounds */
char filename[1024], filename2[1024];
TESTING("deleting objects that use named datatypes");
@@ -6908,108 +6958,115 @@ test_delete_obj_named_fileid(hid_t fapl)
h5_fixname(FILENAME[8], fapl, filename, sizeof filename);
h5_fixname(FILENAME[9], fapl2, filename2, sizeof filename2);
- /* Loop over old & new format files */
- for(new_format = FALSE; new_format <= TRUE; new_format++) {
- /* Create test file, with attribute that uses committed datatype */
- create_del_obj_named_test_file(filename, fapl, new_format);
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
-/* Test getting file ID for dataset opened through different file ID */
- if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ /* Skip invalid low/high combination */
+ if ((high == H5F_LIBVER_EARLIEST) || (low > high))
+ continue;
- if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ /* Create test file, with attribute that uses committed datatype */
+ create_del_obj_named_test_file(filename, fapl, low, high);
- if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ /* Test getting file ID for dataset opened through different file ID */
+ if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from dataset matches correct file */
- dset_fid = H5Iget_file_id(dset);
- if(dset_fid != filea1) TEST_ERROR
- H5Fclose(dset_fid);
+ if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from datatype (from dataset) matches correct file */
- type = H5Dget_type(dset);
- type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
- H5Fclose(type_fid);
- H5Tclose(type);
+ if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from dataset matches correct file */
+ dset_fid = H5Iget_file_id(dset);
+ if(!H5F__same_file_test(dset_fid, filea1)) TEST_ERROR
+ H5Fclose(dset_fid);
- if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from datatype (from dataset) matches correct file */
+ type = H5Dget_type(dset);
+ type_fid = H5Iget_file_id(type);
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
+ H5Fclose(type_fid);
+ H5Tclose(type);
- if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
- if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from dataset matches correct file */
- dset_fid = H5Iget_file_id(dset);
- if(dset_fid != filea1) TEST_ERROR
- H5Fclose(dset_fid);
+ if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from datatype (from dataset) matches correct file */
- type = H5Dget_type(dset);
- type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
- H5Fclose(type_fid);
- H5Tclose(type);
+ if((dset = H5Dopen2(filea1, DEL_OBJ_NAMED_DATASET, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from dataset matches correct file */
+ dset_fid = H5Iget_file_id(dset);
+ if(!H5F__same_file_test(dset_fid, filea1)) TEST_ERROR
+ H5Fclose(dset_fid);
- if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
- if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from datatype (from dataset) matches correct file */
+ type = H5Dget_type(dset);
+ type_fid = H5Iget_file_id(type);
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
+ H5Fclose(type_fid);
+ H5Tclose(type);
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- /* Create test file, with attribute that uses committed datatype */
- create_del_obj_named_test_file(filename, fapl, new_format);
+ if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
-/* Test getting file ID for attribute opened through different file ID */
- if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ /* Create test file, with attribute that uses committed datatype */
+ create_del_obj_named_test_file(filename, fapl, low, high);
- /* Verify file ID from dataset matches correct file */
- attr_fid = H5Iget_file_id(attr);
- if(attr_fid != filea1) TEST_ERROR
- H5Fclose(attr_fid);
+ /* Test getting file ID for attribute opened through different file ID */
+ if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ if((filea2 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from datatype (from dataset) matches correct file */
- type = H5Aget_type(attr);
- type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
- H5Fclose(type_fid);
- H5Tclose(type);
+ if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from dataset matches correct file */
+ attr_fid = H5Iget_file_id(attr);
+ if(!H5F__same_file_test(attr_fid, filea1)) TEST_ERROR
+ H5Fclose(attr_fid);
- if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from datatype (from dataset) matches correct file */
+ type = H5Aget_type(attr);
+ type_fid = H5Iget_file_id(type);
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
+ H5Fclose(type_fid);
+ H5Tclose(type);
- if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
+ if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
- if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
- if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((fileb = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl2)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from dataset matches correct file */
- attr_fid = H5Iget_file_id(attr);
- if(attr_fid != filea1) TEST_ERROR
- H5Fclose(attr_fid);
+ if((filea1 = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
- /* Verify file ID from datatype (from dataset) matches correct file */
- type = H5Aget_type(attr);
- type_fid = H5Iget_file_id(type);
- if(type_fid != filea1) TEST_ERROR
- H5Fclose(type_fid);
- H5Tclose(type);
+ if((attr = H5Aopen_by_name(filea1, DEL_OBJ_NAMED_DATASET, DEL_OBJ_NAMED_ATTRIBUTE, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
+ /* Verify file ID from dataset matches correct file */
+ attr_fid = H5Iget_file_id(attr);
+ if(!H5F__same_file_test(attr_fid, filea1)) TEST_ERROR
+ H5Fclose(attr_fid);
- if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
- if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
- if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
- } /* end for */
+ /* Verify file ID from datatype (from dataset) matches correct file */
+ type = H5Aget_type(attr);
+ type_fid = H5Iget_file_id(type);
+ if(!H5F__same_file_test(type_fid, filea1)) TEST_ERROR
+ H5Fclose(type_fid);
+ H5Tclose(type);
+
+ if(H5Aclose(attr) < 0) FAIL_STACK_ERROR
+
+ if(H5Fclose(filea1) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(filea2) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(fileb) < 0) FAIL_STACK_ERROR
+ } /* end high */
+ } /* end low */
if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR
@@ -7018,26 +7075,29 @@ test_delete_obj_named_fileid(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(attr);
- H5Dclose(dset);
- H5Pclose(fapl2);
- H5Fclose(filea1);
- H5Fclose(filea2);
- H5Fclose(fileb);
+ 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
*
*-------------------------------------------------------------------------
@@ -7046,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");
@@ -7084,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;
@@ -7094,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)
@@ -7107,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.
@@ -7140,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
@@ -7170,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
*-------------------------------------------------------------------------
*/
@@ -7205,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
************************************************/
@@ -7232,7 +7292,7 @@ test_utf_ascii_conv(void)
/* Test conversion in memory */
H5E_BEGIN_TRY {
- status = H5Tconvert(utf8_vtid, ascii_vtid, 1, (void *)utf8_w, NULL, H5P_DEFAULT);
+ status = H5Tconvert(utf8_vtid, ascii_vtid, 1, &utf8_w, NULL, H5P_DEFAULT);
} H5E_END_TRY
if(status >= 0)
FAIL_STACK_ERROR
@@ -7265,7 +7325,7 @@ test_utf_ascii_conv(void)
************************************************/
/* Test conversion in memory */
H5E_BEGIN_TRY {
- status = H5Tconvert(ascii_vtid, utf8_vtid, 1, (void *)ascii_w, NULL, H5P_DEFAULT);
+ status = H5Tconvert(ascii_vtid, utf8_vtid, 1, &ascii_w, NULL, H5P_DEFAULT);
} H5E_END_TRY
if(status >= 0)
FAIL_STACK_ERROR
@@ -7377,20 +7437,385 @@ 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;
}
+/*-------------------------------------------------------------------------
+ * Function: verify_version
+ *
+ * Purpose: Utility function to verify the datatype versions of nested
+ * datatype.
+ *
+ * Description:
+ * Verify the datatype message version
+ * --H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * the library will set version according to low_bound
+ * --H5T_ARRAY:
+ * the earliest version the library will set is 2
+ * --H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD,
+ * H5T_OPAQUE, H5T_REFERENCE:
+ * the library will only use basic version
+ *
+ *************************************************************************/
+static herr_t verify_version(hid_t dtype, H5F_libver_t low, unsigned *highest_version)
+{
+ hid_t base_dtype = -1;
+ hid_t mem_dtype = -1;
+ H5T_t *dtypep = NULL; /* Internal structure of a datatype */
+ H5T_class_t type_cls = H5T_NO_CLASS; /* Temporary var for datatype class */
+ int nmembers = 0;
+ unsigned i;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ dtypep = (H5T_t *)H5I_object(dtype);
+ if (dtypep == NULL) TEST_ERROR
+
+ /* Carry out the verification according to the class of the datatype.
+ For compound datatype, its members will be verified, recursively.
+ For array datatype, its element datatype will be verified, recursively.*/
+ type_cls = dtypep->shared->type;
+ switch (type_cls)
+ {
+ case H5T_ARRAY:
+ {
+ H5T_t *base_dtypep = NULL; /* Internal structure of a datatype */
+
+ if (low == H5F_LIBVER_EARLIEST)
+ VERIFY(dtypep->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds");
+
+ /* Get the base datatype of this array type */
+ base_dtype = H5Tget_super(dtype);
+ CHECK(base_dtype, FAIL, "H5Tget_super");
+
+ /* Get the base type's internal structure for version */
+ base_dtypep = (H5T_t *)H5I_object(base_dtype);
+ if (base_dtypep == NULL) TEST_ERROR
+
+ /* Reset highest version if this datatype has higher version than
+ its outer type */
+ if (*highest_version < base_dtypep->shared->version)
+ *highest_version = base_dtypep->shared->version;
+
+ /* Verify the base datatype recursively */
+ ret = verify_version(base_dtype, low, highest_version);
+
+ /* Close the member datatype before checking for failure */
+ if ((H5Tclose(base_dtype)) < 0) TEST_ERROR
+
+ /* Check if verify_version fails */
+ if (ret < 0) TEST_ERROR
+
+ break;
+ }
+ case H5T_COMPOUND:
+ {
+ H5T_t *mem_dtypep = NULL; /* Internal structure of a datatype */
+ /* Get the number of members of this compound type */
+ if ((nmembers = H5Tget_nmembers(dtype)) < 0) TEST_ERROR
+
+ /* Go through all its member datatypes */
+ for (i = 0; i < (unsigned)nmembers; i++)
+ {
+ /* Get the member datatype to verify it recursively */
+ mem_dtype = H5Tget_member_type(dtype, i);
+ if (mem_dtype < 0) TEST_ERROR
+
+ /* Get the member type's internal structure for version */
+ mem_dtypep = (H5T_t *)H5I_object(mem_dtype);
+ if (mem_dtypep == NULL) TEST_ERROR
+
+ /* Reset highest version if this datatype has higher version than
+ its outer type */
+ if (*highest_version < mem_dtypep->shared->version)
+ *highest_version = mem_dtypep->shared->version;
+
+ /* Verify the datatype recursively */
+ ret = verify_version(mem_dtype, low, highest_version);
+
+ /* Close the member datatype before checking for failure */
+ if ((H5Tclose(mem_dtype)) < 0) TEST_ERROR
+
+ /* Check if verify_version fails */
+ if (ret < 0) TEST_ERROR
+ }
+ /* If this compound datatype contains a datatype of higher version, it
+ will be promoted to that version, thus, verify with highest version */
+ if (*highest_version > H5O_dtype_ver_bounds[low])
+ VERIFY(dtypep->shared->version, *highest_version, "verify_version");
+ else
+ VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version");
+ break;
+ }
+ case H5T_ENUM:
+ VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[low], "verify_version");
+ break;
+ case H5T_VLEN:
+ case H5T_FLOAT:
+ case H5T_INTEGER:
+ VERIFY(dtypep->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "verify_version");
+ break;
+ case H5T_NCLASSES:
+ case H5T_NO_CLASS:
+ case H5T_TIME:
+ case H5T_STRING:
+ case H5T_BITFIELD:
+ case H5T_OPAQUE:
+ case H5T_REFERENCE:
+ default:
+ TEST_ERROR
+ } /* end switch */
+
+error:
+ H5E_BEGIN_TRY {
+ H5Tclose(base_dtype);
+ H5Tclose(mem_dtype);
+ } H5E_END_TRY;
+ return ret;
+} /* end of verify_version */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_versionbounds
+ *
+ * Purpose: Tests version bounds.
+ *
+ * Description:
+ * This function creates a datatype for a dataset as followed:
+ * outer_arr_type
+ * outer_cmp_type
+ * inner_cmp_type
+ * inner_arr_type
+ * simple_cmp_type
+ * H5T_NATIVE_INT
+ * H5T_ARRAY of H5T_NATIVE_CHAR
+ * vlen_floattype
+ * enum_type
+ * 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
+ *
+ *-------------------------------------------------------------------------
+ */
+#define VERFNAME "tverbounds_dtype.h5"
+#define VERDSNAME "dataset 1"
+#define ARRAY_RANK 1
+#define ARRAY_LEN 10
+static int
+test_versionbounds(void)
+{
+ typedef struct { /* Struct for the simple compound type */
+ int single_int;
+ char char_arr[ARRAY_LEN];
+ } simple_cmp_t;
+
+ typedef struct { /* Struct for the inner compound type */
+ simple_cmp_t inner_arr[ARRAY_LEN];
+ hvl_t vlen_float;
+ } inner_cmp_t;
+
+ typedef struct { /* Struct for the outer compound type */
+ inner_cmp_t inner_cmp;
+ color_t enum_color;
+ } outer_cmp_t;
+
+ hid_t file = -1; /* File ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t fapl = -1; /* Copy of file access property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t dset_dtype = -1; /* Dataset's datatype */
+ hid_t arr_chartype = -1; /* Array of characters datatype */
+ hid_t vlen_floattype = -1; /* Vlen of float datatype */
+ hid_t enum_type = -1; /* Enumeration datatype */
+ hid_t outer_cmp_type = -1; /* Outer compound datatype */
+ hid_t inner_cmp_type = -1; /* Inner compound datatype */
+ hid_t simple_cmp_type = -1;/* Simple cmpd dtype, contains no other cmpd */
+ hid_t outer_arr_type = -1; /* Outermost array datatype */
+ hid_t inner_arr_type = -1; /* Inner array datatype */
+ H5F_t *filep = NULL; /* Pointer to internal structure of a file */
+ H5T_t *dtypep = NULL; /* Pointer to internal structure of a datatype */
+ hsize_t arr_dim[] = {ARRAY_LEN}; /* Length of the array */
+ int low, high; /* Indices for iterating over versions */
+ H5F_libver_t versions[] = {H5F_LIBVER_EARLIEST, H5F_LIBVER_V18, H5F_LIBVER_V110, H5F_LIBVER_V112, H5F_LIBVER_V114};
+ int versions_count = 5; /* Number of version bounds in the array */
+ unsigned highest_version; /* Highest version in nested datatypes */
+ color_t enum_val; /* Enum type index */
+ herr_t ret = 0; /* Generic return value */
+
+ TESTING("version bounds with nested datatypes");
+
+ /* Create a file access property list */
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR
+
+ /* Create a file creation property list */
+ if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR
+
+ /* Create a scalar dataspace */
+ if ((space = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
+
+ /* Create a dataset creation property list */
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+
+ /* Create an array datatype of chars */
+ arr_chartype = H5Tarray_create2(H5T_NATIVE_CHAR, ARRAY_RANK, arr_dim);
+ if (arr_chartype < 0) TEST_ERROR
+
+ /* Create the simple compound datatype that has an integer and an
+ array of chars */
+ simple_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(simple_cmp_t));
+ if (simple_cmp_type < 0) TEST_ERROR
+
+ /* Insert integer field */
+ ret = H5Tinsert(simple_cmp_type, "single_int", HOFFSET(simple_cmp_t, single_int), H5T_NATIVE_INT);
+ if (ret < 0) TEST_ERROR
+
+ /* Insert array field */
+ ret = H5Tinsert(simple_cmp_type, "char_arr", HOFFSET(simple_cmp_t, char_arr), arr_chartype);
+ if (ret < 0) TEST_ERROR
+
+ /* Create an array datatype containing simple compound datatype */
+ inner_arr_type = H5Tarray_create2(simple_cmp_type, ARRAY_RANK, arr_dim);
+ if (inner_arr_type < 0) TEST_ERROR
+
+ /* Create a VL datatype of floats */
+ vlen_floattype = H5Tvlen_create(H5T_NATIVE_FLOAT);
+ if (vlen_floattype < 0) TEST_ERROR
+
+ /* Create the innermost compound datatype that houses inner_arr_type and vlen_floattype */
+ inner_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(inner_cmp_t));
+ if (inner_cmp_type < 0) TEST_ERROR
+
+ /* Insert integer field */
+ ret = H5Tinsert(inner_cmp_type, "inner_arr", HOFFSET(inner_cmp_t, inner_arr), inner_arr_type);
+ if (ret < 0) TEST_ERROR
+
+ /* Insert integer field */
+ ret = H5Tinsert(inner_cmp_type, "vlen_float", HOFFSET(inner_cmp_t, vlen_float), vlen_floattype);
+ if (ret < 0) TEST_ERROR
+
+ /* Create a enumerate datatype */
+ enum_type = H5Tcreate(H5T_ENUM, sizeof(color_t));
+ if (enum_type < 0) TEST_ERROR
+
+ enum_val = E1_RED;
+ ret = H5Tenum_insert(enum_type, "RED", &enum_val);
+ if (ret < 0) TEST_ERROR
+
+ enum_val = E1_GREEN;
+ ret = H5Tenum_insert(enum_type, "GREEN", &enum_val);
+ if (ret < 0) TEST_ERROR
+
+ enum_val = E1_BLUE;
+ ret = H5Tenum_insert(enum_type, "BLUE", &enum_val);
+ if (ret < 0) TEST_ERROR
+
+ enum_val = E1_ORANGE;
+ ret = H5Tenum_insert(enum_type, "ORANGE", &enum_val);
+ if (ret < 0) TEST_ERROR
+
+ enum_val = E1_YELLOW;
+ ret = H5Tenum_insert(enum_type, "YELLOW", &enum_val);
+ if (ret < 0) TEST_ERROR
+
+ /* Create the outer compound datatype that contains the inner compound datatype and the enum datatype */
+ outer_cmp_type = H5Tcreate(H5T_COMPOUND, sizeof(outer_cmp_t));
+ if (ret < 0) TEST_ERROR
+
+ /* Insert integer field */
+ ret = H5Tinsert(outer_cmp_type, "inner_cmp", HOFFSET(outer_cmp_t, inner_cmp), inner_cmp_type);
+ if (ret < 0) TEST_ERROR
+
+ /* Insert enum field */
+ ret = H5Tinsert(outer_cmp_type, "enum_color", HOFFSET(outer_cmp_t, enum_color), enum_type);
+ if (ret < 0) TEST_ERROR
+
+ /* Create an array datatype containing the outer compound datatype */
+ if ((outer_arr_type = H5Tarray_create2(outer_cmp_type, ARRAY_RANK, arr_dim)) < 0)
+ TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combinations */
+ /* Create the file, create and write to a dataset with compound datatype */
+ /* Verify the dataset's datatype and its members */
+ for(low = 0; low < versions_count; low++) {
+
+ for(high = 0; high < versions_count; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, versions[low], versions[high]);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a file */
+ file = H5Fcreate(VERFNAME, H5F_ACC_TRUNC, fcpl, fapl);
+ if (file < 0) TEST_ERROR
+
+ /* Get the internal file pointer if the create succeeds */
+ if ((filep = (H5F_t *)H5I_object(file)) == NULL) TEST_ERROR
+
+ /* Create dataset using the array type */
+ dset = H5Dcreate2(file, VERDSNAME, outer_arr_type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR
+
+ /* Get the dataset's datatype */
+ if ((dset_dtype = H5Dget_type(dset)) < 0) TEST_ERROR
+
+ /* Get the version of this datatype */
+ dtypep = (H5T_t *)H5I_object(dset_dtype);
+ if (dtypep == NULL) TEST_ERROR
+ highest_version = dtypep->shared->version;
+
+ /* Verify version of the datatype recursevily */
+ ret = verify_version(dset_dtype, versions[low], &highest_version);
+
+ /* Close the dataset's datatype */
+ if (H5Tclose(dset_dtype) < 0) TEST_ERROR
+
+ /* Close dataset and file */
+ if (H5Dclose(dset) < 0) TEST_ERROR
+ if (H5Fclose(file) < 0) TEST_ERROR
+
+ } /* for high */
+ } /* for low */
+
+ /* Close dataspace and property lists */
+ if (H5Sclose(space) < 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);
+ } H5E_END_TRY;
+ return 1;
+} /* end test_versionbounds() */
-
/*-------------------------------------------------------------------------
* Function: main
*
@@ -7410,8 +7835,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));
@@ -7420,7 +7845,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();
@@ -7428,7 +7853,6 @@ main(void)
nerrors += test_detect();
nerrors += test_compound_1();
nerrors += test_query();
-
nerrors += test_transient(fapl);
nerrors += test_named(fapl);
nerrors += test_encode();
@@ -7473,14 +7897,15 @@ main(void)
nerrors += test_opaque();
nerrors += test_set_order();
nerrors += test_utf_ascii_conv();
+ 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/dynlib1.c b/test/dynlib1.c
deleted file mode 100644
index e9137fb..0000000
--- a/test/dynlib1.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Raymond Lu
- * 13 February 2013
- *
- * Purpose: Tests the plugin module (H5PL)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "H5PLextern.h"
-
-#define H5Z_FILTER_DYNLIB1 257
-
-static size_t H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
-
-/* This message derives from H5Z */
-const H5Z_class2_t H5Z_DYNLIB1[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB1, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlib1", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib1, /* The actual filter function */
-}};
-
-H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
-const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB1;}
-
-/*-------------------------------------------------------------------------
- * Function: H5Z_filter_dynlib1
- *
- * Purpose: A dynlib1 filter method that adds on and subtract from
- * the original value with another value. It will be built
- * as a shared library. plugin.c test will load and use
- * this filter library.
- *
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * 29 March 2013
- *
- *-------------------------------------------------------------------------
- */
-static size_t
-H5Z_filter_dynlib1(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes,
- size_t *buf_size, void **buf)
-{
- int *int_ptr = (int *)*buf; /* Pointer to the data values */
- size_t buf_left = *buf_size; /* Amount of data buffer left to process */
- int add_on = 0;
-
- /* Check for the correct number of parameters */
- if(cd_nelmts == 0)
- return(0);
-
- /* Check that permanent parameters are set correctly */
- if(cd_values[0] > 9)
- return(0);
-
- add_on = (int)cd_values[0];
-
- if(flags & H5Z_FLAG_REVERSE) { /*read*/
- /* Substract the "add on" value to all the data values */
- while(buf_left > 0) {
- *int_ptr++ -= add_on;
- buf_left -= sizeof(int);
- } /* end while */
- } /* end if */
- else { /*write*/
- /* Add the "add on" value to all the data values */
- while(buf_left > 0) {
- *int_ptr++ += add_on;
- buf_left -= sizeof(int);
- } /* end while */
- } /* end else */
-
- return nbytes;
-} /* end H5Z_filter_dynlib1() */
-
diff --git a/test/dynlib2.c b/test/dynlib2.c
deleted file mode 100644
index 2574d4d..0000000
--- a/test/dynlib2.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Raymond Lu
- * 13 February 2013
- *
- * Purpose: Tests the plugin module (H5PL)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "H5PLextern.h"
-
-#define H5Z_FILTER_DYNLIB2 258
-#define MULTIPLIER 3
-
-static size_t H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
-
-/* This message derives from H5Z */
-const H5Z_class2_t H5Z_DYNLIB2[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB2, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlib2", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib2, /* The actual filter function */
-}};
-
-H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
-const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB2;}
-
-/*-------------------------------------------------------------------------
- * Function: H5Z_filter_dynlib2
- *
- * Purpose: A dynlib2 filter method that multiplies the original value
- * during write and divide the original value during read. It
- * will be built as a shared library. plugin.c test will load
- * and use this filter library.
- *
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * 29 March 2013
- *
- *-------------------------------------------------------------------------
- */
-static size_t
-H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes,
- size_t *buf_size, void **buf)
-{
- int *int_ptr = (int *)*buf; /* Pointer to the data values */
- size_t buf_left = *buf_size; /* Amount of data buffer left to process */
-
- /* Check for the correct number of parameters */
- if(cd_nelmts > 0)
- return(0);
-
- /* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
-
- if(flags & H5Z_FLAG_REVERSE) { /*read*/
- /* Divide the original value with MULTIPLIER */
- while(buf_left > 0) {
- *int_ptr++ /= MULTIPLIER;
- buf_left -= sizeof(int);
- } /* end while */
- } /* end if */
- else { /*write*/
- /* Multiply the original value with MULTIPLIER */
- while(buf_left > 0) {
- *int_ptr++ *= MULTIPLIER;
- buf_left -= sizeof(int);
- } /* end while */
- } /* end else */
-
- return nbytes;
-} /* end H5Z_filter_dynlib2() */
-
diff --git a/test/dynlib3.c b/test/dynlib3.c
deleted file mode 100644
index 8871321..0000000
--- a/test/dynlib3.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Raymond Lu
- * 1 April 2013
- *
- * Purpose: Tests the plugin module (H5PL)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "H5PLextern.h"
-
-#define H5Z_FILTER_DYNLIB3 259
-#define SUFFIX_LEN 8
-#define GROUP_SUFFIX ".h5group"
-
-static size_t H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
-
-/* This message derives from H5Z */
-const H5Z_class2_t H5Z_DYNLIB3[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB3, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlib3", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib3, /* The actual filter function */
-}};
-
-H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
-const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB3;}
-
-/*-------------------------------------------------------------------------
- * Function: H5Z_filter_dynlib3
- *
- * Purpose: A dynlib3 filter method that is used to test groups. It
- * appends the suffix ".h5group" to each group name during
- * write and takes it out during read.
- *
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * 1 April 2013
- *
- *-------------------------------------------------------------------------
- */
-static size_t
-H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes,
- size_t *buf_size, void **buf)
-{
- size_t ret_value; /* Return value */
-
- /* Check for the correct number of parameters */
- if(cd_nelmts > 0)
- return(0);
-
- /* Assignment to eliminate unused parameter warning. */
- cd_values = cd_values;
-
- if(flags & H5Z_FLAG_REVERSE) { /*read*/
- ret_value = *buf_size = nbytes - SUFFIX_LEN;
- } /* end if */
- else { /*write*/
- void *outbuf = NULL; /* Pointer to new buffer */
- unsigned char *dst; /* Temporary pointer to destination buffer */
-
- dst = (unsigned char *)(outbuf = H5allocate_memory(nbytes + SUFFIX_LEN, 0));
-
- /* Copy raw data */
- memcpy((void*)dst, (void*)(*buf), nbytes);
-
- /* Append suffix to raw data for storage */
- dst += nbytes;
- memcpy(dst, (void*)GROUP_SUFFIX, SUFFIX_LEN);
-
- /* Free input buffer */
- H5free_memory(*buf);
-
- /* Set return values */
- *buf_size = nbytes + SUFFIX_LEN;
- *buf = outbuf;
- outbuf = NULL;
- ret_value = *buf_size;
- } /* end else */
-
- return ret_value;
-} /* H5Z_filter_dynlib3() */
-
diff --git a/test/dynlib4.c b/test/dynlib4.c
deleted file mode 100644
index 06d90ff..0000000
--- a/test/dynlib4.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Purpose: Tests the plugin module (H5PL)
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "H5PLextern.h"
-
-#define H5Z_FILTER_DYNLIB4 260
-
-#define PUSH_ERR(func, minor, str) H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, H5E_ERR_CLS, H5E_PLUGIN, minor, str)
-
-static size_t H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
-
-/* This message derives from H5Z */
-const H5Z_class2_t H5Z_DYNLIB4[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DYNLIB4, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dynlib4", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- (H5Z_func_t)H5Z_filter_dynlib4, /* The actual filter function */
-}};
-
-H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
-const void *H5PLget_plugin_info(void) {return H5Z_DYNLIB4;}
-
-/*-------------------------------------------------------------------------
- * Function: H5Z_filter_dynlib4
- *
- * Purpose: A dynlib4 filter method that adds on and subtract from
- * the original value with another value. It will be built
- * as a shared library. plugin.c test will load and use
- * this filter library. Designed to call a HDF function.
- *
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- *-------------------------------------------------------------------------
- */
-static size_t
-H5Z_filter_dynlib4(unsigned int flags, size_t cd_nelmts,
- const unsigned int *cd_values, size_t nbytes,
- size_t *buf_size, void **buf)
-{
- int *int_ptr = (int *)*buf; /* Pointer to the data values */
- size_t buf_left = *buf_size; /* Amount of data buffer left to process */
- int add_on = 0;
- unsigned ver_info[3];
-
- /* Check for the library version */
- if(H5get_libversion(&ver_info[0], &ver_info[1], &ver_info[2]) < 0) {
- PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion");
- return(0);
- }
- /* Check for the correct number of parameters */
- if(cd_nelmts == 0)
- return(0);
-
- /* Check that permanent parameters are set correctly */
- if(cd_values[0] > 9)
- return(0);
-
- if(ver_info[0] != cd_values[1] || ver_info[1] != cd_values[2]) {
- PUSH_ERR("dynlib4", H5E_CALLBACK, "H5get_libversion does not match");
- return(0);
- }
-
- add_on = (int)cd_values[0];
-
- if(flags & H5Z_FLAG_REVERSE) { /*read*/
- /* Substract the "add on" value to all the data values */
- while(buf_left > 0) {
- *int_ptr++ -= add_on;
- buf_left -= sizeof(int);
- } /* end while */
- } /* end if */
- else { /*write*/
- /* Add the "add on" value to all the data values */
- while(buf_left > 0) {
- *int_ptr++ += add_on;
- buf_left -= sizeof(int);
- } /* end while */
- } /* end else */
-
- return nbytes;
-} /* end H5Z_filter_dynlib4() */
-
diff --git a/test/earray.c b/test/earray.c
index 1058565..6597afd 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -20,13 +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 "H5Iprivate.h" /* IDs */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h" /* IDs */
+#include "H5VLprivate.h" /* Virtual Object Layer */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Local macros */
@@ -171,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
*
*-------------------------------------------------------------------------
@@ -203,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
*
*-------------------------------------------------------------------------
@@ -253,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
*
*-------------------------------------------------------------------------
@@ -277,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
*
*-------------------------------------------------------------------------
@@ -299,7 +301,7 @@ create_file(unsigned flags, hid_t fapl, hid_t *file, H5F_t **f)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -313,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
*
*-------------------------------------------------------------------------
@@ -391,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, hid_t dxpl,
+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 */
@@ -414,7 +416,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
if(tparam->reopen_array) {
/* Close array, if given */
if(ea && *ea) {
- if(H5EA_close(*ea, dxpl) < 0)
+ if(H5EA_close(*ea) < 0)
FAIL_STACK_ERROR
*ea = NULL;
} /* end if */
@@ -432,7 +434,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -441,7 +443,7 @@ reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
/* Re-open array, if given */
if(ea)
- if(NULL == (*ea = H5EA_open(*f, dxpl, ea_addr, NULL)))
+ if(NULL == (*ea = H5EA_open(*f, ea_addr, NULL)))
FAIL_STACK_ERROR
} /* end if */
@@ -452,29 +454,29 @@ 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
*
*-------------------------------------------------------------------------
*/
static int
-create_array(H5F_t *f, hid_t dxpl, const H5EA_create_t *cparam,
+create_array(H5F_t *f, const H5EA_create_t *cparam,
H5EA_t **ea, haddr_t *ea_addr, H5EA__ctx_cb_t *cb)
{
hsize_t nelmts; /* Number of elements in array */
earray_state_t state; /* State of extensible array */
/* Create array */
- if(NULL == (*ea = H5EA_create(f, dxpl, cparam, cb)))
+ if(NULL == (*ea = H5EA_create(f, cparam, cb)))
FAIL_STACK_ERROR
/* Check status of array */
@@ -499,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
*
*-------------------------------------------------------------------------
@@ -520,31 +522,31 @@ verify_cparam(const H5EA_t *ea, const H5EA_create_t *cparam)
/* Retrieve creation parameters */
HDmemset(&test_cparam, 0, sizeof(H5EA_create_t));
- if(H5EA_get_cparam_test(ea, &test_cparam) < 0)
+ if(H5EA__get_cparam_test(ea, &test_cparam) < 0)
FAIL_STACK_ERROR
/* Verify creation parameters */
- if(H5EA_cmp_cparam_test(cparam, &test_cparam))
+ if(H5EA__cmp_cparam_test(cparam, &test_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
*
*-------------------------------------------------------------------------
@@ -555,7 +557,7 @@ finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr)
h5_stat_size_t file_size; /* File size, after deleting array */
/* Close the extensible array */
- if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea) < 0)
FAIL_STACK_ERROR
#ifdef QAK
@@ -565,7 +567,7 @@ HDsystem("cp earray.h5 earray.h5.save");
#endif /* QAK */
/* Delete array */
- if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0)
+ if(H5EA_delete(f, ea_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -588,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
*
*-------------------------------------------------------------------------
@@ -605,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 */
@@ -627,11 +629,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.raw_elmt_size = 0;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -642,11 +644,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_nelmts_bits = 0;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -656,11 +658,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_nelmts_bits = 65;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -671,11 +673,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.sup_blk_min_data_ptrs = 0;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -684,11 +686,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.sup_blk_min_data_ptrs = 1;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -697,11 +699,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.sup_blk_min_data_ptrs = 6;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -712,11 +714,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.data_blk_min_elmts = 0;
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -728,11 +730,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(H5VM_log2_gen((uint64_t)test_cparam.idx_blk_elmts) - 1);
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -742,11 +744,11 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = 4; /* corresponds to 16 elements in data block page, which is less than the 64 elements for the default settings */
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
@@ -755,18 +757,18 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = (uint8_t)(test_cparam.max_nelmts_bits + 1);
H5E_BEGIN_TRY {
- ea = H5EA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ ea = H5EA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened extensible array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
ea = NULL;
/* Indicate error */
TEST_ERROR
} /* end if */
- PASSED()
+ PASSED();
}
#else /* NDEBUG */
SKIPPED();
@@ -779,10 +781,10 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
TESTING("extensible array creation");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
- PASSED()
+ PASSED();
/* Verify the creation parameters */
TESTING("verify array creation parameters");
@@ -796,30 +798,30 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t H5_ATTR_UNUSE
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5EA_close(ea);
+ 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
*
*-------------------------------------------------------------------------
@@ -827,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 */
@@ -842,19 +844,19 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TESTING("create, close & reopen extensible array");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
/* Close the extensible array */
- if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0)
TEST_ERROR
/* Re-open the array */
- if(NULL == (ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL)))
+ if(NULL == (ea = H5EA_open(f, ea_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -866,30 +868,30 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5EA_close(ea);
+ 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
*
*-------------------------------------------------------------------------
@@ -897,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 */
@@ -915,11 +917,11 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TESTING("open extensible array twice");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL)))
+ if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -929,12 +931,12 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* Close the second extensible array wrapper */
- if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea2) < 0)
FAIL_STACK_ERROR
ea2 = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0)
TEST_ERROR
/* Re-open the file */
@@ -942,11 +944,11 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the extensible array through the second file handle */
- if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL)))
+ if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -954,7 +956,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* Close the first extensible array wrapper */
- if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea) < 0)
FAIL_STACK_ERROR
ea = NULL;
@@ -970,35 +972,35 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
if(ea2)
- H5EA_close(ea2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
- H5Fclose(file2);
+ H5EA_close(ea2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1007,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 */
@@ -1027,11 +1029,11 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
TESTING("open extensible array twice, through different file handles");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL)))
+ if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -1041,7 +1043,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
TEST_ERROR
/* Close the second extensible array wrapper */
- if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea2) < 0)
FAIL_STACK_ERROR
ea2 = NULL;
@@ -1053,7 +1055,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -1061,7 +1063,7 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
TEST_ERROR
/* Close the first extensible array wrapper */
- if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea) < 0)
FAIL_STACK_ERROR
ea = NULL;
@@ -1088,11 +1090,11 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Open the extensible array through the second file handle */
- if(NULL == (ea2 = H5EA_open(f2, H5AC_ind_read_dxpl_id, ea_addr, NULL)))
+ if(NULL == (ea2 = H5EA_open(f2, ea_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -1110,35 +1112,35 @@ test_open_twice_diff(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tpa
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
if(ea2)
- H5EA_close(ea2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ H5EA_close(ea2);
+ 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
*
*-------------------------------------------------------------------------
@@ -1146,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 */
@@ -1163,15 +1165,15 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TESTING("deleting open extensible array");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
/* Open the array again */
- if(NULL == (ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL)))
+ if(NULL == (ea2 = H5EA_open(f, ea_addr, NULL)))
FAIL_STACK_ERROR
/* Request that the array be deleted */
- if(H5EA_delete(f, H5AC_ind_read_dxpl_id, ea_addr, NULL) < 0)
+ if(H5EA_delete(f, ea_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -1181,38 +1183,38 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* Close the second extensible array wrapper */
- if(H5EA_close(ea2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea2) < 0)
FAIL_STACK_ERROR
ea2 = NULL;
/* Try re-opening the array again (should fail, as array will be deleted) */
H5E_BEGIN_TRY {
- ea2 = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL);
+ ea2 = H5EA_open(f, ea_addr, NULL);
} H5E_END_TRY;
if(ea2) {
/* Close opened array */
- H5EA_close(ea2, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea2);
/* Indicate error */
TEST_ERROR
} /* end if */
/* Close the first extensible array wrapper */
- if(H5EA_close(ea, H5AC_ind_read_dxpl_id) < 0)
+ if(H5EA_close(ea) < 0)
FAIL_STACK_ERROR
ea = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0)
TEST_ERROR
/* Try re-opening the array again (should fail, as array is now deleted) */
H5E_BEGIN_TRY {
- ea = H5EA_open(f, H5AC_ind_read_dxpl_id, ea_addr, NULL);
+ ea = H5EA_open(f, ea_addr, NULL);
} H5E_END_TRY;
if(ea) {
/* Close opened array */
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
/* Indicate error */
TEST_ERROR
@@ -1231,17 +1233,17 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
+ H5EA_close(ea);
if(ea2)
- H5EA_close(ea2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5EA_close(ea2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1253,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
*
*-------------------------------------------------------------------------
@@ -1285,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
*
*-------------------------------------------------------------------------
@@ -1314,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
*
*-------------------------------------------------------------------------
@@ -1342,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
*
*-------------------------------------------------------------------------
@@ -1414,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
*
*-------------------------------------------------------------------------
@@ -1459,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
*
*-------------------------------------------------------------------------
@@ -1503,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
*
*-------------------------------------------------------------------------
@@ -1532,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
*
*-------------------------------------------------------------------------
@@ -1558,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
*
*-------------------------------------------------------------------------
@@ -1656,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
*
*-------------------------------------------------------------------------
@@ -1698,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
*
*-------------------------------------------------------------------------
@@ -1750,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
*
*-------------------------------------------------------------------------
@@ -1784,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
*
*-------------------------------------------------------------------------
@@ -1810,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
*
*-------------------------------------------------------------------------
@@ -1851,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
*
*-------------------------------------------------------------------------
@@ -1935,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
*
*-------------------------------------------------------------------------
@@ -1969,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
*
*-------------------------------------------------------------------------
@@ -2005,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
*
*-------------------------------------------------------------------------
@@ -2031,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
*
*-------------------------------------------------------------------------
@@ -2068,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
*
*-------------------------------------------------------------------------
@@ -2086,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 */
@@ -2111,7 +2113,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -2119,7 +2121,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
TEST_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0)
TEST_ERROR
/* Verify high-water # of elements written */
@@ -2150,7 +2152,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5EA_get(ea, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify element is fill value for array */
@@ -2178,7 +2180,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5EA_get(ea, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify element is fill value for array */
@@ -2187,7 +2189,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Set element of array */
welmt = (uint64_t)7 + idx;
- if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
+ if(H5EA_set(ea, idx, &welmt) < 0)
FAIL_STACK_ERROR
/* Get the max. array index */
@@ -2215,7 +2217,7 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Retrieve element of array (set now) */
relmt = (uint64_t)0;
- if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5EA_get(ea, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify element is value written */
@@ -2232,30 +2234,30 @@ test_set_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5EA_close(ea);
+ 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
*
*-------------------------------------------------------------------------
@@ -2264,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 */
@@ -2285,7 +2287,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &ea, &ea_addr, NULL) < 0)
+ if(create_array(f, cparam, &ea, &ea_addr, NULL) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -2293,7 +2295,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
TEST_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &ea, ea_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &ea, ea_addr, tparam) < 0)
TEST_ERROR
/* Verify high-water # of elements written */
@@ -2314,7 +2316,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5EA_get(ea, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify element is fill value for array */
@@ -2323,7 +2325,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Set element of array */
welmt = (uint64_t)7 + idx;
- if(H5EA_set(ea, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
+ if(H5EA_set(ea, idx, &welmt) < 0)
FAIL_STACK_ERROR
/* Verify high-water # of elements written */
@@ -2365,7 +2367,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
/* Retrieve element of array (set now) */
relmt = (uint64_t)0;
- if(H5EA_get(ea, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5EA_get(ea, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify element is value written */
@@ -2376,7 +2378,7 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
for(cnt = 0; cnt < skip_elmts; cnt++) {
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5EA_get(ea, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0)
+ if(H5EA_get(ea, cnt, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify element is fill value for array */
@@ -2389,30 +2391,30 @@ test_skip_elmts(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam,
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(ea)
- H5EA_close(ea, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5EA_close(ea);
+ H5Fclose(file);
} H5E_END_TRY;
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
*
*-------------------------------------------------------------------------
@@ -2424,28 +2426,33 @@ 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 */
h5_reset();
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));
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Seed random #'s */
curr_time = HDtime(NULL);
HDsrandom((unsigned)curr_time);
/* 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
@@ -2464,7 +2471,7 @@ main(void)
init_cparam(&cparam);
/* Iterate over the testing parameters */
- for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; H5_INC_ENUM(earray_test_type_t, curr_test)) {
+ for(curr_test = EARRAY_TEST_NORMAL; curr_test < EARRAY_TEST_NTESTS; curr_test++) {
/* Initialize the testing parameters */
init_tparam(&tparam, &cparam);
@@ -2496,7 +2503,7 @@ main(void)
nerrors += test_delete_open(fapl, &cparam, &tparam);
/* Iterate over the type of capacity tests */
- for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; H5_INC_ENUM(earray_iter_type_t, curr_iter)) {
+ for(curr_iter = EARRAY_ITER_FW; curr_iter < EARRAY_ITER_NITERS; curr_iter++) {
hsize_t sblk; /* Super block index */
hsize_t dblk; /* Data block index */
hsize_t nelmts; /* # of elements to test */
@@ -2553,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 */
@@ -2585,6 +2592,10 @@ main(void)
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
if(nerrors)
goto error;
HDputs("All extensible array tests passed.");
@@ -2601,6 +2612,8 @@ error:
H5Pclose(fapl);
} H5E_END_TRY;
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */
diff --git a/test/efc.c b/test/efc.c
index bd008c8..9ae7d53 100644
--- a/test/efc.c
+++ b/test/efc.c
@@ -18,7 +18,9 @@
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5Fpkg.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5Pprivate.h" /* Property lists */
const char *FILENAME[] = {
"efc0",
@@ -30,14 +32,19 @@ const char *FILENAME[] = {
NULL
};
+/* Windows doesn't have PATH_MAX */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif /* !PATH_MAX */
+
/* Global patched filename buffer */
-static char filename[6][1024];
+#define N_FILENAMES 6
+static char *filename[N_FILENAMES];
/* Global property lists - just copies of the defaults (necessary to use
* internal functions */
-hid_t fcpl_id = -1;
-hid_t fapl_id = -1;
-hid_t dxpl_id = -1;
+hid_t fcpl_id = H5I_INVALID_HID;
+hid_t fapl_id = H5I_INVALID_HID;
/*-------------------------------------------------------------------------
@@ -68,15 +75,15 @@ test_single(void)
TESTING("single EFC");
- /* Set EFC size to 3. Do this instead of H5F_efc_create() so we can pass
- * a file pointer to H5F_efc_open containing the EFC. */
+ /* Set EFC size to 3. Do this instead of H5F__efc_create() so we can pass
+ * a file pointer to H5F__efc_open containing the EFC.
+ */
if(H5Pset_elink_file_cache_size(fapl_id, 3) < 0)
TEST_ERROR
/* Open parent file */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
/* Disable EFC for child files */
@@ -85,20 +92,19 @@ test_single(void)
/* Test 1: Open file 1 through EFC, close, then open normally, verify ref
- * count = 2, release EFC, verify ref count = 1. Verifies a file can be
- * held open by the EFC. */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ * count = 2, release EFC, verify ref count = 1. Verifies a file can be
+ * held open by the EFC.
+ */
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 1)
TEST_ERROR
@@ -109,15 +115,13 @@ test_single(void)
/* Test 2: Verify that subsequent efc_open requests return the cached top
* level file pointer. Open file 1 through EFC, close, open again, verify
* file pointers are the same. */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
ftmp1 = f1;
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1 != ftmp1)
TEST_ERROR
@@ -125,7 +129,7 @@ test_single(void)
TEST_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
@@ -133,40 +137,34 @@ test_single(void)
* that the one added first is evicted. Then reopen files in a different
* order. Open each file normally after closing through EFC the first time
* to track ref counts. */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 2)
TEST_ERROR
if(f2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 2)
TEST_ERROR
@@ -175,14 +173,12 @@ test_single(void)
if(f3->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f4 = H5F_efc_open(f0, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f0, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f4) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
@@ -193,8 +189,7 @@ test_single(void)
if(f4->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp3) < 0)
FAIL_STACK_ERROR
@@ -207,8 +202,7 @@ test_single(void)
if(f4->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -221,8 +215,7 @@ test_single(void)
if(f4->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -235,8 +228,7 @@ test_single(void)
if(f4->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (ftmp4 = H5F_efc_open(f0, filename[4], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp4 = H5F__efc_open(f0, filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp4) < 0)
FAIL_STACK_ERROR
@@ -249,7 +241,7 @@ test_single(void)
if(f4->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
@@ -270,17 +262,15 @@ test_single(void)
/* Test 4: Verify that files kept open through the EFC are not evicted by
- * H5F_efc_release(). */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ * H5F__efc_release(). */
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
@@ -288,7 +278,7 @@ test_single(void)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 1)
TEST_ERROR
@@ -300,42 +290,36 @@ test_single(void)
* filling up the cache. Open 4 files while holding the first open. Verify
* that the second file is evicted. Close the first file, reopen the
* second, and verify that the first file is evicted. */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp1->shared != f1->shared)
TEST_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f4 = H5F_efc_open(f0, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f0, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f4) < 0)
FAIL_STACK_ERROR
@@ -348,8 +332,8 @@ test_single(void)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f2) < 0)
FAIL_STACK_ERROR
@@ -357,8 +341,8 @@ test_single(void)
TEST_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
@@ -367,7 +351,7 @@ test_single(void)
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 1)
TEST_ERROR
@@ -383,50 +367,42 @@ test_single(void)
* prevents further files from being cached. Open and hold open 3 files
* through the EFC, then open the fourth and verify that it was not added to
* the EFC. */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp1->shared != f1->shared)
TEST_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp2->shared != f2->shared)
TEST_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp3->shared != f3->shared)
TEST_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f4 = H5F_efc_open(f0, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f0, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f4) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp4->shared->nrefs != 1)
TEST_ERROR
@@ -443,7 +419,7 @@ test_single(void)
TEST_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 1)
TEST_ERROR
@@ -464,23 +440,20 @@ test_single(void)
/* Test 7: Test multiple file opens. Open a file twice, close it once, then
- * verify that it is not evicted by H5F_efc_release(). */
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ * verify that it is not evicted by H5F__efc_release(). */
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
if(H5F_efc_close(f0, f2) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
@@ -488,7 +461,7 @@ test_single(void)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 1)
TEST_ERROR
@@ -538,39 +511,37 @@ test_graph_nocycle(void)
TESTING("graph of EFCs without cycles");
- /* Set EFC size to 8. Do this instead of H5F_efc_create() so we can pass
- * a file pointer to H5F_efc_open containing the EFC. Set to a high number
- * because we don't test the EFC becoming too large in this test. */
+ /* Set EFC size to 8. Do this instead of H5F__efc_create() so we can pass
+ * a file pointer to H5F__efc_open containing the EFC. Set to a high number
+ * because we don't test the EFC becoming too large in this test.
+ */
if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0)
TEST_ERROR
- /* Test 1: Simple 3 file chain. Open file 1 through file 0, then open file
- * 2 through file 1. Release file 0's EFC and verify that file 2 gets its
- * ref count reduced (implying file 1 was closed). Do the same with the
- * opening order reversed. */
+ /* Test 1: Simple 3 file chain. Open file 1 through file 0, then open file
+ * 2 through file 1. Release file 0's EFC and verify that file 2 gets its
+ * ref count reduced (implying file 1 was closed). Do the same with the
+ * opening order reversed.
+ */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f2) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 1)
TEST_ERROR
@@ -580,19 +551,16 @@ test_graph_nocycle(void)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(NULL == (ftmp1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(ftmp1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(ftmp1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_try_close(ftmp1, NULL) < 0)
FAIL_STACK_ERROR
@@ -600,12 +568,11 @@ test_graph_nocycle(void)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 1)
TEST_ERROR
@@ -619,47 +586,40 @@ test_graph_nocycle(void)
* has their own child file. Verifies that releasing the parent's EFC
* closes all 4 children. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f2) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f3, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f3, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, f4) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp4->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 1)
TEST_ERROR
@@ -676,26 +636,22 @@ test_graph_nocycle(void)
/* Test 3: Simple "inverted" tree. Two parent files share a child file,
* which has its own child file. Verify that the child's child is not
* closed until both parents' EFCs are released. First release through one
- * parent, then reopen through that parent and release the other, then
+ * parent, then reopen through that parent and release the other, then
* re-release the first parent. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
@@ -703,28 +659,27 @@ test_graph_nocycle(void)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f2) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f1->shared->efc) < 0)
+ if(H5F__efc_release(f1->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 1)
TEST_ERROR
@@ -741,25 +696,21 @@ test_graph_nocycle(void)
* shared the same child. Verify that releasing the parent file closes all
* files. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f3) < 0)
FAIL_STACK_ERROR
@@ -767,13 +718,12 @@ test_graph_nocycle(void)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 3)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 1)
TEST_ERROR
@@ -788,34 +738,29 @@ test_graph_nocycle(void)
* each cache f3 and f4. f3 caches f4. Verify that releasing f0 closes all
* files. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f0, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f0, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f4) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f1, filename[4], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f1, filename[4], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f4) < 0)
FAIL_STACK_ERROR
@@ -823,45 +768,41 @@ test_graph_nocycle(void)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f2, filename[4], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f2, filename[4], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f4) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f3, filename[4], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f3, filename[4], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, f4) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp4->shared->nrefs != 5)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp4->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 1)
TEST_ERROR
@@ -917,33 +858,33 @@ test_graph_cycle(void)
TESTING("graph of EFCs with cycles");
- /* Set EFC size to 8. Do this instead of H5F_efc_create() so we can pass
- * a file pointer to H5F_efc_open containing the EFC. Set to a high number
- * because we don't test the EFC becoming too large in this test. */
+ /* Set EFC size to 8. Do this instead of H5F__efc_create() so we can pass
+ * a file pointer to H5F__efc_open containing the EFC. Set to a high number
+ * because we don't test the EFC becoming too large in this test.
+ */
if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0)
TEST_ERROR
- /* Test 1: File caches itself. Verify that closing the file causes it to be
- * actually closed, and there is no other unexpected behavior. */
+ /* Test 1: File caches itself. Verify that closing the file causes it to be
+ * actually closed, and there is no other unexpected behavior.
+ */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp0) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -952,8 +893,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -965,15 +905,13 @@ test_graph_cycle(void)
/* Test 2: Indirectly referenced file caches itself. Same as above except
* the file is part of another file's EFC. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -981,23 +919,21 @@ test_graph_cycle(void)
TEST_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1008,8 +944,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
@@ -1019,15 +954,13 @@ test_graph_cycle(void)
/* Test 3: Simple 2 file cycle */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1035,17 +968,16 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1056,8 +988,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1067,19 +998,16 @@ test_graph_cycle(void)
/* Test 4: Simple 2 file cycle (indirectly referenced) */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1092,8 +1020,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
@@ -1103,26 +1030,23 @@ test_graph_cycle(void)
/* Test 5: Parallel double cycle */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1133,8 +1057,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1144,26 +1067,23 @@ test_graph_cycle(void)
/* Test 6: Parallel double cycle with release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1171,7 +1091,7 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 3)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1181,33 +1101,29 @@ test_graph_cycle(void)
/* Test 7: Chained parallel double cycle */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1222,8 +1138,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1233,33 +1148,29 @@ test_graph_cycle(void)
/* Test 8: Chained parallel double cycle with release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1271,7 +1182,7 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1281,18 +1192,15 @@ test_graph_cycle(void)
/* Test 9: Simple 2 file cycle, extra ID on root */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1309,8 +1217,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1320,18 +1227,15 @@ test_graph_cycle(void)
/* Test 10: Simple 2 file cycle, extra ID on second file */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1346,8 +1250,7 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(ftmp1->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -1357,16 +1260,14 @@ test_graph_cycle(void)
if(H5F_try_close(ftmp1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
@@ -1376,29 +1277,25 @@ test_graph_cycle(void)
/* Test 11: Parallel double cycle, extra ID on a child file */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1413,8 +1310,7 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 3)
TEST_ERROR
@@ -1424,24 +1320,21 @@ test_graph_cycle(void)
if(H5F_try_close(ftmp2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
@@ -1451,29 +1344,25 @@ test_graph_cycle(void)
/* Test 12: Parallel double cycle, extra ID on a child file, with release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -1484,14 +1373,14 @@ test_graph_cycle(void)
if(ftmp2->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
if(ftmp2->shared->nrefs != 1)
TEST_ERROR
- if(H5F_efc_release(ftmp2->shared->efc) < 0)
+ if(H5F__efc_release(ftmp2->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1505,36 +1394,31 @@ test_graph_cycle(void)
/* Test 13: Chained parallel double cycle, extra ID on a child file */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1553,8 +1437,7 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -1564,32 +1447,28 @@ test_graph_cycle(void)
if(H5F_try_close(ftmp3, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -1600,36 +1479,31 @@ test_graph_cycle(void)
/* Test 14: Chained parallel double cycle, extra ID on a child file, with
* release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f2) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp1) < 0)
FAIL_STACK_ERROR
@@ -1644,14 +1518,14 @@ test_graph_cycle(void)
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(ftmp3->shared->efc) < 0)
+ if(H5F__efc_release(ftmp3->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1665,30 +1539,26 @@ test_graph_cycle(void)
/* Test 15: One local and one remote cycle */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -1702,32 +1572,28 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -1737,30 +1603,26 @@ test_graph_cycle(void)
/* Test 16: One local and one remote cycle, with release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -1771,31 +1633,28 @@ test_graph_cycle(void)
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -1805,33 +1664,28 @@ test_graph_cycle(void)
/* Test 17: One local and one remote cycle, remote cycle held open */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -1845,8 +1699,7 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -1858,24 +1711,21 @@ test_graph_cycle(void)
if(H5F_try_close(ftmp3, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -1886,33 +1736,28 @@ test_graph_cycle(void)
/* Test 18: One local and one remote cycle, remote cycle held open, with
* release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (ftmp3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -1923,34 +1768,31 @@ test_graph_cycle(void)
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(ftmp3->shared->nrefs != 2)
TEST_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 2)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(ftmp3->shared->efc) < 0)
+ if(H5F__efc_release(ftmp3->shared->efc) < 0)
FAIL_STACK_ERROR
if(ftmp3->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
@@ -1966,55 +1808,49 @@ test_graph_cycle(void)
/* Test 19: "Diamond" shape with links moving from bottom (root) to top.
* Also cycle between bottom (root) and top and cycles on the sides. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f1, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f1, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f4, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f4) < 0)
FAIL_STACK_ERROR
- if(NULL == (f5 = H5F_efc_open(f2, filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f5 = H5F__efc_open(f2, filename[5],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f5, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -2030,48 +1866,42 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f3, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f4 = H5F_open(filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f4->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f4, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f5 = H5F_open(filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f5->shared->nrefs != 1)
TEST_ERROR
@@ -2083,55 +1913,49 @@ test_graph_cycle(void)
* Also cycle between bottom (root) and top, cycles on the sides, and
* release the files instead of closing. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f1, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f1, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f4, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f4) < 0)
FAIL_STACK_ERROR
- if(NULL == (f5 = H5F_efc_open(f2, filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f5 = H5F__efc_open(f2, filename[5],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f5, ftmp2) < 0)
FAIL_STACK_ERROR
@@ -2144,47 +1968,42 @@ test_graph_cycle(void)
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f3, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f4 = H5F_open(filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f4->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f4, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f5 = H5F_open(filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f5->shared->nrefs != 1)
TEST_ERROR
@@ -2195,65 +2014,57 @@ test_graph_cycle(void)
/* Test 21: "Diamond" shape with links moving from bottom (root) to top.
* Also cycle between bottom (root) and top, cycles on sides held open. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f1, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f1, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f4, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f4) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f5 = H5F_efc_open(f2, filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f5 = H5F__efc_open(f2, filename[5],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f5, ftmp2) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f5) < 0)
FAIL_STACK_ERROR
- if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
@@ -2272,8 +2083,7 @@ test_graph_cycle(void)
TEST_ERROR
if(f5->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2289,8 +2099,7 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(f5->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2301,48 +2110,42 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f3, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f4 = H5F_open(filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f4->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f4, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f5 = H5F_open(filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f5->shared->nrefs != 1)
TEST_ERROR
@@ -2354,65 +2157,57 @@ test_graph_cycle(void)
* Also cycle between bottom (root) and top, cycles on sides held open.
* Also release the files instead of closing. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_efc_open(f1, filename[4],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F__efc_open(f1, filename[4],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f4, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f4, ftmp1) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f1, f4) < 0)
FAIL_STACK_ERROR
- if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f5 = H5F_efc_open(f2, filename[5],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f5 = H5F__efc_open(f2, filename[5],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f5, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f5, ftmp2) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f5) < 0)
FAIL_STACK_ERROR
- if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
@@ -2425,7 +2220,7 @@ test_graph_cycle(void)
if(f5->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2433,15 +2228,14 @@ test_graph_cycle(void)
TEST_ERROR
if(f5->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 3)
TEST_ERROR
if(H5F_try_close(f3, NULL) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f4->shared->efc) < 0)
+ if(H5F__efc_release(f4->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2449,15 +2243,14 @@ test_graph_cycle(void)
TEST_ERROR
if(f5->shared->nrefs != 2)
TEST_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 2)
TEST_ERROR
if(H5F_try_close(f3, NULL) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f5->shared->efc) < 0)
+ if(H5F__efc_release(f5->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -2465,8 +2258,7 @@ test_graph_cycle(void)
TEST_ERROR
if(f5->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -2484,86 +2276,82 @@ test_graph_cycle(void)
/* Test 23: Dense "ball" of files. 4 files each cache all files (including
* itself). */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp3) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp3) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp3) < 0)
FAIL_STACK_ERROR
@@ -2578,32 +2366,28 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -2614,86 +2398,82 @@ test_graph_cycle(void)
/* Test 24: Dense "ball" of files. 4 files each cache all files (including
* itself). Release the files instead of closing. */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f0, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f0, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f0, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f0, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f1, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f1, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f1, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp3) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f2, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f2, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f2, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f2, ftmp3) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f3, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp0) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp1 = H5F_efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp1 = H5F__efc_open(f3, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp1) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp2 = H5F_efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp2 = H5F__efc_open(f3, filename[2], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp2) < 0)
FAIL_STACK_ERROR
- if(NULL == (ftmp3 = H5F_efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp3 = H5F__efc_open(f3, filename[3], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f3, ftmp3) < 0)
FAIL_STACK_ERROR
@@ -2705,31 +2485,28 @@ test_graph_cycle(void)
if(H5F_efc_close(f0, f3) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f1 = H5F_open(filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
if(NULL == (f3 = H5F_open(filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -2739,15 +2516,13 @@ test_graph_cycle(void)
/* Test 25: File held open by EFC client interrupts cycle, with release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -2756,7 +2531,7 @@ test_graph_cycle(void)
if(f1->shared->nrefs != 1)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2767,7 +2542,7 @@ test_graph_cycle(void)
if(f0->shared->nrefs != 2)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -2777,30 +2552,27 @@ test_graph_cycle(void)
/* Test 26: File held open by EFC does not interrupt cycle, with release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_efc_open(f0, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f0, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
@@ -2817,30 +2589,26 @@ test_graph_cycle(void)
/* Test 27: File held open by EFC client through non-parent file does not
* interrupt cycle, but parent file does (no valid way around it) */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2859,8 +2627,7 @@ test_graph_cycle(void)
TEST_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2873,15 +2640,13 @@ test_graph_cycle(void)
TEST_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 2)
TEST_ERROR
@@ -2892,22 +2657,19 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 3)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 2)
TEST_ERROR
@@ -2916,29 +2678,25 @@ test_graph_cycle(void)
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f2, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -2950,30 +2708,26 @@ test_graph_cycle(void)
* interrupt cycle, but parent file does (no valid way around it), with
* release */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
if(H5F_efc_close(f0, f1) < 0)
FAIL_STACK_ERROR
if(NULL == (f2 = H5F_open(filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f2, filename[1], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_efc_open(f1, filename[3],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F__efc_open(f1, filename[3],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2984,7 +2738,7 @@ test_graph_cycle(void)
if(f3->shared->nrefs != 1)
TEST_ERROR
- if(H5F_efc_release(f0->shared->efc) < 0)
+ if(H5F__efc_release(f0->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -2995,7 +2749,7 @@ test_graph_cycle(void)
if(f3->shared->nrefs != 1)
TEST_ERROR
- if(H5F_efc_release(f2->shared->efc) < 0)
+ if(H5F__efc_release(f2->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -3010,21 +2764,19 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(H5F_efc_close(f2, f1) < 0)
FAIL_STACK_ERROR
- if(H5F_efc_release(f2->shared->efc) < 0)
+ if(H5F__efc_release(f2->shared->efc) < 0)
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
- if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f3->shared->nrefs != 1)
TEST_ERROR
@@ -3039,19 +2791,17 @@ test_graph_cycle(void)
/* Test 29: File without EFC interrupts cycle */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5Pset_elink_file_cache_size(fapl_id, 0) < 0)
TEST_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0)
TEST_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 2)
TEST_ERROR
@@ -3066,15 +2816,13 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
@@ -3084,15 +2832,13 @@ test_graph_cycle(void)
/* Test 30: File without EFC does not interrupt cycle */
if(NULL == (f0 = H5F_open(filename[0],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_efc_open(f0, filename[1],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F__efc_open(f0, filename[1],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
- if(NULL == (ftmp0 = H5F_efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
- fapl_id, dxpl_id)))
+ if(NULL == (ftmp0 = H5F__efc_open(f1, filename[0], H5F_ACC_RDWR, fcpl_id,
+ fapl_id)))
FAIL_STACK_ERROR
if(H5F_efc_close(f1, ftmp0) < 0)
FAIL_STACK_ERROR
@@ -3100,9 +2846,8 @@ test_graph_cycle(void)
FAIL_STACK_ERROR
if(H5Pset_elink_file_cache_size(fapl_id, 0) < 0)
TEST_ERROR
- if(NULL == (f2 = H5F_efc_open(f1, filename[2],
- H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F__efc_open(f1, filename[2],
+ H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(H5Pset_elink_file_cache_size(fapl_id, 8) < 0)
TEST_ERROR
@@ -3113,22 +2858,19 @@ test_graph_cycle(void)
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f0->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f0, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f1->shared->nrefs != 1)
TEST_ERROR
if(H5F_try_close(f1, NULL) < 0)
FAIL_STACK_ERROR
- if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id,
- dxpl_id)))
+ if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id)))
FAIL_STACK_ERROR
if(f2->shared->nrefs != 1)
TEST_ERROR
@@ -3150,8 +2892,7 @@ error:
*
* Purpose: Test the external file cache code
*
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Neil Fortner
* December 16, 2010
@@ -3161,23 +2902,44 @@ error:
int
main(void)
{
- unsigned nerrors = 0; /* track errors */
+ unsigned nerrors = 0; /* track errors */
+ H5P_genplist_t *plist; /* Property list pointer for FAPL */
+ H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ int i; /* iterator */
/* Test Setup */
- puts("Testing the external file cache");
+ HDputs("Testing the external file cache");
/* Create property lists */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
fapl_id = h5_fileaccess();
- dxpl_id = H5AC_ind_read_dxpl_id;
+
+ /* Allocate memory for filenames */
+ for(i = 0; i < N_FILENAMES; i++) {
+ filename[i] = (char *)HDcalloc(PATH_MAX, sizeof(char));
+ }
/* Patch filenames */
- h5_fixname(FILENAME[0], fapl_id, filename[0], sizeof(filename[0]));
- h5_fixname(FILENAME[1], fapl_id, filename[1], sizeof(filename[1]));
- h5_fixname(FILENAME[2], fapl_id, filename[2], sizeof(filename[2]));
- h5_fixname(FILENAME[3], fapl_id, filename[3], sizeof(filename[3]));
- h5_fixname(FILENAME[4], fapl_id, filename[4], sizeof(filename[4]));
- h5_fixname(FILENAME[5], fapl_id, filename[5], sizeof(filename[5]));
+ h5_fixname(FILENAME[0], fapl_id, filename[0], PATH_MAX);
+ h5_fixname(FILENAME[1], fapl_id, filename[1], PATH_MAX);
+ h5_fixname(FILENAME[2], fapl_id, filename[2], PATH_MAX);
+ h5_fixname(FILENAME[3], fapl_id, filename[3], PATH_MAX);
+ h5_fixname(FILENAME[4], fapl_id, filename[4], PATH_MAX);
+ h5_fixname(FILENAME[5], fapl_id, filename[5], PATH_MAX);
+
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
+ /* Get the VOL info from the fapl */
+ plist = (H5P_genplist_t *)H5I_object(fapl_id);
+ H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop);
+
+ /* Stash a copy of the "top-level" connector property, before any pass-through
+ * connectors modify or unwrap it.
+ */
+ H5CX_set_vol_connector_prop(&connector_prop);
/* Test Functions */
nerrors += test_single();
@@ -3191,22 +2953,38 @@ main(void)
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0)
+ FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
if(nerrors)
goto error;
- puts("All external file cache tests passed.");
+ HDputs("All external file cache tests passed.");
h5_clean_files(FILENAME, fapl_id);
- return 0;
+ for(i = 0; i < N_FILENAMES; i++) {
+ HDfree(filename[i]);
+ }
+
+ return EXIT_SUCCESS;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Pclose(fapl_id);
} H5E_END_TRY
- return 1;
+ if(api_ctx_pushed)
+ H5CX_pop();
+
+ for(i = 0; i < N_FILENAMES; i++) {
+ HDfree(filename[i]);
+ }
+
+ return EXIT_FAILURE;
} /* end main() */
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
index 36db2d0..54f3fb0 100644
--- a/test/enc_dec_plist.c
+++ b/test/enc_dec_plist.c
@@ -15,75 +15,139 @@
* Serial tests for encoding/decoding plists
*/
-#include "h5test.h"
+#include "testhdf5.h"
#include "H5ACprivate.h"
#include "H5Pprivate.h"
+#define SRC_FNAME "source_file.h5"
+#define SRC_DSET "src_dset"
+
static int
-test_encode_decode(hid_t orig_pl)
+test_encode_decode(hid_t orig_pl, H5F_libver_t low, H5F_libver_t high, hbool_t support_virtual)
{
- hid_t pl = (-1); /* Decoded property list */
+ hid_t pl = (-1); /* Decoded property list */
+ hid_t fapl = -1; /* File access property list */
void *temp_buf = NULL; /* Pointer to encoding buffer */
size_t temp_size = 0; /* Size of encoding buffer */
+ herr_t ret; /* Return value */
- /* first call to encode returns only the size of the buffer needed */
- if(H5Pencode(orig_pl, NULL, &temp_size) < 0)
- STACK_ERROR
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR
- if(NULL == (temp_buf = (void *)HDmalloc(temp_size)))
+ /* Set library version bounds */
+ if(H5Pset_libver_bounds(fapl, low, high) < 0)
TEST_ERROR
- if(H5Pencode(orig_pl, temp_buf, &temp_size) < 0)
- STACK_ERROR
+ H5E_BEGIN_TRY {
+ ret = H5Pencode2(orig_pl, NULL, &temp_size, fapl);
+ } H5E_END_TRY;
+
+ if(support_virtual && high < H5F_LIBVER_V110)
+ VERIFY(ret, FAIL, "H5Pencode2");
+ else {
+
+ VERIFY(ret, SUCCEED, "H5Pencode2");
+
+ /* Allocate the buffer for encoding */
+ if(NULL == (temp_buf = (void *)HDmalloc(temp_size)))
+ TEST_ERROR
+
+ /* Encode the property list to the buffer */
+ if(H5Pencode2(orig_pl, temp_buf, &temp_size, fapl) < 0)
+ TEST_ERROR
+
+ /* Decode the buffer */
+ if((pl = H5Pdecode(temp_buf)) < 0)
+ STACK_ERROR
+
+ /* Check if the original and the decoded property lists are equal */
+ if(!H5Pequal(orig_pl, pl))
+ PUTS_ERROR("encoding-decoding cycle failed\n")
+
+ /* Close the decoded property list */
+ if((H5Pclose(pl)) < 0)
+ TEST_ERROR
+
+ /* Free the buffer */
+ if(temp_buf)
+ HDfree(temp_buf);
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ /* Test H5Pencode1() */
+
+ /* first call to encode returns only the size of the buffer needed */
+ if(H5Pencode1(orig_pl, NULL, &temp_size) < 0)
+ STACK_ERROR
+
+ if(NULL == (temp_buf = (void *)HDmalloc(temp_size)))
+ TEST_ERROR
- if((pl = H5Pdecode(temp_buf)) < 0)
- STACK_ERROR
+ if(H5Pencode1(orig_pl, temp_buf, &temp_size) < 0)
+ STACK_ERROR
- if(!H5Pequal(orig_pl, pl))
- PUTS_ERROR("encoding-decoding cycle failed\n")
+ if((pl = H5Pdecode(temp_buf)) < 0)
+ STACK_ERROR
- if((H5Pclose(pl)) < 0)
- STACK_ERROR
+ if(!H5Pequal(orig_pl, pl))
+ PUTS_ERROR("encoding-decoding cycle failed\n")
- HDfree(temp_buf);
+ if((H5Pclose(pl)) < 0)
+ STACK_ERROR
+
+ if(temp_buf)
+ HDfree(temp_buf);
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+ }
+
+ if((H5Pclose(fapl)) < 0)
+ TEST_ERROR
/* Success */
return(0);
error:
- if(pl > 0)
- H5Pclose(pl);
if(temp_buf)
HDfree(temp_buf);
+ H5E_BEGIN_TRY {
+ H5Pclose(pl);
+ H5Pclose(fapl);
+ } H5E_END_TRY;
+
return(-1);
} /* end test_encode_decode() */
int
main(void)
{
- hid_t dcpl; /* dataset create prop. list */
- hid_t dapl; /* dataset access prop. list */
- hid_t dxpl; /* dataset xfer prop. list */
- hid_t gcpl; /* group create prop. list */
- hid_t ocpypl; /* object copy prop. list */
- hid_t ocpl; /* object create prop. list */
- hid_t lcpl; /* link create prop. list */
- hid_t lapl; /* link access prop. list */
- hid_t fapl; /* file access prop. list */
- hid_t fcpl; /* file create prop. list */
- hid_t strcpl; /* string create prop. list */
- hid_t acpl; /* attribute create prop. list */
-
- hsize_t chunk_size[2] = {16384, 4}; /* chunk size */
- double fill = 2.7f; /* Fill value */
- hsize_t max_size[1]; /* data space maximum size */
+ hid_t dcpl; /* dataset create prop. list */
+ hid_t dapl; /* dataset access prop. list */
+ hid_t dxpl; /* dataset xfer prop. list */
+ hid_t gcpl; /* group create prop. list */
+ hid_t ocpypl; /* object copy prop. list */
+ hid_t ocpl; /* object create prop. list */
+ hid_t lcpl; /* link create prop. list */
+ hid_t lapl; /* link access prop. list */
+ hid_t fapl; /* file access prop. list */
+ hid_t fcpl; /* file create prop. list */
+ hid_t strcpl; /* string create prop. list */
+ hid_t acpl; /* attribute create prop. list */
+ 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 */
+ double fill = 2.7f; /* Fill value */
+ hsize_t max_size[1]; /* data space maximum size */
size_t nslots = 521 * 2;
size_t nbytes = 1048576 * 10;
double w0 = 0.5f;
unsigned max_compact;
unsigned min_dense;
const char* c_to_f = "x+32";
+ H5F_libver_t low, high; /* Low and high bounds */
+
H5AC_cache_config_t my_cache_config = {
H5AC__CURR_CACHE_CONFIG_VERSION,
TRUE,
@@ -115,471 +179,516 @@ main(void)
0.2f,
(256 * 2048),
H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
+
H5AC_cache_image_config_t my_cache_image_config = {
- H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION,
- TRUE,
+ H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION,
+ TRUE,
FALSE,
- -1};
+ -1 };
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ char msg[80]; /* Message for file version bounds */
+ const char *low_string; /* The low bound string */
+ const char *high_string; /* The high bound string */
+
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
- if(VERBOSE_MED)
- printf("Encode/Decode DCPLs\n");
+ /* Display testing info */
+ 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);
- /******* ENCODE/DECODE DCPLS *****/
- TESTING("Default DCPL Encoding/Decoding");
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR
- /* Test encoding & decoding default property list */
- if(test_encode_decode(dcpl) < 0)
- FAIL_PUTS_ERROR("Default DCPL encoding/decoding failed\n")
+ if(VERBOSE_MED)
+ HDprintf("Encode/Decode DCPLs\n");
- PASSED();
+ /******* ENCODE/DECODE DCPLS *****/
+ TESTING("Default DCPL Encoding/Decoding");
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
- TESTING("DCPL Encoding/Decoding");
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(dcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default DCPL encoding/decoding failed\n")
- if((H5Pset_chunk(dcpl, 2, chunk_size)) < 0)
- FAIL_STACK_ERROR
+ PASSED();
- if((H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE)) < 0)
- FAIL_STACK_ERROR
+ TESTING("DCPL Encoding/Decoding");
- if((H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_chunk(dcpl, 2, chunk_size)) < 0)
+ FAIL_STACK_ERROR
- max_size[0] = 100;
- 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,
- (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
- FAIL_STACK_ERROR
- 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,
- (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(dcpl) < 0)
- FAIL_PUTS_ERROR("DCPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(dcpl)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ if((H5Pset_dset_no_attrs_hint(dcpl, FALSE)) < 0)
+ FAIL_STACK_ERROR
+ max_size[0] = 100;
+ 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,
+ (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
+ FAIL_STACK_ERROR
+ 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,
+ (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
+ FAIL_STACK_ERROR
- /******* ENCODE/DECODE DAPLS *****/
- TESTING("Default DAPL Encoding/Decoding");
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 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")
- /* Test encoding & decoding default property list */
- if(test_encode_decode(dapl) < 0)
- FAIL_PUTS_ERROR("Default DAPL encoding/decoding failed\n")
+ /* release resource */
+ if((H5Pclose(dcpl)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ PASSED();
- TESTING("DAPL Encoding/Decoding");
+ /******* ENCODE/DECODE DCPLS *****/
+ TESTING("DCPL Encoding/Decoding for virtual layout");
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_chunk_cache(dapl, nslots, nbytes, w0)) < 0)
- FAIL_STACK_ERROR
+ /* Set virtual layout */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(dapl) < 0)
- FAIL_PUTS_ERROR("DAPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(dapl)) < 0)
- FAIL_STACK_ERROR
+ /* Create source dataspace */
+ if((srcspace = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
- PASSED();
+ /* Create virtual dataspace */
+ if((vspace = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace, SRC_FNAME, SRC_DSET, srcspace) < 0)
+ TEST_ERROR
- /******* ENCODE/DECODE OCPLS *****/
- TESTING("Default OCPL Encoding/Decoding");
- if((ocpl = H5Pcreate(H5P_OBJECT_CREATE)) < 0)
- FAIL_STACK_ERROR
+ if(test_encode_decode(dcpl, low, high, TRUE) < 0)
+ FAIL_PUTS_ERROR("DCPL encoding/decoding failed\n")
- /* Test encoding & decoding default property list */
- if(test_encode_decode(ocpl) < 0)
- FAIL_PUTS_ERROR("Default OCPL encoding/decoding failed\n")
+ /* release resource */
+ if((H5Pclose(dcpl)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ /******* ENCODE/DECODE DAPLS *****/
+ TESTING("Default DAPL Encoding/Decoding");
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR
- TESTING("OCPL Encoding/Decoding");
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(dapl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default DAPL encoding/decoding failed\n")
- if((H5Pset_attr_creation_order(ocpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
- FAIL_STACK_ERROR
+ PASSED();
- if((H5Pset_attr_phase_change (ocpl, 110, 105)) < 0)
- FAIL_STACK_ERROR
+ TESTING("DAPL Encoding/Decoding");
- if((H5Pset_filter (ocpl, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_chunk_cache(dapl, nslots, nbytes, w0)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(ocpl) < 0)
- FAIL_PUTS_ERROR("OCPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(ocpl)) < 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")
- PASSED();
+ /* release resource */
+ if((H5Pclose(dapl)) < 0)
+ FAIL_STACK_ERROR
+ PASSED();
- /******* ENCODE/DECODE DXPLS *****/
- TESTING("Default DXPL Encoding/Decoding");
- if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
+ /******* ENCODE/DECODE OCPLS *****/
+ 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(dxpl) < 0)
- FAIL_PUTS_ERROR("Default DXPL encoding/decoding failed\n")
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(ocpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default OCPL encoding/decoding failed\n")
- PASSED();
+ PASSED();
- TESTING("DXPL Encoding/Decoding");
+ TESTING("OCPL Encoding/Decoding");
+
+ if((H5Pset_attr_creation_order(ocpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_attr_phase_change (ocpl, 110, 105)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_filter (ocpl, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(ocpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("OCPL encoding/decoding failed\n")
+
+ /* release resource */
+ if((H5Pclose(ocpl)) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED();
+
+ /******* ENCODE/DECODE DXPLS *****/
+ TESTING("Default DXPL Encoding/Decoding");
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(dxpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default DXPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("DXPL Encoding/Decoding");
+
+ if((H5Pset_btree_ratios(dxpl, 0.2f, 0.6f, 0.2f)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_hyper_vector_size(dxpl, 5)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_btree_ratios(dxpl, 0.2f, 0.6f, 0.2f)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_hyper_vector_size(dxpl, 5)) < 0)
- FAIL_STACK_ERROR
#ifdef H5_HAVE_PARALLEL
- if((H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_dxpl_mpio_chunk_opt(dxpl, H5FD_MPIO_CHUNK_MULTI_IO)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_dxpl_mpio_chunk_opt_ratio(dxpl, 30)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_dxpl_mpio_chunk_opt_num(dxpl, 40)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_chunk_opt(dxpl, H5FD_MPIO_CHUNK_MULTI_IO)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_chunk_opt_ratio(dxpl, 30)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_chunk_opt_num(dxpl, 40)) < 0)
+ FAIL_STACK_ERROR
#endif/* H5_HAVE_PARALLEL */
- if((H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_data_transform(dxpl, c_to_f)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_data_transform(dxpl, c_to_f)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(dxpl) < 0)
- FAIL_PUTS_ERROR("DXPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(dxpl)) < 0)
- FAIL_STACK_ERROR
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(dxpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("DXPL encoding/decoding failed\n")
- PASSED();
+ /* release resource */
+ if((H5Pclose(dxpl)) < 0)
+ FAIL_STACK_ERROR
+ PASSED();
- /******* ENCODE/DECODE GCPLS *****/
- TESTING("Default GCPL Encoding/Decoding");
- if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0)
- FAIL_STACK_ERROR
+ /******* 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) < 0)
- FAIL_PUTS_ERROR("Default GCPL encoding/decoding failed\n")
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(gcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default GCPL encoding/decoding failed\n")
- PASSED();
+ PASSED();
- TESTING("GCPL Encoding/Decoding");
+ TESTING("GCPL Encoding/Decoding");
- if((H5Pset_local_heap_size_hint(gcpl, 256)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_local_heap_size_hint(gcpl, 256)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_link_phase_change(gcpl, 2, 2)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_link_phase_change(gcpl, 2, 2)) < 0)
+ FAIL_STACK_ERROR
- /* Query the group creation properties */
- if((H5Pget_link_phase_change(gcpl, &max_compact, &min_dense)) < 0)
- FAIL_STACK_ERROR
+ /* Query the group creation properties */
+ if((H5Pget_link_phase_change(gcpl, &max_compact, &min_dense)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_est_link_info(gcpl, 3, 9)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_est_link_info(gcpl, 3, 9)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_link_creation_order(gcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_link_creation_order(gcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(gcpl) < 0)
- FAIL_PUTS_ERROR("GCPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(gcpl)) < 0)
- FAIL_STACK_ERROR
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(gcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("GCPL encoding/decoding failed\n")
- PASSED();
+ /* release resource */
+ if((H5Pclose(gcpl)) < 0)
+ FAIL_STACK_ERROR
+ PASSED();
- /******* ENCODE/DECODE LCPLS *****/
- TESTING("Default LCPL Encoding/Decoding");
- if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0)
- FAIL_STACK_ERROR
+ /******* ENCODE/DECODE LCPLS *****/
+ TESTING("Default LCPL Encoding/Decoding");
+ if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding default property list */
- if(test_encode_decode(lcpl) < 0)
- FAIL_PUTS_ERROR("Default LCPL encoding/decoding failed\n")
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(lcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default LCPL encoding/decoding failed\n")
- PASSED();
+ PASSED();
- TESTING("LCPL Encoding/Decoding");
+ TESTING("LCPL Encoding/Decoding");
- if((H5Pset_create_intermediate_group(lcpl, TRUE)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_create_intermediate_group(lcpl, TRUE)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(lcpl) < 0)
- FAIL_PUTS_ERROR("LCPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(lcpl)) < 0)
- FAIL_STACK_ERROR
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(lcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("LCPL encoding/decoding failed\n")
- PASSED();
+ /* release resource */
+ if((H5Pclose(lcpl)) < 0)
+ FAIL_STACK_ERROR
+ PASSED();
- /******* ENCODE/DECODE LAPLS *****/
- TESTING("Default LAPL Encoding/Decoding");
- if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0)
- FAIL_STACK_ERROR
- /* Test encoding & decoding default property list */
- if(test_encode_decode(lapl) < 0)
- FAIL_PUTS_ERROR("Default LAPL encoding/decoding failed\n")
+ /******* ENCODE/DECODE LAPLS *****/
+ TESTING("Default LAPL Encoding/Decoding");
+ if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(lapl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default LAPL encoding/decoding failed\n")
- TESTING("LAPL Encoding/Decoding");
+ PASSED();
- if((H5Pset_nlinks(lapl, (size_t)134)) < 0)
- FAIL_STACK_ERROR
+ TESTING("LAPL Encoding/Decoding");
- if((H5Pset_elink_acc_flags(lapl, H5F_ACC_RDONLY)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_nlinks(lapl, (size_t)134)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_elink_prefix(lapl, "/tmpasodiasod")) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_elink_acc_flags(lapl, H5F_ACC_RDONLY)) < 0)
+ FAIL_STACK_ERROR
- /* Create FAPL for the elink FAPL */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_alignment(fapl, 2, 1024)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_elink_prefix(lapl, "/tmpasodiasod")) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_elink_fapl(lapl, fapl)) < 0)
- FAIL_STACK_ERROR
+ /* Create FAPL for the elink FAPL */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_alignment(fapl, 2, 1024)) < 0)
+ FAIL_STACK_ERROR
- /* Close the elink's FAPL */
- if((H5Pclose(fapl)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_elink_fapl(lapl, fapl)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(lapl) < 0)
- FAIL_PUTS_ERROR("LAPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(lapl)) < 0)
- FAIL_STACK_ERROR
+ /* Close the elink's FAPL */
+ if((H5Pclose(fapl)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ /* 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
- /******* ENCODE/DECODE OCPYPLS *****/
- TESTING("Default OCPYPL Encoding/Decoding");
- if((ocpypl = H5Pcreate(H5P_OBJECT_COPY)) < 0)
- FAIL_STACK_ERROR
+ PASSED();
- /* Test encoding & decoding default property list */
- if(test_encode_decode(ocpypl) < 0)
- FAIL_PUTS_ERROR("Default OCPYPL encoding/decoding failed\n")
- PASSED();
+ /******* ENCODE/DECODE OCPYPLS *****/
+ TESTING("Default OCPYPL Encoding/Decoding");
+ if((ocpypl = H5Pcreate(H5P_OBJECT_COPY)) < 0)
+ FAIL_STACK_ERROR
- TESTING("OCPYPL Encoding/Decoding");
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(ocpypl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default OCPYPL encoding/decoding failed\n")
- if((H5Pset_copy_object(ocpypl, H5O_COPY_EXPAND_EXT_LINK_FLAG)) < 0)
- FAIL_STACK_ERROR
+ PASSED();
- if((H5Padd_merge_committed_dtype_path(ocpypl, "foo")) < 0)
- FAIL_STACK_ERROR
- if((H5Padd_merge_committed_dtype_path(ocpypl, "bar")) < 0)
- FAIL_STACK_ERROR
+ TESTING("OCPYPL Encoding/Decoding");
- /* Test encoding & decoding property list */
- if(test_encode_decode(ocpypl) < 0)
- FAIL_PUTS_ERROR("OCPYPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(ocpypl)) < 0)
- FAIL_STACK_ERROR
+ if((H5Pset_copy_object(ocpypl, H5O_COPY_EXPAND_EXT_LINK_FLAG)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ if((H5Padd_merge_committed_dtype_path(ocpypl, "foo")) < 0)
+ FAIL_STACK_ERROR
+ if((H5Padd_merge_committed_dtype_path(ocpypl, "bar")) < 0)
+ FAIL_STACK_ERROR
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(ocpypl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("OCPYPL encoding/decoding failed\n")
- /******* ENCODE/DECODE FAPLS *****/
- TESTING("Default FAPL Encoding/Decoding");
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- FAIL_STACK_ERROR
-
- /* Test encoding & decoding default property list */
- if(test_encode_decode(fapl) < 0)
- FAIL_PUTS_ERROR("Default FAPL encoding/decoding failed\n")
-
- PASSED();
-
- TESTING("FAPL Encoding/Decoding");
-
- if((H5Pset_family_offset(fapl, 1024)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_meta_block_size(fapl, 2098452)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_sieve_buf_size(fapl, 1048576)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_alignment(fapl, 2, 1024)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_cache(fapl, 1024, 128, 10485760, 0.3f)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_elink_file_cache_size(fapl, 10485760)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_gc_references(fapl, 1)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_small_data_block_size(fapl, 2048)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_fclose_degree(fapl, H5F_CLOSE_WEAK)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_multi_type(fapl, H5FD_MEM_GHEAP)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_mdc_config(fapl, &my_cache_config)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_mdc_image_config(fapl, &my_cache_image_config)) < 0)
- FAIL_STACK_ERROR
- if((H5Pset_core_write_tracking(fapl, TRUE, 1024 * 1024)) < 0)
- FAIL_STACK_ERROR
-
- /* Test encoding & decoding property list */
- if(test_encode_decode(fapl) < 0)
- FAIL_PUTS_ERROR("FAPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(fapl)) < 0)
- FAIL_STACK_ERROR
+ /* release resource */
+ if((H5Pclose(ocpypl)) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED();
+
+ /******* ENCODE/DECODE FAPLS *****/
+ TESTING("Default FAPL Encoding/Decoding");
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(fapl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default FAPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("FAPL Encoding/Decoding");
+
+ if((H5Pset_family_offset(fapl, 1024)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_meta_block_size(fapl, 2098452)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_sieve_buf_size(fapl, 1048576)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_alignment(fapl, 2, 1024)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_cache(fapl, 1024, 128, 10485760, 0.3f)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_elink_file_cache_size(fapl, 10485760)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_gc_references(fapl, 1)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_small_data_block_size(fapl, 2048)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_fclose_degree(fapl, H5F_CLOSE_WEAK)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_multi_type(fapl, H5FD_MEM_GHEAP)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_mdc_config(fapl, &my_cache_config)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_mdc_image_config(fapl, &my_cache_image_config)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(fapl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("FAPL encoding/decoding failed\n")
+
+ /* release resource */
+ if((H5Pclose(fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE FCPLS *****/
+ TESTING("Default FCPL Encoding/Decoding");
- PASSED();
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(fcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default FCPL encoding/decoding failed\n")
- /******* ENCODE/DECODE FCPLS *****/
- TESTING("Default FCPL Encoding/Decoding");
+ PASSED();
- if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- FAIL_STACK_ERROR
+ TESTING("FCPL Encoding/Decoding");
- /* Test encoding & decoding default property list */
- if(test_encode_decode(fcpl) < 0)
- FAIL_PUTS_ERROR("Default FCPL encoding/decoding failed\n")
+ if((H5Pset_userblock(fcpl, 1024) < 0))
+ FAIL_STACK_ERROR
- PASSED();
+ if((H5Pset_istore_k(fcpl, 3) < 0))
+ FAIL_STACK_ERROR
- TESTING("FCPL Encoding/Decoding");
+ if((H5Pset_sym_k(fcpl, 4, 5) < 0))
+ FAIL_STACK_ERROR
- if((H5Pset_userblock(fcpl, 1024) < 0))
- FAIL_STACK_ERROR
+ if((H5Pset_shared_mesg_nindexes(fcpl, 8) < 0))
+ FAIL_STACK_ERROR
- if((H5Pset_istore_k(fcpl, 3) < 0))
- FAIL_STACK_ERROR
+ if((H5Pset_shared_mesg_index(fcpl, 1, H5O_SHMESG_SDSPACE_FLAG, 32) < 0))
+ FAIL_STACK_ERROR
- if((H5Pset_sym_k(fcpl, 4, 5) < 0))
- FAIL_STACK_ERROR
+ if((H5Pset_shared_mesg_phase_change(fcpl, 60, 20) < 0))
+ FAIL_STACK_ERROR
- if((H5Pset_shared_mesg_nindexes(fcpl, 8) < 0))
- FAIL_STACK_ERROR
+ if((H5Pset_sizes(fcpl, 8, 4) < 0))
+ FAIL_STACK_ERROR
- if((H5Pset_shared_mesg_index(fcpl, 1, H5O_SHMESG_SDSPACE_FLAG, 32) < 0))
- FAIL_STACK_ERROR
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(fcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("FCPL encoding/decoding failed\n")
- if((H5Pset_shared_mesg_phase_change(fcpl, 60, 20) < 0))
- FAIL_STACK_ERROR
+ /* release resource */
+ if((H5Pclose(fcpl)) < 0)
+ FAIL_STACK_ERROR
- if((H5Pset_sizes(fcpl, 8, 4) < 0))
- FAIL_STACK_ERROR
+ PASSED();
- /* Test encoding & decoding property list */
- if(test_encode_decode(fcpl) < 0)
- FAIL_PUTS_ERROR("FCPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(fcpl)) < 0)
- FAIL_STACK_ERROR
- PASSED();
+ /******* ENCODE/DECODE STRCPLS *****/
+ TESTING("Default STRCPL Encoding/Decoding");
+ if((strcpl = H5Pcreate(H5P_STRING_CREATE)) < 0)
+ FAIL_STACK_ERROR
- /******* ENCODE/DECODE STRCPLS *****/
- TESTING("Default STRCPL Encoding/Decoding");
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(strcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default STRCPL encoding/decoding failed\n")
- if((strcpl = H5Pcreate(H5P_STRING_CREATE)) < 0)
- FAIL_STACK_ERROR
+ PASSED();
- /* Test encoding & decoding default property list */
- if(test_encode_decode(strcpl) < 0)
- FAIL_PUTS_ERROR("Default STRCPL encoding/decoding failed\n")
+ TESTING("STRCPL Encoding/Decoding");
- PASSED();
+ if((H5Pset_char_encoding(strcpl, H5T_CSET_UTF8) < 0))
+ FAIL_STACK_ERROR
- TESTING("STRCPL Encoding/Decoding");
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(strcpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("STRCPL encoding/decoding failed\n")
- if((H5Pset_char_encoding(strcpl, H5T_CSET_UTF8) < 0))
- FAIL_STACK_ERROR
+ /* release resource */
+ if((H5Pclose(strcpl)) < 0)
+ FAIL_STACK_ERROR
- /* Test encoding & decoding property list */
- if(test_encode_decode(strcpl) < 0)
- FAIL_PUTS_ERROR("STRCPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(strcpl)) < 0)
- FAIL_STACK_ERROR
+ PASSED();
- PASSED();
+ /******* ENCODE/DECODE ACPLS *****/
+ TESTING("Default ACPL Encoding/Decoding");
- /******* ENCODE/DECODE ACPLS *****/
- TESTING("Default ACPL Encoding/Decoding");
+ if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0)
+ FAIL_STACK_ERROR
- if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0)
- FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(acpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("Default ACPL encoding/decoding failed\n")
- /* Test encoding & decoding default property list */
- if(test_encode_decode(acpl) < 0)
- FAIL_PUTS_ERROR("Default ACPL encoding/decoding failed\n")
+ PASSED();
- PASSED();
+ TESTING("ACPL Encoding/Decoding");
- TESTING("ACPL Encoding/Decoding");
+ if((H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0))
+ FAIL_STACK_ERROR
- if((H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0))
- FAIL_STACK_ERROR
+ /* Test encoding & decoding property list */
+ if(test_encode_decode(acpl, low, high, FALSE) < 0)
+ FAIL_PUTS_ERROR("ACPL encoding/decoding failed\n")
- /* Test encoding & decoding property list */
- if(test_encode_decode(acpl) < 0)
- FAIL_PUTS_ERROR("ACPL encoding/decoding failed\n")
-
- /* release resource */
- if((H5Pclose(acpl)) < 0)
- FAIL_STACK_ERROR
+ /* release resource */
+ if((H5Pclose(acpl)) < 0)
+ FAIL_STACK_ERROR
- PASSED();
+ PASSED();
+ } /* end high */
+ } /* end low */
return 0;
error:
- printf("***** Plist Encode/Decode tests FAILED! *****\n");
+HDprintf("***** Plist Encode/Decode tests FAILED! *****\n");
return 1;
}
diff --git a/test/enc_dec_plist_cross_platform.c b/test/enc_dec_plist_cross_platform.c
index 1fbb41b..f54f675 100644
--- a/test/enc_dec_plist_cross_platform.c
+++ b/test/enc_dec_plist_cross_platform.c
@@ -28,7 +28,7 @@ int
main(void)
{
if(VERBOSE_MED)
- printf("Encode/Decode property list endianess\n");
+ HDprintf("Encode/Decode property list endianess\n");
/******* ENCODE/DECODE DCPLS *****/
TESTING("Default DCPL Encoding/Decoding");
@@ -157,7 +157,7 @@ error:
}
static int
-test_plists(const char *filename_prefix)
+test_plists(const char *filename_prefix)
{
unsigned config_1, config_2;
int fd_1, fd_2;
@@ -227,7 +227,7 @@ test_plists(const char *filename_prefix)
return 1;
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 4e20713..109f7c3 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -128,7 +128,7 @@ test_conv(hid_t file)
{
hid_t cwg=-1, type=-1, space=-1, dset=-1;
c_e1 val;
- /* Some values are out of range for testing. The library should accept them */
+ /* Some values are out of range for testing. The library should accept them */
static c_e1 data1[]={E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE,
E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED,
E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE,
@@ -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;
@@ -374,7 +374,7 @@ test_tr2(hid_t file)
E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED};
c_e1 data2[10];
- TESTING("O(log N) converions");
+ TESTING("O(log N) conversions");
if((cwg = H5Gcreate2(file, "test_tr2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_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 eee150b..eb86760 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,10 @@ const char *FILENAME[] = {
#define DIM0 100
#define DIM1 200
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
+int **ipoints2 = NULL;
+int **icheck2 = NULL;
+int *ipoints2_data = NULL;
+int *icheck2_data = NULL;
#define DSET_NAME "a_dataset"
#define FAKE_ID (hid_t)-1
@@ -43,17 +46,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 +65,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 +76,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 +95,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 +106,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 +127,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 +138,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 +155,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 +180,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 +191,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 +208,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 +233,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 +298,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 +344,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 +365,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 +384,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 +414,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 +436,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 +452,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 +468,32 @@ dump_error(void)
int
main(void)
{
- hid_t file, fapl;
- char filename[1024];
- const char *FUNC_main="main";
+ hid_t file, fapl;
+ char filename[1024];
+ const char *FUNC_main="main";
+ int i;
- fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There're 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();
+ /* Set up data arrays */
+ if(NULL == (ipoints2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (ipoints2 = (int **)HDcalloc(DIM0, sizeof(ipoints2_data))))
+ TEST_ERROR;
+ for (i = 0; i < DIM0; i++)
+ ipoints2[i] = ipoints2_data + (i * DIM1);
+
+ if(NULL == (icheck2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (icheck2 = (int **)HDcalloc(DIM0, sizeof(icheck2_data))))
+ TEST_ERROR;
+ for (i = 0; i < DIM0; i++)
+ icheck2[i] = icheck2_data + (i * DIM1);
+
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 +519,21 @@ main(void)
if(H5Fclose(file) < 0) TEST_ERROR ;
h5_clean_files(FILENAME, fapl);
- printf("All error API tests passed.\n");
+ HDfree(ipoints2);
+ HDfree(ipoints2_data);
+ HDfree(icheck2);
+ HDfree(icheck2_data);
+
+ HDprintf("All error API tests passed.\n");
return 0;
- error:
- printf("***** ERROR TEST FAILED! *****\n");
+error:
+ HDfree(ipoints2);
+ HDfree(ipoints2_data);
+ HDfree(icheck2);
+ HDfree(icheck2_data);
+
+ 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 9c39065..7c6cf9f 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,10 @@ const char *FILENAME[] = {
#define DIM0 100
#define DIM1 200
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
+int **ipoints2 = NULL;
+int **icheck2 = NULL;
+int *ipoints2_data = NULL;
+int *icheck2_data = NULL;
hid_t ERR_CLS;
hid_t ERR_CLS2;
@@ -80,37 +83,35 @@ 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
- *
- * Purpose: Test error API functions
+ * Function: test_error
*
- * Return: Success: 0
+ * Purpose: Test error API functions
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
static herr_t
test_error(hid_t file)
{
- hid_t dataset, space;
- hid_t estack_id;
- hsize_t dims[2];
+ hid_t dataset = -1;
+ hid_t space = -1;
+ hid_t estack_id = -1;
+ hsize_t dims[2];
const char *FUNC_test_error = "test_error";
H5E_auto2_t old_func;
- void *old_data;
+ void *old_data = NULL;
HDfprintf(stderr, "\nTesting error API based on data I/O\n");
/* Create the data space */
dims[0] = DIM0;
dims[1] = DIM1;
- if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR;
+ if ((space = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR;
/* Test H5E_BEGIN_TRY */
H5E_BEGIN_TRY {
@@ -118,40 +119,40 @@ test_error(hid_t file)
} H5E_END_TRY;
/* Create the dataset */
- if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE,
"H5Dcreate2 failed");
goto error;
- } /* end if */
+ }
/* Test enabling and disabling default printing */
- if(H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0)
- TEST_ERROR;
- if(old_data != NULL)
- TEST_ERROR;
+ if (H5Eget_auto2(H5E_DEFAULT, &old_func, &old_data) < 0)
+ TEST_ERROR;
+ if (old_data != NULL)
+ TEST_ERROR;
#ifdef H5_USE_16_API
if (old_func != (H5E_auto_t)H5Eprint)
- TEST_ERROR;
+ TEST_ERROR;
#else /* H5_USE_16_API */
if (old_func != (H5E_auto2_t)H5Eprint2)
- TEST_ERROR;
+ TEST_ERROR;
#endif /* H5_USE_16_API */
- if(H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0)
+ if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0)
TEST_ERROR;
/* Make H5Dwrite fail, verify default print is disabled */
- if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) {
+ if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) >= 0) {
H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE,
"H5Dwrite shouldn't succeed");
goto error;
- } /* end if */
+ }
- if(H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0)
+ if (H5Eset_auto2(H5E_DEFAULT, old_func, old_data) < 0)
TEST_ERROR;
/* Test saving and restoring the current error stack */
- if(H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) {
+ if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) {
H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE,
"H5Dwrite failed as supposed to");
estack_id = H5Eget_current_stack();
@@ -159,10 +160,11 @@ test_error(hid_t file)
H5Sclose(space);
H5Eset_current_stack(estack_id);
goto error;
- } /* end if */
+ }
/* In case program comes to this point, close dataset */
- if(H5Dclose(dataset) < 0) TEST_ERROR;
+ if(H5Dclose(dataset) < 0)
+ TEST_ERROR;
TEST_ERROR;
@@ -170,18 +172,14 @@ test_error(hid_t file)
return -1;
} /* end test_error() */
-
+
/*-------------------------------------------------------------------------
- * Function: init_error
- *
- * Purpose: Initialize error information.
- *
- * Return: Success: 0
+ * Function: init_error
*
- * Failure: -1
+ * Purpose: Initialize error information.
*
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -194,46 +192,46 @@ init_error(void)
char *msg = NULL;
H5E_type_t msg_type;
- if(NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1)))
+ if (NULL == (cls_name = (char *)HDmalloc(HDstrlen(ERR_CLS_NAME) + 1)))
TEST_ERROR
- if(NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1)))
+ if (NULL == (msg = (char *)HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1)))
TEST_ERROR
- if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0)
+ if ((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS)) < 0)
TEST_ERROR;
- if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1)
+ if (cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1)
TEST_ERROR;
- if(HDstrcmp(ERR_CLS_NAME, cls_name))
+ if (HDstrcmp(ERR_CLS_NAME, cls_name))
TEST_ERROR;
- if((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0)
+ if ((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG)) < 0)
TEST_ERROR;
- if((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0)
+ if ((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG)) < 0)
TEST_ERROR;
- if((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0)
+ if ((ERR_MAJ_API = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_API_MSG)) < 0)
TEST_ERROR;
- if((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0)
+ if ((ERR_MIN_SUBROUTINE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_SUBROUTINE_MSG)) < 0)
TEST_ERROR;
- if((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0)
+ if ((ERR_MIN_ERRSTACK = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_ERRSTACK_MSG)) < 0)
TEST_ERROR;
- if((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0)
+ if ((ERR_MIN_CREATE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_CREATE_MSG)) < 0)
TEST_ERROR;
- if((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0)
+ if ((ERR_MIN_WRITE = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_WRITE_MSG)) < 0)
TEST_ERROR;
- if((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0)
+ if ((ERR_MIN_GETNUM = H5Ecreate_msg(ERR_CLS, H5E_MINOR, ERR_MIN_GETNUM_MSG)) < 0)
TEST_ERROR;
- if(msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1)
+ if (msg_size != H5Eget_msg(ERR_MIN_SUBROUTINE, &msg_type, msg, (size_t)msg_size) + 1)
TEST_ERROR;
- if(msg_type != H5E_MINOR)
+ if (msg_type != H5E_MINOR)
TEST_ERROR;
- if(HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG))
+ if (HDstrcmp(msg, ERR_MIN_SUBROUTINE_MSG))
TEST_ERROR;
/* Register another class for later testing. */
- if((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0)
+ if ((ERR_CLS2 = H5Eregister_class(ERR_CLS2_NAME, PROG2_NAME, PROG_VERS)) < 0)
TEST_ERROR;
HDfree(cls_name);
@@ -242,26 +240,22 @@ init_error(void)
return 0;
error:
- if(cls_name)
+ if (cls_name)
HDfree(cls_name);
- if(msg)
+ if (msg)
HDfree(msg);
return -1;
} /* end init_error() */
-
+
/*-------------------------------------------------------------------------
- * Function: error_stack
+ * Function: error_stack
*
- * Purpose: Manipulates current error stack.
+ * Purpose: Manipulates current error stack.
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * July 14, 2003
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -271,23 +265,23 @@ error_stack(void)
ssize_t err_num;
const char *FUNC_error_stack = "error_stack";
- if((err_num = H5Eget_num(H5E_DEFAULT)) < 0)
+ if ((err_num = H5Eget_num(H5E_DEFAULT)) < 0)
TEST_ERROR;
- if(err_num)
+ if (err_num)
TEST_ERROR;
- if((ERR_STACK = H5Eget_current_stack()) < 0)
+ if ((ERR_STACK = H5Eget_current_stack()) < 0)
TEST_ERROR;
/* Make it push error, force this function to fail */
- if((err_num = H5Eget_num(ERR_STACK)) == 0) {
+ if ((err_num = H5Eget_num(ERR_STACK)) == 0) {
H5Epush(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM,
"Get number test failed, returned %d", (int)err_num);
goto error;
- } /* end if */
+ }
/* In case program falls through here, close the stack and let it fail. */
- if(H5Eclose_stack(ERR_STACK) < 0)
+ if (H5Eclose_stack(ERR_STACK) < 0)
TEST_ERROR;
return -1;
@@ -296,18 +290,14 @@ error:
return -1;
} /* end error_stack() */
-
+
/*-------------------------------------------------------------------------
* Function: long_desc_cb
*
- * Purpose: Callback function to help test long description handling
- *
- * Return: Success: 0
+ * Purpose: Callback function to help test long description handling
*
- * Failure: -1
- *
- * Programmer: Quincey Koziol
- * January 19, 2005
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -316,27 +306,30 @@ long_desc_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *clie
{
char *real_desc = (char *)client_data;
- if(err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0)
- return(0);
+ if (err_desc->desc != NULL && HDstrcmp(err_desc->desc, real_desc) == 0)
+ return 0;
else
- return(-1);
+ return -1;
} /* end long_desc_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_long_desc
+ * Function: test_long_desc
*
- * Purpose: Test long error description handling
+ * Purpose: Test long error description handling
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Quincey Koziol
- * January 19, 2005
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'full_desc' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
test_long_desc(void)
{
@@ -347,56 +340,60 @@ test_long_desc(void)
const char *test_FUNC = "test_long_desc";
/* Allocate space for the error description info */
- if(NULL == (long_desc = (char*)HDmalloc(LONG_DESC_SIZE))) TEST_ERROR;
- if(NULL == (full_desc = (char*)HDmalloc(LONG_DESC_SIZE + 128))) TEST_ERROR;
+ if (NULL == (long_desc = (char *)HDmalloc(LONG_DESC_SIZE)))
+ TEST_ERROR;
+ if (NULL == (full_desc = (char *)HDmalloc(LONG_DESC_SIZE + 128)))
+ TEST_ERROR;
/* Create the long part of the error description */
- for(u = 0; u < LONG_DESC_SIZE; u++)
+ for (u = 0; u < LONG_DESC_SIZE; u++)
long_desc[u] = (char)('A' + (u % 26));
long_desc[LONG_DESC_SIZE - 1] = '\0';
/* Clear the default error stack */
- if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR;
+ if (H5Eclear2(H5E_DEFAULT) < 0)
+ TEST_ERROR;
/* Push an error with a long description */
- if(H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0) TEST_ERROR;
+ if (H5Epush(H5E_DEFAULT, __FILE__, test_FUNC, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, format, long_desc) < 0)
+ TEST_ERROR;
/* Create the string that should be in the description. Must use HDsnprintf here
- * because snprintf is _snprintf on Windows */
+ * because snprintf is _snprintf on Windows
+ */
HDsnprintf(full_desc, (size_t)(LONG_DESC_SIZE + 128), format, long_desc);
/* Make certain that the description is correct */
- if(H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0) TEST_ERROR;
+ if (H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, long_desc_cb, full_desc) < 0)
+ TEST_ERROR;
/* Clear the default error stack again */
- if(H5Eclear2(H5E_DEFAULT) < 0) TEST_ERROR;
+ if (H5Eclear2(H5E_DEFAULT) < 0)
+ TEST_ERROR;
HDfree(long_desc);
HDfree(full_desc);
- return(0);
+ return 0;
error:
- if(long_desc)
+ if (long_desc)
HDfree(long_desc);
- if(full_desc)
+ if (full_desc)
HDfree(full_desc);
- return(-1);
+ return -1;
} /* end test_long_desc() */
+H5_GCC_DIAG_ON(format-nonliteral)
+
-
/*-------------------------------------------------------------------------
* Function: dump_error
*
- * Purpose: Prints error stack in default and customized ways.
- *
- * Return: Success: 0
- *
- * Failure: -1
+ * Purpose: Prints error stack in default and customized ways.
*
- * Programmer: Raymond Lu
- * July 17, 2003
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -405,12 +402,12 @@ dump_error(hid_t estack)
{
/* Print errors in library default way */
HDfprintf(stderr, "********* Print error stack in HDF5 default way *********\n");
- if(H5Eprint2(estack, stderr) < 0)
+ if (H5Eprint2(estack, stderr) < 0)
TEST_ERROR;
/* Customized way to print errors */
HDfprintf(stderr, "\n********* Print error stack in customized way *********\n");
- if(H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0)
+ if (H5Ewalk2(estack, H5E_WALK_UPWARD, custom_print_cb, stderr) < 0)
TEST_ERROR;
return 0;
@@ -419,43 +416,39 @@ error:
return -1;
} /* end dump_error() */
-
+
/*-------------------------------------------------------------------------
* Function: custom_print_cb
*
- * Purpose: Callback function to print error stack in customized way.
- *
- * Return: Success: 0
+ * Purpose: Callback function to print error stack in customized way.
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * July 17, 2003
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
static herr_t
custom_print_cb(unsigned n, const H5E_error2_t *err_desc, void* client_data)
{
- FILE *stream = (FILE *)client_data;
+ FILE *stream = (FILE *)client_data;
char maj[MSG_SIZE];
char min[MSG_SIZE];
char cls[MSG_SIZE];
- const int indent = 4;
+ const int indent = 4;
/* Get descriptions for the major and minor error numbers */
- if(H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0)
+ if (H5Eget_class_name(err_desc->cls_id, cls, MSG_SIZE) < 0)
TEST_ERROR;
- if(H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0)
+ if (H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE) < 0)
TEST_ERROR;
- if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0)
+ if (H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE) < 0)
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);
@@ -466,56 +459,60 @@ error:
return -1;
} /* end custom_print_cb() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_create
- *
- * Purpose: Test creating an empty error stack
+ * Function: test_create
*
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Test creating an empty error stack
*
- * Programmer: Quincey Koziol
- * November 1, 2007
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
static herr_t
test_create(void)
{
- const char *err_func = "test_create"; /* Function name for pushing error */
- const char *err_msg = "Error message"; /* Error message for pushing error */
- ssize_t err_num; /* Number of errors on stack */
- hid_t estack_id; /* Error stack ID */
+ const char *err_func = "test_create"; /* Function name for pushing error */
+ const char *err_msg = "Error message"; /* Error message for pushing error */
+ ssize_t err_num; /* Number of errors on stack */
+ hid_t estack_id = -1; /* Error stack ID */
/* Create an empty error stack */
- if((estack_id = H5Ecreate_stack()) < 0) TEST_ERROR
+ if ((estack_id = H5Ecreate_stack()) < 0)
+ TEST_ERROR
/* Check the number of errors on stack */
err_num = H5Eget_num(estack_id);
- if(err_num != 0) TEST_ERROR
+ if (err_num != 0)
+ TEST_ERROR
/* Push an error with a long description */
- if(H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR;
+ if (H5Epush(estack_id, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0)
+ TEST_ERROR;
/* Check the number of errors on stack */
err_num = H5Eget_num(estack_id);
- if(err_num != 1) TEST_ERROR
+ if (err_num != 1)
+ TEST_ERROR
/* Clear the error stack */
- if(H5Eclear2(estack_id) < 0) TEST_ERROR
+ if (H5Eclear2(estack_id) < 0)
+ TEST_ERROR
/* Check the number of errors on stack */
err_num = H5Eget_num(estack_id);
- if(err_num != 0) TEST_ERROR
+ if (err_num != 0)
+ TEST_ERROR
/* Close error stack */
- if(H5Eclose_stack(estack_id) < 0) TEST_ERROR
+ if(H5Eclose_stack(estack_id) < 0)
+ TEST_ERROR
- return(0);
+ return 0;
error:
- return(-1);
+ return -1;
} /* end test_create() */
/*-------------------------------------------------------------------------
@@ -526,70 +523,72 @@ error:
* Return: Success: 0
* Failure: -1
*
- * Programmer: Allen Byrne
- * February 18, 2010
- *
*-------------------------------------------------------------------------
*/
static herr_t
test_copy(void)
{
- const char *err_func = "test_copy"; /* Function name for pushing error */
- const char *err_msg = "Error message"; /* Error message for pushing error */
- ssize_t err_num; /* Number of errors on stack */
- hid_t estack_id; /* Error stack ID */
- herr_t ret; /* Generic return value */
+ const char *err_func = "test_copy"; /* Function name for pushing error */
+ const char *err_msg = "Error message"; /* Error message for pushing error */
+ ssize_t err_num; /* Number of errors on stack */
+ hid_t estack_id = -1; /* Error stack ID */
+ herr_t ret; /* Generic return value */
/* Push an error with a long description */
- if(H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0) TEST_ERROR;
+ if (H5Epush(H5E_DEFAULT, __FILE__, err_func, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "%s", err_msg) < 0)
+ TEST_ERROR;
/* Check the number of errors on stack */
err_num = H5Eget_num(H5E_DEFAULT);
- if(err_num != 1) TEST_ERROR
-
+ if (err_num != 1)
+ TEST_ERROR
+
/* Copy error stack, which clears the original */
- if((estack_id = H5Eget_current_stack()) < 0) TEST_ERROR
-
+ 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) TEST_ERROR
+ if (err_num != 1)
+ TEST_ERROR
/* Check the number of errors on original stack */
err_num = H5Eget_num(H5E_DEFAULT);
- if(err_num != 0) TEST_ERROR
+ if (err_num != 0)
+ TEST_ERROR
/* Put the stack copy as the default. It closes the stack copy, too. */
- if(H5Eset_current_stack(estack_id) < 0) TEST_ERROR
+ if (H5Eset_current_stack(estack_id) < 0)
+ TEST_ERROR
/* Check the number of errors on default stack */
err_num = H5Eget_num(H5E_DEFAULT);
- if(err_num != 1) TEST_ERROR
+ if (err_num != 1)
+ TEST_ERROR
- /* Try to close error stack copy. Should fail because
- * the current H5Eset_current_stack closes the stack to be set.*/
+ /* Try to close error stack copy. Should fail because
+ * the current H5Eset_current_stack closes the stack to be set.
+ */
H5E_BEGIN_TRY {
ret = H5Eclose_stack(estack_id);
} H5E_END_TRY
- if(ret >= 0) TEST_ERROR
+ if (ret >= 0)
+ TEST_ERROR
- return(0);
+ return 0;
error:
- return(-1);
+ return -1;
} /* end test_copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: close_error
- *
- * Purpose: Closes error information.
+ * Function: close_error
*
- * Return: Success: 0
+ * Purpose: Closes error information.
*
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -597,19 +596,19 @@ static herr_t
close_error(void)
{
/* Close major errors, let H5Eunregister_class close minor errors */
- if(H5Eclose_msg(ERR_MAJ_TEST) < 0)
+ if (H5Eclose_msg(ERR_MAJ_TEST) < 0)
TEST_ERROR;
- if(H5Eclose_msg(ERR_MAJ_IO) < 0)
+ if (H5Eclose_msg(ERR_MAJ_IO) < 0)
TEST_ERROR;
- if(H5Eclose_msg(ERR_MAJ_API) < 0)
+ if (H5Eclose_msg(ERR_MAJ_API) < 0)
TEST_ERROR;
- if(H5Eunregister_class(ERR_CLS) < 0)
+ if (H5Eunregister_class(ERR_CLS) < 0)
TEST_ERROR;
- if(H5Eunregister_class(ERR_CLS2) < 0)
+ if (H5Eunregister_class(ERR_CLS2) < 0)
TEST_ERROR;
return 0;
@@ -618,21 +617,17 @@ error:
return -1;
} /* end close_error() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_filter_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.
+ * 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.
*
- * Return: Success: 0
- *
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * 2 June 2011
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
@@ -640,71 +635,88 @@ static herr_t
test_filter_error(const char *fname)
{
const char *pathname = H5_get_srcdir_filename(fname); /* Corrected test file name */
- hid_t file, dataset; /* handles */
+ hid_t file = -1;
+ hid_t dataset = -1;
int buf[20];
HDfprintf(stderr, "\nTesting error message during data reading when filter isn't registered\n");
/* Open the file */
- if((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ if ((file = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Open the regular dataset */
- if((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0)
+ if ((dataset = H5Dopen2(file, DSET_FILTER_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0)
- TEST_ERROR;
+ if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) >= 0)
+ TEST_ERROR;
/* Close/release resources */
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
TEST_ERROR
- if(H5Fclose(file) < 0)
+ if (H5Fclose(file) < 0)
TEST_ERROR
return 0;
error:
return -1;
-}
+} /* end test_filter_error() */
+
-
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test error API.
- *
- * Programmer: Raymond Lu
- * July 10, 2003
+ * Purpose: Test error API.
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t file, fapl;
- hid_t estack_id;
- char filename[1024];
- const char *FUNC_main = "main";
+ hid_t file = -1;
+ hid_t fapl = -1;
+ hid_t estack_id = -1;
+ char filename[1024];
+ const char *FUNC_main = "main";
+ int i;
HDfprintf(stderr, " This program tests the Error API. There're supposed to be some error messages\n");
/* Initialize errors */
- if(init_error() < 0)
+ if (init_error() < 0)
TEST_ERROR;
- fapl = h5_fileaccess();
+ if ((fapl = h5_fileaccess()) < 0)
+ TEST_ERROR;
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR;
+ /* Set up data arrays */
+ if(NULL == (ipoints2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (ipoints2 = (int **)HDcalloc(DIM0, sizeof(ipoints2_data))))
+ TEST_ERROR;
+ for (i = 0; i < DIM0; i++)
+ ipoints2[i] = ipoints2_data + (i * DIM1);
+
+ if(NULL == (icheck2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (icheck2 = (int **)HDcalloc(DIM0, sizeof(icheck2_data))))
+ TEST_ERROR;
+ for (i = 0; i < DIM0; i++)
+ icheck2[i] = icheck2_data + (i * DIM1);
+
+ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
+ if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR;
/* Test error stack */
- if(error_stack() < 0) {
+ if (error_stack() < 0) {
/* Push an error onto error stack */
- if(H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK,
- "Error stack test failed") < 0) TEST_ERROR;
+ if (H5Epush(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK,
+ "Error stack test failed") < 0)
+ TEST_ERROR;
/* Delete an error from the top of error stack */
H5Epop(ERR_STACK, 1);
@@ -724,42 +736,57 @@ main(void)
} /* end if */
/* Test error API */
- if(test_error(file) < 0) {
+ if (test_error(file) < 0) {
H5Epush(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE,
"Error test failed, %s", "it's wrong");
estack_id = H5Eget_current_stack();
H5Eprint2(estack_id, stderr);
H5Eclose_stack(estack_id);
- } /* end if */
+ }
/* Test pushing a very long error description */
- if(test_long_desc() < 0) TEST_ERROR;
+ if (test_long_desc() < 0)
+ TEST_ERROR;
/* Test creating a new error stack */
- if(test_create() < 0) TEST_ERROR;
+ if (test_create() < 0)
+ TEST_ERROR;
/* Test copying a new error stack */
- if(test_copy() < 0) TEST_ERROR;
+ if (test_copy() < 0)
+ TEST_ERROR;
- if(H5Fclose(file) < 0) TEST_ERROR;
+ if (H5Fclose(file) < 0)
+ TEST_ERROR;
/* Close error information */
- if(close_error() < 0)
+ 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. */
+ * the test file was pre-generated.
+ */
h5_fixname(DATAFILE, H5P_DEFAULT, filename, sizeof filename);
- if(test_filter_error(filename) < 0)
+ if (test_filter_error(filename) < 0)
TEST_ERROR;
h5_clean_files(FILENAME, fapl);
+ HDfree(ipoints2);
+ HDfree(ipoints2_data);
+ HDfree(icheck2);
+ HDfree(icheck2_data);
+
HDfprintf(stderr, "\nAll error API tests passed.\n");
return 0;
error:
+ HDfree(ipoints2);
+ HDfree(ipoints2_data);
+ HDfree(icheck2);
+ HDfree(icheck2_data);
+
HDfprintf(stderr, "\n***** ERROR TEST FAILED (real problem)! *****\n");
return 1;
}
diff --git a/test/evict_on_close.c b/test/evict_on_close.c
index 6536837..9f6607a 100644
--- a/test/evict_on_close.c
+++ b/test/evict_on_close.c
@@ -11,11 +11,7 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Programmer: Dana Robinson
- * Spring 2016
- *
- * Purpose: Tests the basic operation of the evict-on-close cache
+/* Purpose: Tests the basic operation of the evict-on-close cache
* behavior. Tests that ensure the tagging is handled correctly
* are located in cache.c.
*/
@@ -36,6 +32,7 @@
#include "H5Fpkg.h"
#include "H5Gpkg.h"
#include "H5Ipkg.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Evict on close is not supported under parallel at this time.
* In the meantime, we just run a simple check that EoC can't be
@@ -76,7 +73,7 @@ const char *FILENAMES[] = {
#define SUBGROUP_NAME_SIZE 16
/* Prototypes */
-static hbool_t verify_tag_not_in_cache(H5F_t *f, haddr_t tag);
+static hbool_t verify_tag_not_in_cache(const H5F_t *f, haddr_t tag);
static herr_t check_evict_on_close_api(void);
static hid_t generate_eoc_test_file(hid_t fapl_id);
static herr_t check_dset_scheme(hid_t fid, const char *dset_name);
@@ -91,13 +88,10 @@ static herr_t check_group_layout(hid_t fid, const char *group_name);
*
* Return: TRUE/FALSE
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
-static hbool_t
-verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
+static H5_ATTR_PURE hbool_t
+verify_tag_not_in_cache(const H5F_t *f, haddr_t tag)
{
H5C_t *cache_ptr = NULL; /* cache pointer */
int i = 0; /* iterator */
@@ -114,8 +108,8 @@ verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
return TRUE;
else
entry_ptr = entry_ptr->ht_next;
- } /* end while */
- } /* end for */
+ }
+ }
return FALSE;
} /* end verify_tag_not_in_cache() */
@@ -129,9 +123,6 @@ verify_tag_not_in_cache(H5F_t *f, haddr_t tag)
* Return: Success: The file ID of the created file
* Failure: -1
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -207,7 +198,7 @@ generate_eoc_test_file(hid_t fapl_id)
TEST_ERROR;
if(H5Gclose(gid2) < 0)
TEST_ERROR;
- } /* end for */
+ }
if(H5Gclose(gid1) < 0)
TEST_ERROR;
@@ -303,7 +294,7 @@ generate_eoc_test_file(hid_t fapl_id)
TEST_ERROR;
if(H5Gclose(gid2) < 0)
TEST_ERROR;
- } /* end for */
+ }
if(H5Gclose(gid1) < 0)
TEST_ERROR;
@@ -593,9 +584,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -611,7 +599,7 @@ check_group_layout(hid_t fid, const char *group_name)
/* NOTE: The TESTING() macro is called in main() */
/* Get a pointer to the file struct */
- if(NULL == (file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE)))
+ if(NULL == (file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE)))
TEST_ERROR;
/* Record the number of cache entries */
@@ -627,7 +615,7 @@ check_group_layout(hid_t fid, const char *group_name)
/* Open the main group and get its tag */
if((gid1 = H5Gopen2(fid, group_name, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid1, H5I_GROUP)))
+ if(NULL == (grp_ptr = (H5G_t *)H5VL_object_verify(gid1, H5I_GROUP)))
TEST_ERROR;
tag1 = grp_ptr->oloc.addr;
@@ -644,7 +632,7 @@ check_group_layout(hid_t fid, const char *group_name)
if((gid2 = H5Gopen2(gid1, subgroup_name, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid2, H5I_GROUP)))
+ if(NULL == (grp_ptr = (H5G_t *)H5VL_object_verify(gid2, H5I_GROUP)))
TEST_ERROR;
tag2 = grp_ptr->oloc.addr;
@@ -710,9 +698,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Fall 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -728,7 +713,7 @@ check_dset_scheme(hid_t fid, const char *dset_name)
/* NOTE: The TESTING() macro is called in main() */
/* Get a pointer to the file struct */
- if(NULL == (file_ptr = (H5F_t *)H5I_object_verify(fid, H5I_FILE)))
+ if(NULL == (file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE)))
TEST_ERROR;
/* Create the data buffer */
@@ -748,7 +733,7 @@ check_dset_scheme(hid_t fid, const char *dset_name)
/* Open dataset and get the metadata tag */
if((did = H5Dopen2(fid, dset_name, H5P_DEFAULT)) < 0)
TEST_ERROR;
- if(NULL == (dset_ptr = (H5D_t *)H5I_object_verify(did, H5I_DATASET)))
+ if(NULL == (dset_ptr = (H5D_t *)H5VL_object_verify(did, H5I_DATASET)))
TEST_ERROR;
tag = dset_ptr->oloc.addr;
@@ -759,7 +744,7 @@ check_dset_scheme(hid_t fid, const char *dset_name)
TEST_ERROR;
/* Record the number of cache entries */
- during = file_ptr->shared->cache->index_len;
+ during = file_ptr->shared->cache->index_len;
#ifdef EOC_MANUAL_INSPECTION
HDprintf("\nCACHE AFTER DATA READ (WHILE OPEN):\n");
@@ -815,9 +800,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -873,7 +855,7 @@ check_evict_on_close_api(void)
/* ensure an invalid plist fails */
H5E_BEGIN_TRY {
- status = H5Pget_evict_on_close((hid_t)-1, &evict_on_close);
+ status = H5Pget_evict_on_close(H5I_INVALID_HID, &evict_on_close);
} H5E_END_TRY;
if(status >= 0)
FAIL_PUTS_ERROR("H5Pget_evict_on_close() accepted invalid hid_t.");
@@ -897,9 +879,6 @@ error:
*
* Return: EXIT_FAILURE/EXIT_SUCCESS
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
int
@@ -979,7 +958,7 @@ main(void)
HDprintf("All evict-on-close tests passed.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
@@ -992,7 +971,7 @@ error:
H5Pclose(fapl_id);
} H5E_END_TRY;
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* end main() */
@@ -1007,9 +986,6 @@ error:
*
* Return: SUCCEED/FAIL
*
- * Programmer: Dana Robinson
- * Spring 2017
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -1052,9 +1028,6 @@ error:
*
* Return: EXIT_FAILURE/EXIT_SUCCESS
*
- * Programmer: Dana Robinson
- * Spring 2016
- *
*-------------------------------------------------------------------------
*/
int
@@ -1076,14 +1049,14 @@ main(void)
HDprintf("All evict-on-close tests passed.\n");
HDprintf("Note that EoC is not supported under parallel so most tests are skipped.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
error:
HDprintf("***** %u evict-on-close test%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
- return EXIT_FAILURE;
+ HDexit(EXIT_FAILURE);
} /* main() - parallel */
diff --git a/test/extend.c b/test/extend.c
index e5c3cb3..1e2b5b5 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -25,11 +25,16 @@ const char *FILENAME[] = {
NULL
};
-#define NX 100 /* USE AN EVEN NUMBER!*/
-#define NY 100 /* USE AN EVEN NUMBER!*/
+#define N1X 100 /* USE AN EVEN NUMBER! */
+#define N1Y 100 /* USE AN EVEN NUMBER! */
+#define N2X (N1X / 2)
+#define N2Y (N1Y / 2)
/* Data buffers */
-static int buf1[NY][NX], buf2[NX / 2][NY / 2];
+static int **buf1 = NULL;
+static int *buf1_data = NULL;
+static int **buf2 = NULL;
+static int *buf2_data = NULL;
/*-------------------------------------------------------------------------
@@ -49,8 +54,8 @@ static int
write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t mem_space)
{
hid_t dataset, file_space, half_space;
- static const hsize_t dims[2] = {NX, NY};
- static const hsize_t half_dims[2] = {NX / 2, NY / 2};
+ static const hsize_t dims[2] = {N1X, N1Y};
+ static const hsize_t half_dims[2] = {N2X, N2Y};
hsize_t size[2];
hsize_t max_size[2] = {0, 0};
hsize_t offset[2];
@@ -63,13 +68,13 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me
/* Write the data */
for(i = 0; i < 5; i++)
- for(j = 0; j < 5; j++) {
+ for(j = 0; j < 5; j++) {
- /* Extend the dataset */
- offset[0] = (hsize_t)(i * NX);
- offset[1] = (hsize_t)(j * NY);
- size[0] = offset[0] + NX;
- size[1] = offset[1] + NY;
+ /* Extend the dataset */
+ offset[0] = (hsize_t)(i * N1X);
+ offset[1] = (hsize_t)(j * N1Y);
+ size[0] = offset[0] + N1X;
+ size[1] = offset[1] + N1Y;
if(size[0] > max_size[0] || size[1] > max_size[1]) {
if(size[0] > max_size[0])
max_size[0] = size[0];
@@ -78,42 +83,41 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me
if(H5Dset_extent(dataset, max_size) < 0) TEST_ERROR;
} /* end if */
- /* Select a hyperslab */
+ /* Select a hyperslab */
if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
- if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR;
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR;
- /* Write to the hyperslab */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR;
+ /* Write to the hyperslab */
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1_data) < 0) TEST_ERROR;
if(H5Sclose(file_space) < 0) TEST_ERROR;
- } /* end for */
+ } /* end for */
/* Read the data */
if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR;
if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
for(i = 0; i < 10; i++) {
- for(j = 0; j < 10; j++) {
-
- /* Select a hyperslab */
- offset[0] = (hsize_t)(i * (NX / 2));
- offset[1] = (hsize_t)(j * (NY / 2));
- if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR;
-
- /* Read */
- if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2) < 0) TEST_ERROR;
-
- /* Compare */
- 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]);
- TEST_ERROR;
- } /* end if */
- } /* end for */
+ for(j = 0; j < 10; j++) {
+
+ /* Select a hyperslab */
+ offset[0] = (hsize_t)(i * N2X);
+ offset[1] = (hsize_t)(j * N2Y);
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR;
+
+ /* Read */
+ if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2_data) < 0) TEST_ERROR;
+
+ /* Compare */
+ for(k = 0; k < N2X; k++)
+ for(m = 0; m < N2Y; m++)
+ if(buf2[k][m] != buf1[(i % 2) * N2X + k][(j % 2) * N2Y + 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) * N2X + k, (j % 2) * N2Y + m, buf1[(i % 2) * N2X + k][(j % 2) * N2Y + m]);
+ TEST_ERROR;
+ } /* end if */
+ } /* end for */
} /* end for */
-
/* Cleanup */
if(H5Dclose(dataset) < 0) TEST_ERROR;
if(H5Sclose(file_space) < 0) TEST_ERROR;
@@ -146,8 +150,8 @@ static int
write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t mem_space)
{
hid_t dataset, file_space, half_space;
- static const hsize_t dims[2] = {NX, NY};
- static const hsize_t half_dims[2] = {NX / 2, NY / 2};
+ static const hsize_t dims[2] = {N1X, N1Y};
+ static const hsize_t half_dims[2] = {N2X, N2Y};
static hsize_t size[2];
hsize_t offset[2];
int i, j, k, m;
@@ -159,48 +163,48 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h
/* Write the data */
for(i = 0; i < 5; i++)
- for(j = 0; j < 5; j++) {
+ for(j = 0; j < 5; j++) {
- /* Extend the dataset */
- offset[0] = (hsize_t)(i * NX);
- offset[1] = (hsize_t)(j * NY);
- size[0] = offset[0] + NX;
- size[1] = offset[1] + NY;
- if(H5Dextend(dataset, size) < 0) TEST_ERROR;
+ /* Extend the dataset */
+ offset[0] = (hsize_t)(i * N1X);
+ offset[1] = (hsize_t)(j * N1Y);
+ size[0] = offset[0] + N1X;
+ size[1] = offset[1] + N1Y;
+ if(H5Dextend(dataset, size) < 0) TEST_ERROR;
- /* Select a hyperslab */
+ /* Select a hyperslab */
if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
- if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR;
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, dims, NULL) < 0) TEST_ERROR;
- /* Write to the hyperslab */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1) < 0) TEST_ERROR;
+ /* Write to the hyperslab */
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf1_data) < 0) TEST_ERROR;
if(H5Sclose(file_space) < 0) TEST_ERROR;
- } /* end for */
+ } /* end for */
/* Read the data */
if((half_space = H5Screate_simple(2, half_dims, NULL)) < 0) TEST_ERROR;
if((file_space = H5Dget_space(dataset)) < 0) TEST_ERROR;
for(i = 0; i < 10; i++) {
- for(j = 0; j < 10; j++) {
-
- /* Select a hyperslab */
- offset[0] = (hsize_t)(i * (NX / 2));
- offset[1] = (hsize_t)(j * (NY / 2));
- if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR;
-
- /* Read */
- if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2) < 0) TEST_ERROR;
-
- /* Compare */
- 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]);
- TEST_ERROR;
- } /* end if */
- } /* end for */
+ for(j = 0; j < 10; j++) {
+
+ /* Select a hyperslab */
+ offset[0] = (hsize_t)(i * N2X);
+ offset[1] = (hsize_t)(j * N2Y);
+ if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL) < 0) TEST_ERROR;
+
+ /* Read */
+ if(H5Dread(dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2_data) < 0) TEST_ERROR;
+
+ /* Compare */
+ for(k = 0; k < N2X; k++)
+ for(m = 0; m < N2Y; m++)
+ if(buf2[k][m] != buf1[(i % 2) * N2X + k][(j % 2) * N2Y + 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) * N2X + k, (j % 2) * N2Y + m, buf1[(i % 2) * N2X + k][(j % 2) * N2Y + m]);
+ TEST_ERROR;
+ } /* end if */
+ } /* end for */
} /* end for */
@@ -219,23 +223,15 @@ error:
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests extendible datasets
+ * Function: main
*
- * Return: Success: exit(0)
+ * Purpose: Tests extendible datasets
*
- * 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
@@ -244,8 +240,8 @@ main (void)
hid_t file, mem_space, cparms;
hid_t fapl;
int nerrors = 0;
- static const hsize_t dims[2] = {NX, NY};
- static const hsize_t chunk_dims[2] = {NX/2, NY/2};
+ static const hsize_t dims[2] = {N1X, N1Y};
+ static const hsize_t chunk_dims[2] = {N2X, N2Y};
static hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
char filename[1024];
int i, j;
@@ -254,9 +250,23 @@ main (void)
fapl = h5_fileaccess();
/* Initialize buffer and space */
- for(i = 0; i < NX; i++)
- for(j = 0; j < NY; j++)
- buf1[i][j] = i * NY + j;
+ if(NULL == (buf1_data = (int *)HDcalloc(N1X * N1Y, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf1 = (int **)HDcalloc(N1X, sizeof(buf1_data))))
+ TEST_ERROR;
+ for (i = 0; i < N1X; i++)
+ buf1[i] = buf1_data + (i * N1Y);
+
+ if(NULL == (buf2_data = (int *)HDcalloc(N2X * N2Y, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf2 = (int **)HDcalloc(N2X, sizeof(buf2_data))))
+ TEST_ERROR;
+ for (i = 0; i < N2X; i++)
+ buf2[i] = buf2_data + (i * N2Y);
+
+ for(i = 0; i < N1X; i++)
+ for(j = 0; j < N1Y; j++)
+ buf1[i][j] = i * N1Y + j;
if((mem_space = H5Screate_simple(2, dims, maxdims)) < 0) TEST_ERROR;
@@ -289,17 +299,28 @@ 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;
+ HDfree(buf1);
+ HDfree(buf1_data);
+ HDfree(buf2);
+ HDfree(buf2_data);
+
+ HDexit(EXIT_SUCCESS);
error:
- printf("*** One or more extend tests failed ***\n");
- return 1;
-}
+
+ HDfree(buf1);
+ HDfree(buf1_data);
+ HDfree(buf2);
+ HDfree(buf2_data);
+
+ HDprintf("*** One or more extend tests failed ***\n");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/external.c b/test/external.c
index 20a9ed8..d29fb6b 100644
--- a/test/external.c
+++ b/test/external.c
@@ -15,27 +15,13 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, March 3, 1998
*
- * Purpose: Tests datasets stored in external raw files.
+ * Purpose: Tests datasets stored in external raw files.
*/
-#include "h5test.h"
-
-const char *FILENAME[] = {
- "extern_1",
- "extern_2",
- "extern_3",
- "extern_4",
- "extern_dir/file_1",
- "extern_5",
- NULL
-};
-
-/* A similar collection of files is used for the tests that
- * perform file I/O.
- */
-#define N_EXT_FILES 4
-#define PART_SIZE 25
-#define TOTAL_SIZE 100
-#define GARBAGE_PER_FILE 10
+#include "external_common.h"
+#include "external_fname.h"
+
+#define AEF_EXNAME_MAX_LEN 12 /* string buffer size for external file name */
+ /* used in __add_external_files() */
/*-------------------------------------------------------------------------
@@ -44,7 +30,7 @@ const char *FILENAME[] = {
* Purpose: Determines whether two files contain the same data.
*
* Return: Success: nonzero if same, zero if different.
- * Failure: zero
+ * Failure: zero
*
* Programmer: Robb Matzke
* Wednesday, March 4, 1998
@@ -54,14 +40,17 @@ const char *FILENAME[] = {
static hbool_t
files_have_same_contents(const char *name1, const char *name2)
{
- int fd1 = 0, fd2 = 0;
- ssize_t n1, n2;
- char buf1[1024], buf2[1024];
+ int fd1 = 0;
+ int fd2 = 0;
+ ssize_t n1 = 0;
+ ssize_t n2 = 0;
+ char buf1[1024];
+ char buf2[1024];
hbool_t ret = FALSE; /* not equal until proven otherwise */
- if((fd1 = HDopen(name1, O_RDONLY)) < 0)
+ if ((fd1 = HDopen(name1, O_RDONLY)) < 0)
goto out;
- if((fd2 = HDopen(name2, O_RDONLY)) < 0)
+ if ((fd2 = HDopen(name2, O_RDONLY)) < 0)
goto out;
/* Loop until files are empty or we encounter a problem */
@@ -99,106 +88,6 @@ out:
/*-------------------------------------------------------------------------
- * Function: reset_raw_data_files
- *
- * Purpose: Resets the data in the raw data files for tests that
- * perform dataset I/O on a set of files.
- *
- * Return: SUCCEED/FAIL
- *
- * Programmer: Dana Robinson
- * February 2016
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-reset_raw_data_files(void)
-{
- int fd = 0; /* external file descriptor */
- size_t i, j; /* iterators */
- hssize_t n; /* bytes of I/O */
- char filename[1024]; /* file name */
- int data[PART_SIZE]; /* raw data buffer */
- uint8_t *garbage = NULL; /* buffer of garbage data */
- size_t garbage_count; /* size of garbage buffer */
- size_t garbage_bytes; /* # of garbage bytes written to file */
-
- /* Set up garbage buffer */
- garbage_count = N_EXT_FILES * GARBAGE_PER_FILE;
- if(NULL == (garbage = (uint8_t *)HDcalloc(garbage_count, sizeof(uint8_t))))
- goto error;
- for(i = 0; i < garbage_count; i++)
- garbage[i] = 0xFF;
-
- /* The *r files are pre-filled with data and are used to
- * verify that read operations work correctly.
- */
- for(i = 0; i < N_EXT_FILES; i++) {
-
- /* Open file */
- HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
- if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- goto error;
-
- /* Write garbage data to the file. This allows us to test the
- * the ability to set an offset in the raw data file.
- */
- garbage_bytes = i * 10;
- n = HDwrite(fd, garbage, garbage_bytes);
- if(n < 0 || (size_t)n != garbage_bytes)
- goto error;
-
- /* Fill array with data */
- for(j = 0; j < PART_SIZE; j++) {
- data[j] = (int)(i * 25 + j);
- } /* end for */
-
- /* Write raw data to the file. */
- n = HDwrite(fd, data, sizeof(data));
- if(n != sizeof(data))
- goto error;
-
- /* Close this file */
- HDclose(fd);
-
- } /* end for */
-
- /* The *w files are only pre-filled with the garbage data and are
- * used to verify that write operations work correctly. The individual
- * tests fill in the actual data.
- */
- for(i = 0; i < N_EXT_FILES; i++) {
-
- /* Open file */
- HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
- if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
- goto error;
-
- /* Write garbage data to the file. This allows us to test the
- * the ability to set an offset in the raw data file.
- */
- garbage_bytes = i * 10;
- n = HDwrite(fd, garbage, garbage_bytes);
- if(n < 0 || (size_t)n != garbage_bytes)
- goto error;
-
- /* Close this file */
- HDclose(fd);
-
- } /* end for */
- HDfree(garbage);
- return SUCCEED;
-
-error:
- if(fd)
- HDclose(fd);
- if(garbage)
- HDfree(garbage);
- return FAIL;
-} /* end reset_raw_data_files() */
-
-
-/*-------------------------------------------------------------------------
* Function: test_non_extendible
*
* Purpose: Tests a non-extendible dataset with a single external file.
@@ -214,23 +103,21 @@ error:
static int
test_non_extendible(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* data space current size */
- hsize_t max_size[1]; /* data space maximum size */
- int n; /* number of external files */
- char name[256]; /* external file name */
- off_t file_offset; /* external file offset */
- hsize_t file_size; /* sizeof external file segment */
- haddr_t dset_addr; /* address of dataset */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ int n = 0; /* number of external files */
+ off_t file_offset = 0; /* external file offset */
+ hsize_t file_size = 0; /* sizeof external file segment */
+ haddr_t dset_addr = HADDR_UNDEF; /* address of dataset */
TESTING("fixed-size data space, exact storage");
- /* Create the dataset */
+ /* Create the dataset and close */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = max_size[0] = 100;
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
@@ -263,29 +150,25 @@ 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;
- } /* end if */
+ }
- HDstrcpy(name + sizeof(name) - 4, "...");
- if(H5Pget_external(dcpl, 0, sizeof(name) - 4, name, &file_offset, &file_size) < 0)
+ /* Verify external file settings */
+ if(H5Pget_external(dcpl, 0, 0, NULL, &file_offset, &file_size) < 0)
FAIL_STACK_ERROR
-
- /* Check file offset */
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;
- } /* end if */
-
- /* Check file size */
+ }
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;
- } /* end if */
+ }
/* Done (dataspace was previously closed) */
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
@@ -312,7 +195,7 @@ test_non_extendible(hid_t file)
* Return: Success: 0
* Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, November 23, 1998
*
*-------------------------------------------------------------------------
@@ -320,18 +203,17 @@ test_non_extendible(hid_t file)
static int
test_too_small(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* current data space size */
- hsize_t max_size[1]; /* maximum data space size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {100}; /* maximum data space size */
TESTING("external storage is too small");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = max_size[0] = 100;
- if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0)
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) /* note -1 */
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
@@ -366,10 +248,10 @@ test_too_small(hid_t file)
* represent the current data and large enough to represent the
* eventual size of the data.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Monday, November 23, 1998
*
*-------------------------------------------------------------------------
@@ -377,18 +259,16 @@ test_too_small(hid_t file)
static int
test_large_enough_current_eventual(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* current data space size */
- hsize_t max_size[1]; /* maximum data space size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {200}; /* maximum data space size */
TESTING("extendible dataspace, exact external size");
if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = 100;
- max_size[0] = 200;
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int))) < 0)
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
@@ -430,19 +310,17 @@ error:
static int
test_large_enough_current_not_eventual(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* current data space size */
- hsize_t max_size[1]; /* maximum data space size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* current data space size */
+ hsize_t max_size[1] = {200}; /* maximum data space size */
TESTING("extendible dataspace, external storage is too small");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = 100;
- max_size[0] = 200;
- if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0)
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0, (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) /* note -1 */
FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
@@ -486,15 +364,14 @@ test_large_enough_current_not_eventual(hid_t file)
static int
test_unlimited(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* data space */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* data space current size */
- hsize_t max_size[1]; /* data space maximum size */
- int n; /* number of external files */
- char name[256]; /* external file name */
- off_t file_offset; /* external file offset */
- hsize_t file_size; /* sizeof external file segment */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* data space */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {H5S_UNLIMITED}; /* data space maximum size */
+ int n; /* number of external files */
+ off_t file_offset; /* external file offset */
+ hsize_t file_size; /* sizeof external file segment */
TESTING("unlimited dataspace, unlimited external storage");
@@ -503,8 +380,6 @@ test_unlimited(hid_t file)
FAIL_STACK_ERROR
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED) < 0)
FAIL_STACK_ERROR
- cur_size[0] = 100;
- max_size[0] = H5S_UNLIMITED;
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
if((dset = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -524,26 +399,24 @@ 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 */
- HDstrcpy(name + sizeof(name) - 4, "...");
- if(H5Pget_external(dcpl, 0, sizeof(name) - 4, name, &file_offset, &file_size) < 0)
+ if(H5Pget_external(dcpl, 0, 0, NULL, &file_offset, &file_size) < 0)
FAIL_STACK_ERROR
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;
- } /* end if */
-
+ }
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;
- } /* end if */
+ }
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
@@ -562,6 +435,56 @@ test_unlimited(hid_t file)
/*-------------------------------------------------------------------------
+ * Function: __add_external_files
+ *
+ * Purpose: Add external file names to the DCPL with the given properties.
+ * Used in test_multiple_files().
+ * Limit to no more than 999 external files.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 29 Sep 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+__add_external_files(
+ hid_t dcpl_id,
+ unsigned int n_external_files,
+ off_t offset,
+ hsize_t max_ext_size)
+{
+ char exname[AEF_EXNAME_MAX_LEN+1];
+ unsigned int i = 0;
+
+ if (dcpl_id < 0) {
+ return -1;
+ }
+ for (i = 0; i < n_external_files; i++) {
+ if (HDsnprintf(
+ exname,
+ AEF_EXNAME_MAX_LEN,
+ "ext%d.data",
+ i+1)
+ > AEF_EXNAME_MAX_LEN)
+ {
+ HDfprintf(stderr, "External file %d overflows name buffer\n", i+1);
+ fflush(stderr);
+ return -1;
+ }
+ if (H5Pset_external(dcpl_id, exname, offset, max_ext_size) < 0) {
+ HDfprintf(stderr, "Problem adding external file %s\n", exname);
+ fflush(stderr);
+ return -1;
+ }
+ }
+ return 0;
+} /* end __add_external_files() */
+
+
+/*-------------------------------------------------------------------------
* Function: test_multiple_files
*
* Purpose: Test multiple external files for a dataset.
@@ -577,35 +500,55 @@ test_unlimited(hid_t file)
static int
test_multiple_files(hid_t file)
{
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t space = -1; /* dataspace */
- hid_t dset = -1; /* dataset */
- hsize_t cur_size[1]; /* data space current size */
- hsize_t max_size[1]; /* data space maximum size */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t space = -1; /* dataspace */
+ hid_t dset = -1; /* dataset */
+ hsize_t cur_size[1] = {100}; /* data space current size */
+ hsize_t max_size[1] = {100}; /* data space maximum size */
+ hsize_t max_ext_size; /* maximum size of external files */
+ unsigned int n_external_files = 4;
TESTING("multiple external files");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
- cur_size[0] = max_size[0] = 100;
+ max_ext_size = (hsize_t)(sizeof(int) * max_size[0] / n_external_files);
+
+ if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
+ FAIL_STACK_ERROR;
+ }
- 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, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0)
- FAIL_STACK_ERROR
- 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, (hsize_t)(max_size[0]*sizeof(int)/4)) < 0)
- FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_size, max_size)) < 0)
FAIL_STACK_ERROR
+
if((dset = H5Dcreate2(file, "dset6", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space) < 0) FAIL_STACK_ERROR
if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ /* Re-use space below */
+
+ /* ----------------------------------------------
+ * Verify that too-small external files will fail
+ */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ max_ext_size -= 1;
+
+ if (__add_external_files(dcpl, n_external_files, 0, max_ext_size) < 0) {
+ FAIL_STACK_ERROR;
+ }
+
+ H5E_BEGIN_TRY {
+ dset = H5Dcreate2(file, "dset7", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(dset >= 0)
+ FAIL_PUTS_ERROR(" Small external files succeeded instead of failing.");
+
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(space) < 0) FAIL_STACK_ERROR
PASSED();
return 0;
@@ -637,9 +580,9 @@ error:
static int
test_add_to_unlimited(void)
{
- hid_t dcpl = -1; /* dataset creation properties */
- herr_t status; /* function return status */
- int n; /* number of external files */
+ hid_t dcpl = -1; /* dataset creation properties */
+ herr_t status = FAIL; /* function return status */
+ int n = 0; /* number of external files */
TESTING("external file following unlimited file");
@@ -688,12 +631,12 @@ test_add_to_unlimited(void)
static int
test_overflow(void)
{
- hid_t dcpl = -1; /* dataset creation properties */
- herr_t status; /* return status */
+ hid_t dcpl = -1; /* dataset creation properties */
+ herr_t status = FAIL; /* return status */
TESTING("address overflow in external files");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
if(H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED-1) < 0)
FAIL_STACK_ERROR
@@ -733,19 +676,19 @@ test_overflow(void)
static int
test_read_file_set(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 dset = -1; /* dataset */
- hid_t grp = -1; /* group to emit diagnostics */
- size_t i; /* miscellaneous counter */
- char filename[1024]; /* file names */
- 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 dset = -1; /* dataset */
+ hid_t grp = -1; /* group to emit diagnostics */
+ size_t i = 0; /* miscellaneous counter */
+ char filename[1024]; /* file names */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- hid_t hs_space = -1; /* hyperslab data space */
- hsize_t hs_start = 30; /* hyperslab starting offset */
- hsize_t hs_count = 25; /* hyperslab size */
+ hsize_t cur_size; /* current data space size */
+ hid_t hs_space = -1; /* hyperslab data space */
+ hsize_t hs_start = 30; /* hyperslab starting offset */
+ hsize_t hs_count = 25; /* hyperslab size */
TESTING("read external dataset");
@@ -753,14 +696,14 @@ test_read_file_set(hid_t fapl)
TEST_ERROR
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the file and an initial group. This causes messages about
* debugging to be emitted before we start playing games with what the
* output looks like.
*/
- h5_fixname(FILENAME[1], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[1], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
if((grp = H5Gcreate2(file, "emit-diagnostics", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -774,7 +717,7 @@ test_read_file_set(hid_t fapl)
HDsnprintf(filename, sizeof(filename), "extern_%dr.raw", (int) i + 1);
if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
FAIL_STACK_ERROR
- } /* end for */
+ }
/* Create the dataspace */
cur_size = TOTAL_SIZE;
@@ -851,19 +794,19 @@ test_read_file_set(hid_t fapl)
static int
test_write_file_set(hid_t fapl)
{
- hid_t file = -1; /* file to which to write */
- hid_t dcpl = -1; /* dataset creation properties */
- hid_t mem_space = -1; /* memory data space */
- hid_t file_space = -1; /* file data space */
- hid_t dset = -1; /* dataset */
- unsigned i; /* miscellaneous counter */
- int part[PART_SIZE]; /* raw data buffer (partial) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size = 100; /* current data space size */
- hsize_t max_size = 200; /* maximum data space size */
- hsize_t hs_start = 100; /* hyperslab starting offset */
- hsize_t hs_count = 100; /* hyperslab size */
- char filename[1024]; /* file name */
+ hid_t file = -1; /* file to which to write */
+ hid_t dcpl = -1; /* dataset creation properties */
+ hid_t mem_space = -1; /* memory data space */
+ hid_t file_space = -1; /* file data space */
+ hid_t dset = -1; /* dataset */
+ unsigned i = 0; /* miscellaneous counter */
+ int part[PART_SIZE]; /* raw data buffer (partial) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size = 100; /* current data space size */
+ hsize_t max_size = 200; /* maximum data space size */
+ hsize_t hs_start = 100; /* hyperslab starting offset */
+ hsize_t hs_count = 100; /* hyperslab size */
+ char filename[1024]; /* file name */
TESTING("write external dataset");
@@ -871,7 +814,7 @@ test_write_file_set(hid_t fapl)
TEST_ERROR
/* Create another file */
- h5_fixname(FILENAME[2], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[2], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
@@ -893,7 +836,7 @@ test_write_file_set(hid_t fapl)
} /* end for */
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dataset */
@@ -976,25 +919,25 @@ test_write_file_set(hid_t fapl)
static int
test_path_absolute(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 dset = -1; /* dataset */
- size_t i; /* miscellaneous counter */
- 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 dset = -1; /* dataset */
+ size_t i = 0; /* miscellaneous counter */
+ 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 */
+ hsize_t cur_size; /* current data space size */
TESTING("absolute filenames for external file");
- h5_fixname(FILENAME[3], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[3], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dcpl */
@@ -1066,16 +1009,16 @@ error:
static int
test_path_relative(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 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 dset = -1; /* dataset */
+ size_t i = 0; /* 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 */
+ hsize_t cur_size; /* current data space size */
TESTING("filenames relative to current directory for external file");
@@ -1085,12 +1028,12 @@ test_path_relative(hid_t fapl)
if (HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR;
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[4], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dataset */
@@ -1156,21 +1099,21 @@ error:
static int
test_path_relative_cwd(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 dapl2 = -1; /* copy of dapl */
- hid_t dset = -1; /* dataset */
- hid_t dset2 = -1; /* dataset, opened a second time */
- hid_t dset3 = -1; /* dataset, opened with different prefix */
- 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 dapl2 = -1; /* copy of dapl */
+ hid_t dset = -1; /* dataset */
+ hid_t dset2 = -1; /* dataset, opened a second time */
+ hid_t dset3 = -1; /* dataset, opened with different prefix */
+ size_t i = 0; /* 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("filenames relative to HDF5 file for external file");
@@ -1180,12 +1123,12 @@ test_path_relative_cwd(hid_t fapl)
if(HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
TEST_ERROR;
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[4], fapl, filename, sizeof(filename));
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR;
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the dataset */
@@ -1297,116 +1240,6 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_path_env
- *
- * Purpose: Test whether the value of HDF5_EXTFILE_PREFIX will overwrite
- * the efile_prefix dataset access property.
- * This will create an HDF5 file in a subdirectory which will
- * refer to ../extern_*a.raw
- * The files are then accessed by setting the HDF5_EXTFILE_PREFIX
- * environment variable to "${ORIGIN}".
- * The efile_prefix dataset access property is set to "someprefix",
- * which will cause an error if the value is not overwritten by
- * the environment variable.
- *
- * Return: Success: 0
- * Failure: 1
- *
- * Programmer: Steffen Kiess
- * March 10, 2015
- *
- *-------------------------------------------------------------------------
- */
-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) */
- int whole[TOTAL_SIZE]; /* raw data buffer (total) */
- hsize_t cur_size; /* current data space size */
- char buffer[1024]; /* buffer to read efile_prefix */
-
- TESTING("prefix in HDF5_EXTFILE_PREFIX");
-
- if(HDsetenv("HDF5_EXTFILE_PREFIX", "${ORIGIN}", 1))
- TEST_ERROR
-
- if(HDmkdir("extern_dir", (mode_t)0755) < 0 && errno != EEXIST)
- TEST_ERROR;
-
- h5_fixname(FILENAME[4], fapl, filename, sizeof(filename));
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
-
- /* Reset the raw data files */
- if(reset_raw_data_files() < 0)
- TEST_ERROR
-
- /* Create the dataset */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR
- if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
- TEST_ERROR
- for(i = 0; i < N_EXT_FILES; i++) {
- HDsnprintf(filename, sizeof(filename), "..%sextern_%dr.raw", H5_DIR_SEPS, (int) i + 1);
- if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
- FAIL_STACK_ERROR
- } /* end for */
-
- cur_size = TOTAL_SIZE;
- if((space = H5Screate_simple(1, &cur_size, NULL)) < 0)
- FAIL_STACK_ERROR
- if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
- FAIL_STACK_ERROR
-
- /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
- if(H5Pset_efile_prefix(dapl, "someprefix") < 0)
- FAIL_STACK_ERROR
- if(H5Pget_efile_prefix(dapl, buffer, sizeof(buffer)) < 0)
- FAIL_STACK_ERROR
- if(HDstrcmp(buffer, "someprefix") != 0)
- FAIL_PUTS_ERROR("efile prefix not set correctly");
-
- /* Create dataset */
- if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, dapl)) < 0)
- FAIL_STACK_ERROR
-
- /* Read the entire dataset and compare with the original */
- HDmemset(whole, 0, sizeof(whole));
- if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0)
- FAIL_STACK_ERROR
- for(i = 0; i < TOTAL_SIZE; i++)
- if(whole[i] != (signed)i)
- FAIL_PUTS_ERROR("Incorrect value(s) read.");
-
- if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dapl) < 0) FAIL_STACK_ERROR
- if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file) < 0) FAIL_STACK_ERROR
- PASSED();
- return 0;
-
-error:
- H5E_BEGIN_TRY {
- H5Pclose(dapl);
- H5Dclose(dset);
- H5Pclose(dcpl);
- H5Sclose(space);
- H5Fclose(file);
- } H5E_END_TRY;
- return 1;
-} /* end test_path_env() */
-
-
-/*-------------------------------------------------------------------------
* Function: test_h5d_get_access_plist
*
* Purpose: Ensure that H5Dget_access_plist returns correct values.
@@ -1422,14 +1255,14 @@ error:
static int
test_h5d_get_access_plist(hid_t fapl_id)
{
- hid_t fid = -1; /* file to write to */
- hid_t dcpl_id = -1; /* dataset creation properties */
- hid_t dapl_id = -1; /* dataset access properties */
- hid_t sid = -1; /* data space */
- hid_t did = -1; /* dataset */
- hsize_t dims = 0; /* dataset size */
- char *buffer = NULL; /* saved prefix name from dapl */
- char filename[1024]; /* file names */
+ hid_t fid = -1; /* file to write to */
+ hid_t dcpl_id = -1; /* dataset creation properties */
+ hid_t dapl_id = -1; /* dataset access properties */
+ hid_t sid = -1; /* data space */
+ hid_t did = -1; /* dataset */
+ hsize_t dims = 0; /* dataset size */
+ char *buffer = NULL; /* saved prefix name from dapl */
+ char filename[1024]; /* file names */
TESTING("H5Dget_access_plist() returns correct prefix");
@@ -1437,11 +1270,11 @@ test_h5d_get_access_plist(hid_t fapl_id)
TEST_ERROR
/* Reset the raw data files */
- if(reset_raw_data_files() < 0)
+ if(reset_raw_data_files(FALSE) < 0)
TEST_ERROR
/* Create the file */
- h5_fixname(FILENAME[5], fapl_id, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[5], fapl_id, filename, sizeof(filename));
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
FAIL_STACK_ERROR
@@ -1512,7 +1345,7 @@ test_h5d_get_access_plist(hid_t fapl_id)
*
* Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 3, 1998
*
*-------------------------------------------------------------------------
@@ -1520,19 +1353,19 @@ test_h5d_get_access_plist(hid_t fapl_id)
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 */
- char filename[1024]; /* file name for test_1* funcs */
- unsigned latest_format; /* default or latest file format */
- int nerrors = 0; /* number of errors */
+ 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 */
+ char filename[1024]; /* file name for test_1* funcs */
+ unsigned latest_format; /* default or latest file format */
+ int nerrors = 0; /* number of errors */
h5_reset();
/* Get a fapl for the old (default) file format */
fapl_id_old = h5_fileaccess();
- h5_fixname(FILENAME[0], fapl_id_old, filename, sizeof(filename));
+ h5_fixname(EXT_FNAME[0], fapl_id_old, filename, sizeof(filename));
/* Copy and set up a fapl for the latest file format */
if((fapl_id_new = H5Pcopy(fapl_id_old)) < 0)
@@ -1552,11 +1385,11 @@ main(void)
if(latest_format) {
HDputs("\nTesting with the latest file format:");
current_fapl_id = fapl_id_new;
- } /* end if */
+ }
else {
HDputs("Testing with the default file format:");
current_fapl_id = fapl_id_old;
- } /* end else */
+ }
/* Create the common file used by some of the tests */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, current_fapl_id)) < 0)
@@ -1585,15 +1418,14 @@ main(void)
nerrors += test_path_absolute(current_fapl_id);
nerrors += test_path_relative(current_fapl_id);
nerrors += test_path_relative_cwd(current_fapl_id);
- nerrors += test_path_env(current_fapl_id);
-
+
/* Verify symbol table messages are cached */
- nerrors += (h5_verify_cached_stabs(FILENAME, current_fapl_id) < 0 ? 1 : 0);
+ nerrors += (h5_verify_cached_stabs(EXT_FNAME, current_fapl_id) < 0 ? 1 : 0);
/* Close the common file */
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
- } /* end for */
+ } /* end for old and new format */
if(nerrors > 0) goto error;
@@ -1603,7 +1435,7 @@ main(void)
HDputs("All external storage tests passed.");
/* Clean up files used by file set tests */
- if(h5_cleanup(FILENAME, fapl_id_old)) {
+ if(h5_cleanup(EXT_FNAME, fapl_id_old)) {
HDremove("extern_1r.raw");
HDremove("extern_2r.raw");
HDremove("extern_3r.raw");
@@ -1615,7 +1447,7 @@ main(void)
HDremove("extern_4w.raw");
HDrmdir("extern_dir");
- } /* end if */
+ }
return EXIT_SUCCESS;
@@ -1627,7 +1459,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
new file mode 100644
index 0000000..a9e600b
--- /dev/null
+++ b/test/external_common.c
@@ -0,0 +1,127 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Raymond Lu <songyulu@hdfgroup.org>
+ * April, 2019
+ *
+ * Purpose: Private function for external.c and external_env.c
+ */
+
+#include "external_common.h"
+
+
+/*-------------------------------------------------------------------------
+ * Function: reset_raw_data_files
+ *
+ * Purpose: Resets the data in the raw data files for tests that
+ * perform dataset I/O on a set of files.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Dana Robinson
+ * February 2016
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+reset_raw_data_files(hbool_t is_env)
+{
+ int fd = 0; /* external file descriptor */
+ size_t i, j; /* iterators */
+ hssize_t n; /* bytes of I/O */
+ char filename[1024]; /* file name */
+ int data[PART_SIZE]; /* raw data buffer */
+ uint8_t *garbage = NULL; /* buffer of garbage data */
+ size_t garbage_count; /* size of garbage buffer */
+ size_t garbage_bytes; /* # of garbage bytes written to file */
+
+ /* Set up garbage buffer */
+ garbage_count = N_EXT_FILES * GARBAGE_PER_FILE;
+ if(NULL == (garbage = (uint8_t *)HDcalloc(garbage_count, sizeof(uint8_t))))
+ goto error;
+ for(i = 0; i < garbage_count; i++)
+ garbage[i] = 0xFF;
+
+ /* The *r files are pre-filled with data and are used to
+ * verify that read operations work correctly.
+ */
+ for(i = 0; i < N_EXT_FILES; i++) {
+
+ /* Open file */
+ if(is_env)
+ HDsprintf(filename, "extern_env_%lur.raw", (unsigned long)i + 1);
+ else
+ HDsprintf(filename, "extern_%lur.raw", (unsigned long)i + 1);
+ if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
+ goto error;
+
+ /* Write garbage data to the file. This allows us to test the
+ * the ability to set an offset in the raw data file.
+ */
+ garbage_bytes = i * 10;
+ n = HDwrite(fd, garbage, garbage_bytes);
+ if(n < 0 || (size_t)n != garbage_bytes)
+ goto error;
+
+ /* Fill array with data */
+ for(j = 0; j < PART_SIZE; j++) {
+ data[j] = (int)(i * 25 + j);
+ } /* end for */
+
+ /* Write raw data to the file. */
+ n = HDwrite(fd, data, sizeof(data));
+ if(n != sizeof(data))
+ goto error;
+
+ /* Close this file */
+ HDclose(fd);
+
+ } /* end for */
+
+ /* The *w files are only pre-filled with the garbage data and are
+ * used to verify that write operations work correctly. The individual
+ * tests fill in the actual data.
+ */
+ for(i = 0; i < N_EXT_FILES; i++) {
+
+ /* Open file */
+ if(is_env)
+ HDsprintf(filename, "extern_env_%luw.raw", (unsigned long)i + 1);
+ else
+ HDsprintf(filename, "extern_%luw.raw", (unsigned long)i + 1);
+ if((fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0)
+ goto error;
+
+ /* Write garbage data to the file. This allows us to test the
+ * the ability to set an offset in the raw data file.
+ */
+ garbage_bytes = i * 10;
+ n = HDwrite(fd, garbage, garbage_bytes);
+ if(n < 0 || (size_t)n != garbage_bytes)
+ goto error;
+
+ /* Close this file */
+ HDclose(fd);
+
+ } /* end for */
+ HDfree(garbage);
+ return SUCCEED;
+
+error:
+ if(fd)
+ HDclose(fd);
+ if(garbage)
+ HDfree(garbage);
+ return FAIL;
+}
diff --git a/test/external_common.h b/test/external_common.h
new file mode 100644
index 0000000..f02652b
--- /dev/null
+++ b/test/external_common.h
@@ -0,0 +1,45 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Raymond Lu <songyulu@hdfgroup.org>
+ * April, 2019
+ *
+ * Purpose: Private function for external.c and external_env.c
+ */
+#ifndef _EXTERNAL_COMMON_H
+#define _EXTERNAL_COMMON_H
+
+/* Include test header files */
+#include "h5test.h"
+
+/* A similar collection of files is used for the tests that
+ * perform file I/O.
+ */
+#define N_EXT_FILES 4
+#define PART_SIZE 25
+#define TOTAL_SIZE 100
+#define GARBAGE_PER_FILE 10
+
+
+#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
new file mode 100644
index 0000000..e9c7635
--- /dev/null
+++ b/test/external_env.c
@@ -0,0 +1,218 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 datasets stored in external raw files.
+ */
+#include "external_common.h"
+
+static const char *EXT_ENV_FNAME[] = {
+ "extern_env_dir/env_file_1",
+ NULL
+};
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_path_env
+ *
+ * Purpose: Test whether the value of HDF5_EXTFILE_PREFIX will overwrite
+ * the efile_prefix dataset access property.
+ * This will create an HDF5 file in a subdirectory which will
+ * refer to ../extern_*a.raw
+ * The files are then accessed by setting the HDF5_EXTFILE_PREFIX
+ * environment variable to "${ORIGIN}".
+ * The efile_prefix dataset access property is set to "someprefix",
+ * which will cause an error if the value is not overwritten by
+ * the environment variable.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Steffen Kiess
+ * March 10, 2015
+ *
+ *-------------------------------------------------------------------------
+ */
+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) */
+ int whole[TOTAL_SIZE]; /* raw data buffer (total) */
+ hsize_t cur_size; /* current data space size */
+ char buffer[1024]; /* buffer to read efile_prefix */
+
+ TESTING("prefix in HDF5_EXTFILE_PREFIX");
+
+ if(HDmkdir("extern_env_dir", (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR;
+
+ h5_fixname(EXT_ENV_FNAME[0], fapl, filename, sizeof(filename));
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Reset the raw data files */
+ if(reset_raw_data_files(TRUE) < 0)
+ TEST_ERROR
+
+ /* Create the dataset */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+ if(NULL == HDgetcwd(cwdpath, sizeof(cwdpath)))
+ TEST_ERROR
+ for(i = 0; i < N_EXT_FILES; i++) {
+ HDsnprintf(filename, sizeof(filename), "..%sextern_env_%dr.raw", H5_DIR_SEPS, (int) i + 1);
+ if(H5Pset_external(dcpl, filename, (off_t)(i * GARBAGE_PER_FILE), (hsize_t)sizeof(part)) < 0)
+ FAIL_STACK_ERROR
+ } /* end for */
+
+ cur_size = TOTAL_SIZE;
+ if((space = H5Screate_simple(1, &cur_size, NULL)) < 0)
+ FAIL_STACK_ERROR
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
+ if(H5Pset_efile_prefix(dapl, "someprefix") < 0)
+ FAIL_STACK_ERROR
+ if(H5Pget_efile_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ FAIL_STACK_ERROR
+ if(HDstrcmp(buffer, "someprefix") != 0)
+ FAIL_PUTS_ERROR("efile prefix not set correctly");
+
+ /* Create dataset */
+ if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, dapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Read the entire dataset and compare with the original */
+ HDmemset(whole, 0, sizeof(whole));
+ if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0)
+ FAIL_STACK_ERROR
+ for(i = 0; i < TOTAL_SIZE; i++)
+ if(whole[i] != (signed)i)
+ FAIL_PUTS_ERROR("Incorrect value(s) read.");
+
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dapl) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(dcpl) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(space) < 0) FAIL_STACK_ERROR
+ if(H5Fclose(file) < 0) FAIL_STACK_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(dapl);
+ H5Dclose(dset);
+ H5Pclose(dcpl);
+ H5Sclose(space);
+ H5Fclose(file);
+ } H5E_END_TRY;
+ return 1;
+} /* end test_path_env() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Runs external dataset tests.
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ * Programmer: Robb Matzke
+ * Tuesday, March 3, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+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 */
+ unsigned latest_format; /* default or latest file format */
+ int nerrors = 0; /* number of errors */
+
+ h5_reset();
+
+ /* Get a fapl for the old (default) file format */
+ fapl_id_old = h5_fileaccess();
+
+ /* Copy and set up a fapl for the latest file format */
+ if((fapl_id_new = H5Pcopy(fapl_id_old)) < 0)
+ FAIL_STACK_ERROR
+ if(H5Pset_libver_bounds(fapl_id_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ FAIL_STACK_ERROR
+
+ /* Test with old & new format groups */
+ for(latest_format = FALSE; latest_format <= TRUE; latest_format++) {
+ hid_t current_fapl_id = -1;
+
+ /* Set the fapl for different file formats */
+ if(latest_format) {
+ HDputs("\nTesting with the latest file format:");
+ current_fapl_id = fapl_id_new;
+ } /* end if */
+ else {
+ HDputs("Testing with the default file format:");
+ current_fapl_id = fapl_id_old;
+ } /* end else */
+
+ nerrors += test_path_env(current_fapl_id);
+ } /* end for */
+
+ if(nerrors > 0) goto error;
+
+ /* Close the new ff fapl. h5_cleanup will take care of the old ff fapl */
+ if(H5Pclose(fapl_id_new) < 0) FAIL_STACK_ERROR
+
+ HDputs("All external storage tests passed.");
+
+ /* Clean up files used by file set tests */
+ if(h5_cleanup(EXT_ENV_FNAME, fapl_id_old)) {
+ HDremove("extern_env_1r.raw");
+ HDremove("extern_env_2r.raw");
+ HDremove("extern_env_3r.raw");
+ HDremove("extern_env_4r.raw");
+
+ HDremove("extern_env_1w.raw");
+ HDremove("extern_env_2w.raw");
+ HDremove("extern_env_3w.raw");
+ HDremove("extern_env_4w.raw");
+
+ HDrmdir("extern_env_dir");
+ } /* end if */
+
+ return EXIT_SUCCESS;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Pclose(fapl_id_old);
+ H5Pclose(fapl_id_new);
+ H5Gclose(gid);
+ } H5E_END_TRY;
+ nerrors = MAX(1, nerrors);
+ HDprintf("%d TEST%s FAILED.\n", nerrors, 1 == nerrors ? "" : "s");
+ return EXIT_FAILURE;
+} /* end main() */
+
diff --git a/test/external_fname.h b/test/external_fname.h
new file mode 100644
index 0000000..c5111b6
--- /dev/null
+++ b/test/external_fname.h
@@ -0,0 +1,37 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Quincey Koziol <koziol@lbl.gov>
+ * July, 2019
+ *
+ * Purpose: Private declaration for external.c and external_env.c
+ */
+#ifndef _EXTERNAL_FNAME_H
+#define _EXTERNAL_FNAME_H
+
+/* Include test header files */
+#include "h5test.h"
+
+static const char *EXT_FNAME[] = {
+ "extern_1",
+ "extern_2",
+ "extern_3",
+ "extern_4",
+ "extern_dir/file_1",
+ "extern_5",
+ NULL
+};
+
+#endif /* _EXTERNAL_FNAME_H */
+
diff --git a/test/farray.c b/test/farray.c
index f9f97bf..b647b51 100644
--- a/test/farray.c
+++ b/test/farray.c
@@ -25,8 +25,10 @@
#include "H5FApkg.h" /* Fixed Arrays */
/* Other private headers that this test requires */
-#include "H5Iprivate.h" /* IDs */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h" /* IDs */
+#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5VLprivate.h" /* Virtual Object Layer */
/* Local macros */
@@ -112,121 +114,116 @@ 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: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
init_cparam(H5FA_create_t *cparam, farray_test_param_t *tparam)
{
/* Wipe out background */
HDmemset(cparam, 0, sizeof(*cparam));
- cparam->cls = H5FA_CLS_TEST;
- cparam->raw_elmt_size = ELMT_SIZE;
- cparam->max_dblk_page_nelmts_bits = MAX_DBLOCK_PAGE_NELMTS_BITS;
- cparam->nelmts = tparam->nelmts;
+ cparam->cls = H5FA_CLS_TEST;
+ cparam->raw_elmt_size = ELMT_SIZE;
+ cparam->max_dblk_page_nelmts_bits = MAX_DBLOCK_PAGE_NELMTS_BITS;
+ cparam->nelmts = tparam->nelmts;
- return(0);
+ return SUCCEED;
} /* init_cparam() */
/*-------------------------------------------------------------------------
- * 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: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
-create_file(hid_t fapl, hid_t *file, H5F_t **f)
+static herr_t
+create_file(hid_t fapl_id, hid_t *fid, H5F_t **f)
{
/* Create the file to work on */
- if((*file = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- FAIL_STACK_ERROR
+ if ((*fid = H5Fcreate(filename_g, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
- FAIL_STACK_ERROR
+ if (NULL == (*f = (H5F_t *)H5VL_object(*fid)))
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
- if(H5AC_ignore_tags(*f) < 0)
- FAIL_STACK_ERROR
+ if (H5AC_ignore_tags(*f) < 0)
+ FAIL_STACK_ERROR;
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* create_file() */
/*-------------------------------------------------------------------------
- * Function: check_stats
+ * Function: check_stats
*
- * Purpose: Verify stats for a fixed array
+ * Purpose: Verify stats for a fixed array
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
check_stats(const H5FA_t *fa, const farray_state_t *state)
{
H5FA_stat_t farray_stats; /* Statistics about the array */
/* Get statistics for fixed array and verify they are correct */
- if(H5FA_get_stats(fa, &farray_stats) < 0)
+ if (H5FA_get_stats(fa, &farray_stats) < 0)
FAIL_STACK_ERROR
/* Compare information */
- if(farray_stats.hdr_size != state->hdr_size) {
+ if (farray_stats.hdr_size != state->hdr_size) {
HDfprintf(stdout, "farray_stats.hdr_size = %Hu, state->hdr_size = %Hu\n",
farray_stats.hdr_size, state->hdr_size);
TEST_ERROR
- } /* end if */
+ }
- if(farray_stats.dblk_size != state->dblk_size) {
+ if (farray_stats.dblk_size != state->dblk_size) {
HDfprintf(stdout, "farray_stats.dblk_size = %Hu, state->dblk_size = %Hu\n",
farray_stats.dblk_size, state->dblk_size);
TEST_ERROR
- } /* end if */
+ }
- if(farray_stats.nelmts != state->nelmts) {
+ if (farray_stats.nelmts != state->nelmts) {
HDfprintf(stdout, "farray_stats.nelmts = %Hu, state->nelmts = %Hu\n",
farray_stats.nelmts, state->nelmts);
TEST_ERROR
- } /* end if */
+ }
- /* All tests passed */
- return(0);
+ /* Success */
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* check_stats() */
/*-------------------------------------------------------------------------
- * Function: set_fa_state
- *
- * Purpose: Set the state of the Fixed Array
+ * Function: set_fa_state
*
- * Return: does not fail
+ * Purpose: Set the state of the Fixed Array
*
- * Programmer: Vailin Choi; 5th August, 2009
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
{
size_t dblk_page_nelmts; /* # of elements per page */
@@ -240,190 +237,190 @@ set_fa_state(const H5FA_create_t *cparam, farray_state_t *state)
state->nelmts = cparam->nelmts;
dblk_page_nelmts = (size_t)1 << cparam->max_dblk_page_nelmts_bits;
- if(state->nelmts > dblk_page_nelmts) {
- size_t npages = (size_t)(((state->nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts);
- size_t dblk_page_init_size = (npages + 7) / 8;
- hsize_t checksum_size = npages * 4;
+ if (state->nelmts > dblk_page_nelmts) {
+ size_t npages = (size_t)(((state->nelmts + dblk_page_nelmts) - 1) / dblk_page_nelmts);
+ size_t dblk_page_init_size = (npages + 7) / 8;
+ hsize_t checksum_size = npages * 4;
- state->dblk_size = DBLOCK_PREFIX + dblk_page_init_size + checksum_size +
+ state->dblk_size = DBLOCK_PREFIX + dblk_page_init_size + checksum_size +
state->nelmts * cparam->raw_elmt_size;
- } else
- state->dblk_size = DBLOCK_PREFIX + state->nelmts * cparam->raw_elmt_size;
+ }
+ else
+ state->dblk_size = DBLOCK_PREFIX + state->nelmts * cparam->raw_elmt_size;
- return(0);
+ return SUCCEED;
} /* end set_fa_state() */
/*-------------------------------------------------------------------------
- * 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: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
static int
-reopen_file(hid_t *file, H5F_t **f, hid_t fapl, hid_t dxpl,
+reopen_file(hid_t *fid, H5F_t **f, hid_t fapl_id,
H5FA_t **fa, haddr_t fa_addr, const farray_test_param_t *tparam)
{
/* Check for closing & re-opening the array */
/* (actually will close & re-open the file as well) */
- if(tparam->reopen_array) {
+ if (tparam->reopen_array) {
+
/* Close array, if given */
- if(fa && *fa) {
- if(H5FA_close(*fa, dxpl) < 0)
+ if (fa && *fa) {
+ if (H5FA_close(*fa) < 0)
FAIL_STACK_ERROR
*fa = NULL;
- } /* end if */
+ }
/* Close file */
- if(*file) {
- if(H5Fclose(*file) < 0)
+ if (*fid) {
+ if (H5Fclose(*fid) < 0)
FAIL_STACK_ERROR
- *file = (-1);
+ *fid = H5I_INVALID_HID;
*f = NULL;
- } /* end if */
+ }
/* Re-open the file */
- if((*file = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((*fid = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
- FAIL_STACK_ERROR
+ if (NULL == (*f = (H5F_t *)H5VL_object(*fid)))
+ FAIL_STACK_ERROR;
/* Ignore metadata tags in the file's cache */
- if(H5AC_ignore_tags(*f) < 0)
+ if (H5AC_ignore_tags(*f) < 0)
FAIL_STACK_ERROR
/* Re-open array, if given */
- if(fa)
- if(NULL == (*fa = H5FA_open(*f, dxpl, fa_addr, NULL)))
+ if (fa)
+ if (NULL == (*fa = H5FA_open(*f, fa_addr, NULL)))
FAIL_STACK_ERROR
- } /* end if */
+ }
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* reopen_file() */
/*-------------------------------------------------------------------------
- * Function: create_array
+ * Function: create_array
*
- * Purpose: Create a fixed array and perform initial checks
+ * Purpose: Create a fixed array and perform initial checks
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
-create_array(H5F_t *f, hid_t dxpl, const H5FA_create_t *cparam,
+static herr_t
+create_array(H5F_t *f, const H5FA_create_t *cparam,
H5FA_t **fa, haddr_t *fa_addr)
{
farray_state_t state; /* State of extensible array */
/* Create array */
- if(NULL == (*fa = H5FA_create(f, dxpl, cparam, NULL)))
+ if (NULL == (*fa = H5FA_create(f, cparam, NULL)))
FAIL_STACK_ERROR
/* Check status of array */
- if(H5FA_get_addr(*fa, fa_addr) < 0)
+ if (H5FA_get_addr(*fa, fa_addr) < 0)
FAIL_STACK_ERROR
- if(!H5F_addr_defined(*fa_addr))
+ if (!H5F_addr_defined(*fa_addr))
TEST_ERROR
+
+ /* Check array stats */
HDmemset(&state, 0, sizeof(state));
- state.hdr_size = FA_HDR_SIZE;
- state.nelmts = cparam->nelmts;
- if(check_stats(*fa, &state))
+ state.hdr_size = FA_HDR_SIZE;
+ state.nelmts = cparam->nelmts;
+ if (check_stats(*fa, &state))
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* 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: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
+static herr_t
verify_cparam(const H5FA_t *fa, const H5FA_create_t *cparam)
{
H5FA_create_t test_cparam; /* Creation parameters for array */
/* Retrieve creation parameters */
HDmemset(&test_cparam, 0, sizeof(H5FA_create_t));
- if(H5FA_get_cparam_test(fa, &test_cparam) < 0)
+ if (H5FA__get_cparam_test(fa, &test_cparam) < 0)
FAIL_STACK_ERROR
/* Verify creation parameters */
- if(H5FA_cmp_cparam_test(cparam, &test_cparam))
+ if (H5FA__cmp_cparam_test(cparam, &test_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: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
-static int
-finish(hid_t file, hid_t fapl, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
+static herr_t
+finish(hid_t fid, hid_t fapl_id, H5F_t *f, H5FA_t *fa, haddr_t fa_addr)
{
h5_stat_size_t file_size; /* File size, after deleting array */
/* Close the fixed array */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
/* Delete array */
- if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0)
+ if (H5FA_delete(f, fa_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Close the file */
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename_g, fapl)) < 0)
+ if ((file_size = h5_get_file_size(filename_g, fapl_id)) < 0)
TEST_ERROR
/* Verify the file is correct size */
- if(file_size != empty_size_g)
+ if (file_size != empty_size_g)
TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* finish() */
@@ -462,11 +459,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.raw_elmt_size = 0;
H5E_BEGIN_TRY {
- fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ fa = H5FA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened fixed array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
fa = NULL;
/* Indicate error */
@@ -477,11 +474,11 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.max_dblk_page_nelmts_bits = 0;
H5E_BEGIN_TRY {
- fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ fa = H5FA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened fixed array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
fa = NULL;
/* Indicate error */
@@ -492,18 +489,18 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
HDmemcpy(&test_cparam, cparam, sizeof(test_cparam));
test_cparam.nelmts = 0;
H5E_BEGIN_TRY {
- fa = H5FA_create(f, H5AC_ind_read_dxpl_id, &test_cparam, NULL);
+ fa = H5FA_create(f, &test_cparam, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened fixed array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
fa = NULL;
/* Indicate error */
TEST_ERROR
} /* end if */
- PASSED()
+ PASSED();
}
#else /* NDEBUG */
SKIPPED();
@@ -516,10 +513,10 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
TESTING("fixed array creation");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
- PASSED()
+ PASSED();
/* Verify the creation parameters */
TESTING("verify array creation parameters");
@@ -533,14 +530,14 @@ test_create(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t H5_ATTR_UNUSE
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -576,19 +573,19 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TESTING("create, close & reopen fixed array");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Close the fixed array */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0)
TEST_ERROR
/* Re-open the array */
- if(NULL == (fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -600,14 +597,14 @@ test_reopen(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -626,66 +623,64 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
+test_open_twice(hid_t fapl_id, H5FA_create_t *cparam, farray_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 */
- H5FA_t *fa = NULL; /* Fixed array wrapper */
- H5FA_t *fa2 = NULL; /* Fixed array wrapper */
- haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
+ H5FA_t *fa = NULL; /* Fixed array wrapper */
+ H5FA_t *fa2 = NULL; /* Fixed array wrapper */
+ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
/* Create file & retrieve pointer to internal file object */
- if(create_file(fapl, &file, &f) < 0)
+ if (create_file(fapl_id, &fid, &f) < 0)
TEST_ERROR
- /*
- * Display testing message
- */
+ /* Display testing message */
TESTING("open fixed array twice");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if (create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0)
+ if (H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if (reopen_file(&fid, &f, fapl_id, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Re-open the file */
- if((file2 = H5Freopen(file)) < 0)
+ if ((fid2 = H5Freopen(fid)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
- FAIL_STACK_ERROR
+ if (NULL == (f2 = (H5F_t *)H5VL_object(fid2)))
+ FAIL_STACK_ERROR;
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
/* Close the first extensible array wrapper */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -693,26 +688,26 @@ test_open_twice(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
/* (close before second file, to detect error on internal array header's
* shared file information)
*/
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, fapl, f2, fa2, fa_addr) < 0)
+ if (finish(fid2, fapl_id, f2, fa2, fa_addr) < 0)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
- if(fa2)
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
- H5Fclose(file2);
+ if (fa)
+ H5FA_close(fa);
+ if (fa2)
+ H5FA_close(fa2);
+ H5Fclose(fid);
+ H5Fclose(fid2);
} H5E_END_TRY;
return 1;
@@ -735,44 +730,42 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
+test_open_twice_diff(hid_t fapl_id, H5FA_create_t *cparam, farray_test_param_t *tparam)
{
- char filename_tmp[FARRAY_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 */
- H5FA_t *fa = NULL; /* Fixed array wrapper */
- H5FA_t *fa2 = NULL; /* Fixed array wrapper */
- haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
-
- /*
- * Display testing message
- */
+ char filename_tmp[FARRAY_FILENAME_LEN]; /* Temporary file name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ hid_t fid0 = H5I_INVALID_HID; /* File ID */
+ hid_t fid00 = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file object pointer */
+ H5F_t *f2 = NULL; /* Internal file object pointer */
+ H5FA_t *fa = NULL; /* Fixed array wrapper */
+ H5FA_t *fa2 = NULL; /* Fixed array wrapper */
+ haddr_t fa_addr = HADDR_UNDEF; /* Array address in file */
+
+ /* Display testing message */
TESTING("open fixed array twice, through different file handles");
/* Create file & retrieve pointer to internal file object */
- if(create_file(fapl, &file, &f) < 0)
+ if (create_file(fapl_id, &fid, &f) < 0)
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if (create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again, through the first file handle */
- if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa, cparam) < 0)
+ if (verify_cparam(fa, cparam) < 0)
TEST_ERROR
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0)
+ if (H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
@@ -780,15 +773,15 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
/* (So that there is something holding the file open when the extensible
* array is closed)
*/
- if((file0 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((fid0 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if (reopen_file(&fid, &f, fapl_id, &fa, fa_addr, tparam) < 0)
TEST_ERROR
/* Close the first fixed array wrapper */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if (H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
@@ -796,61 +789,60 @@ test_open_twice_diff(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tpa
/* (close before second file, to detect error on internal array header's
* shared file information)
*/
- if(H5Fclose(file) < 0)
+ if (H5Fclose(fid) < 0)
FAIL_STACK_ERROR
- file = -1;
+ fid = H5I_INVALID_HID;
/* Open a different file */
/* (This re-allocates the 'top' file pointer and assigns it a different
* 'shared' file pointer, making the file pointer in the fixed array's
* header stale)
*/
- h5_fixname(FILENAME[1], fapl, filename_tmp, sizeof(filename_tmp));
- if((file00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ h5_fixname(FILENAME[1], fapl_id, filename_tmp, sizeof(filename_tmp));
+ if ((fid00 = H5Fcreate(filename_tmp, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
FAIL_STACK_ERROR
-
/* Re-open the file with the fixed array */
- if((file2 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl)) < 0)
+ if ((fid2 = H5Fopen(filename_g, H5F_ACC_RDWR, fapl_id)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
- FAIL_STACK_ERROR
+ if (NULL == (f2 = (H5F_t *)H5VL_object(fid2)))
+ FAIL_STACK_ERROR;
/* Open the fixed array through the second file handle */
- if(NULL == (fa2 = H5FA_open(f2, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if (NULL == (fa2 = H5FA_open(f2, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
- if(verify_cparam(fa2, cparam) < 0)
+ if (verify_cparam(fa2, cparam) < 0)
TEST_ERROR
/* Close the extra file handles */
- if(H5Fclose(file0) < 0)
+ if (H5Fclose(fid0) < 0)
FAIL_STACK_ERROR
- if(H5Fclose(file00) < 0)
+ if (H5Fclose(fid00) < 0)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, fapl, f2, fa2, fa_addr) < 0)
+ if (finish(fid2, fapl_id, f2, fa2, fa_addr) < 0)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
- if(fa2)
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
- H5Fclose(file2);
- H5Fclose(file0);
- H5Fclose(file00);
+ if (fa)
+ H5FA_close(fa);
+ if (fa2)
+ H5FA_close(fa2);
+ H5Fclose(fid);
+ H5Fclose(fid2);
+ H5Fclose(fid0);
+ H5Fclose(fid00);
} H5E_END_TRY;
return 1;
@@ -887,15 +879,15 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TESTING("deleting open fixed array");
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Open the array again */
- if(NULL == (fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL)))
+ if(NULL == (fa2 = H5FA_open(f, fa_addr, NULL)))
FAIL_STACK_ERROR
/* Request that the array be deleted */
- if(H5FA_delete(f, H5AC_ind_read_dxpl_id, fa_addr, NULL) < 0)
+ if(H5FA_delete(f, fa_addr, NULL) < 0)
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -905,38 +897,38 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* Close the second fixed array wrapper */
- if(H5FA_close(fa2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa2) < 0)
FAIL_STACK_ERROR
fa2 = NULL;
/* Try re-opening the array again (should fail, as array will be deleted) */
H5E_BEGIN_TRY {
- fa2 = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL);
+ fa2 = H5FA_open(f, fa_addr, NULL);
} H5E_END_TRY;
if(fa2) {
/* Close opened array */
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa2);
/* Indicate error */
TEST_ERROR
} /* end if */
/* Close the first fixed array wrapper */
- if(H5FA_close(fa, H5AC_ind_read_dxpl_id) < 0)
+ if(H5FA_close(fa) < 0)
FAIL_STACK_ERROR
fa = NULL;
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, NULL, HADDR_UNDEF, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, NULL, HADDR_UNDEF, tparam) < 0)
TEST_ERROR
/* Try re-opening the array again (should fail, as array is now deleted) */
H5E_BEGIN_TRY {
- fa = H5FA_open(f, H5AC_ind_read_dxpl_id, fa_addr, NULL);
+ fa = H5FA_open(f, fa_addr, NULL);
} H5E_END_TRY;
if(fa) {
/* Close opened array */
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
/* Indicate error */
TEST_ERROR
@@ -955,17 +947,17 @@ test_delete_open(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
if(fa2)
- H5FA_close(fa2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5FA_close(fa2);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1391,7 +1383,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -1399,7 +1391,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
TEST_ERROR
if(H5FA_get_nelmts(fa, &fa_nelmts) < 0)
@@ -1431,7 +1423,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1458,7 +1450,7 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
idx = (hsize_t)sidx;
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved element is correct */
@@ -1467,12 +1459,12 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Set element of array */
welmt = (uint64_t)7 + idx;
- if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
+ if(H5FA_set(fa, idx, &welmt) < 0)
FAIL_STACK_ERROR
/* Retrieve element of array (set now) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved element is correct */
@@ -1495,14 +1487,14 @@ test_set_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -1546,7 +1538,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Create array */
- if(create_array(f, H5AC_ind_read_dxpl_id, cparam, &fa, &fa_addr) < 0)
+ if(create_array(f, cparam, &fa, &fa_addr) < 0)
TEST_ERROR
/* Verify the creation parameters */
@@ -1554,7 +1546,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* Check for closing & re-opening the file */
- if(reopen_file(&file, &f, fapl, H5AC_ind_read_dxpl_id, &fa, fa_addr, tparam) < 0)
+ if(reopen_file(&file, &f, fapl, &fa, fa_addr, tparam) < 0)
TEST_ERROR
if(H5FA_get_nelmts(fa, &fa_nelmts) < 0)
@@ -1576,7 +1568,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1585,7 +1577,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Set element of array */
welmt = (uint64_t)7 + idx;
- if(H5FA_set(fa, H5AC_ind_read_dxpl_id, idx, &welmt) < 0)
+ if(H5FA_set(fa, idx, &welmt) < 0)
FAIL_STACK_ERROR
/* Verify array state */
@@ -1596,7 +1588,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
/* Retrieve element of array (set now) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, idx, &relmt) < 0)
+ if(H5FA_get(fa, idx, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1608,7 +1600,7 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
for(cnt = 0; cnt < skip_elmts; cnt++) {
/* Retrieve element of array (not set yet) */
relmt = (uint64_t)0;
- if(H5FA_get(fa, H5AC_ind_read_dxpl_id, cnt, &relmt) < 0)
+ if(H5FA_get(fa, cnt, &relmt) < 0)
FAIL_STACK_ERROR
/* Verify that the retrieved is correct */
@@ -1622,14 +1614,14 @@ test_skip_elmts(hid_t fapl, H5FA_create_t *cparam, farray_test_param_t *tparam,
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(fa)
- H5FA_close(fa, H5AC_ind_read_dxpl_id);
+ H5FA_close(fa);
H5Fclose(file);
} H5E_END_TRY;
@@ -1658,17 +1650,22 @@ main(void)
unsigned nerrors = 0; /* Cumulative error count */
time_t curr_time; /* Current time, for seeding random number generator */
int ExpressMode; /* Test express value */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Reset library */
h5_reset();
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));
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Seed random #'s */
curr_time = HDtime(NULL);
HDsrandom((unsigned)curr_time);
@@ -1690,7 +1687,7 @@ main(void)
}
/* Iterate over the testing parameters */
- for(curr_test = FARRAY_TEST_NORMAL; curr_test < FARRAY_TEST_NTESTS; H5_INC_ENUM(farray_test_type_t, curr_test)) {
+ for(curr_test = FARRAY_TEST_NORMAL; curr_test < FARRAY_TEST_NTESTS; curr_test++) {
/* Initialize the testing parameters */
HDmemset(&tparam, 0, sizeof(tparam));
@@ -1700,12 +1697,12 @@ main(void)
switch(curr_test) {
/* "Normal" testing parameters */
case FARRAY_TEST_NORMAL:
- puts("Testing with NORMAL PARAMETERS");
+ HDputs("Testing with NORMAL PARAMETERS");
break;
/* "Re-open array" testing parameters */
case FARRAY_TEST_REOPEN:
- puts("Testing with reopen array flag set");
+ HDputs("Testing with reopen array flag set");
tparam.reopen_array = FARRAY_TEST_REOPEN;
break;
@@ -1726,31 +1723,31 @@ main(void)
nerrors += test_delete_open(fapl, &cparam, &tparam);
/* Iterate over the type of capacity tests */
- for(curr_iter = FARRAY_ITER_FW; curr_iter < FARRAY_ITER_NITERS; H5_INC_ENUM(farray_iter_type_t, curr_iter)) {
+ for(curr_iter = FARRAY_ITER_FW; curr_iter < FARRAY_ITER_NITERS; curr_iter++) {
/* Set appropriate parameters for each type of iteration */
switch(curr_iter) {
/* "Forward" testing parameters */
case FARRAY_ITER_FW:
- puts("Testing with forward iteration");
+ HDputs("Testing with forward iteration");
tparam.fiter = &fa_iter_fw;
break;
/* "Reverse" testing parameters */
case FARRAY_ITER_RV:
- puts("Testing with reverse iteration");
+ HDputs("Testing with reverse iteration");
tparam.fiter = &fa_iter_rv;
break;
/* "Random" testing parameters */
case FARRAY_ITER_RND:
- puts("Testing with random iteration");
+ HDputs("Testing with random iteration");
tparam.fiter = &fa_iter_rnd;
break;
/* "Cyclic" testing parameters */
case FARRAY_ITER_CYC:
- puts("Testing with cyclic iteration");
+ HDputs("Testing with cyclic iteration");
tparam.fiter = &fa_iter_cyc;
break;
@@ -1766,44 +1763,54 @@ main(void)
nerrors += test_set_elmts(fapl, &cparam, &tparam, (hsize_t)tparam.nelmts, "setting all the array elements");
} /* end for */
- /* Check skipping elements */
+ /* Check skipping elements */
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)1, TRUE, "skipping to first element");
nerrors += test_skip_elmts(fapl, &cparam, &tparam, ((hsize_t)1 << cparam.max_dblk_page_nelmts_bits), TRUE, "skipping to first element in data block page");
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)(tparam.nelmts - 1), TRUE, "skipping to last element");
- /* Create Fixed Array of MAX_NELMTS elements */
- /*
- * MAX_NELMTS succeeds on jam and smirom.
- * The value was adjusted for linew due to the following:
- Linew failed with "H5FD_sec2_truncate(): unable to extend file properly"
- Linew failed with "H5FD_sec2_truncate(): File too large"
- */
+ /* Create Fixed Array */
+ /* MAX_NELMTS succeeds on some platforms buy may fail on others:
+ *
+ * "H5FD_sec2_truncate(): unable to extend file properly"
+ *
+ * and
+ *
+ * "H5FD_sec2_truncate(): File too large"
+ *
+ * have both been seen.
+ */
tparam.nelmts = MAX_NELMTS/17;
- init_cparam(&cparam, &tparam);
+ init_cparam(&cparam, &tparam);
- /* Set the last element in the Fixed Array */
+ /* Set the last element in the Fixed Array */
nerrors += test_skip_elmts(fapl, &cparam, &tparam, (hsize_t)(tparam.nelmts - 1), FALSE, "skipping to last element");
} /* end for */
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
if(nerrors)
goto error;
- puts("All fixed array tests passed.");
+ HDputs("All fixed array tests passed.");
/* Clean up file used */
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
- H5Pclose(fapl);
+ H5Pclose(fapl);
} H5E_END_TRY;
- return 1;
+ if(api_ctx_pushed) H5CX_pop();
+
+ HDexit(EXIT_FAILURE);
} /* end main() */
diff --git a/test/fheap.c b/test/fheap.c
index 6c3a8ac..b1a0db0 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -29,9 +29,10 @@
#include "H5Fpkg.h"
/* Other private headers that this test requires */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory management */
-#include "H5VMprivate.h" /* Vectors and arrays */
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5VLprivate.h" /* Virtual Object Layer */
+#include "H5VMprivate.h" /* Vectors and arrays */
/* Max. testfile name length */
#define FHEAP_FILENAME_LEN 1024
@@ -81,7 +82,7 @@
/* The number of settings for testing: page buffering, file space strategy and persisting free-space */
#define NUM_PB_FS 6
-#define PAGE_BUFFER_PAGE_SIZE 4096
+#define PAGE_BUFFER_PAGE_SIZE 4096
const char *FILENAME[] = {
"fheap",
@@ -169,7 +170,7 @@ size_t shared_alloc_ids_g = 0; /* # of shared heap IDs allocated in array */
static int init_small_cparam(H5HF_create_t *cparam);
static int init_large_cparam(H5HF_create_t *cparam);
static int check_stats(const H5HF_t *fh, const fheap_heap_state_t *state);
-static int del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam,
+static int del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids);
@@ -359,7 +360,7 @@ op_memcpy(const void *obj, size_t obj_len, void *op_data)
*-------------------------------------------------------------------------
*/
static int
-add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off,
+add_obj(H5HF_t *fh, size_t obj_off,
size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned char heap_id[MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */
@@ -381,7 +382,7 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off,
/* Insert object */
HDmemset(heap_id, 0, id_len);
- if(H5HF_insert(fh, dxpl, obj_size, obj, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, obj, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for tracking the heap's state */
@@ -409,11 +410,11 @@ add_obj(H5HF_t *fh, hid_t dxpl, size_t obj_off,
} /* end if */
/* Read in object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(obj, shared_robj_g, obj_size))
TEST_ERROR
@@ -538,6 +539,13 @@ get_fill_size(const fheap_test_param_t *tparam)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * test_desc in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static int
begin_test(fheap_test_param_t *tparam, const char *base_desc,
fheap_heap_ids_t *keep_ids, size_t *fill_size)
@@ -566,6 +574,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc,
/* Success */
return(0);
} /* end begin_test() */
+H5_GCC_DIAG_ON(format-nonliteral)
/*-------------------------------------------------------------------------
@@ -582,14 +591,14 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc,
*-------------------------------------------------------------------------
*/
static int
-reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl,
+reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl,
H5HF_t **fh, haddr_t fh_addr, const fheap_test_param_t *tparam)
{
/* Check for closing & re-opening the heap */
/* (actually will close & re-open the file as well) */
if(tparam->reopen_heap) {
/* Close heap */
- if(H5HF_close(*fh, dxpl) < 0)
+ if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
*fh = NULL;
@@ -604,7 +613,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -612,7 +621,7 @@ reopen_file(hid_t *file, H5F_t **f, const char *filename, hid_t fapl, hid_t dxpl
FAIL_STACK_ERROR
/* Re-open heap */
- if(NULL == (*fh = H5HF_open(*f, dxpl, fh_addr)))
+ if(NULL == (*fh = H5HF_open(*f, fh_addr)))
FAIL_STACK_ERROR
} /* end if */
@@ -639,7 +648,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
+open_heap(char *filename, hid_t fapl, const H5HF_create_t *cparam,
const fheap_test_param_t *tparam, hid_t *file, H5F_t **f, H5HF_t **fh,
haddr_t *fh_addr, fheap_heap_state_t *state, h5_stat_size_t *empty_size)
{
@@ -655,7 +664,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
/* Check for deleting the entire heap */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -663,7 +672,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
FAIL_STACK_ERROR
/* Create absolute heap */
- if(NULL == (*fh = H5HF_create(*f, dxpl, cparam)))
+ if(NULL == (*fh = H5HF_create(*f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(*fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -680,8 +689,9 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
/* Prepare for querying the size of a file with an empty heap */
/* Close (empty) heap */
- if(H5HF_close(*fh, dxpl) < 0)
+ if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
+ *fh = NULL;
} /* end if */
/* Close file */
@@ -697,7 +707,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (*f = (H5F_t *)H5I_object(*file)))
+ if(NULL == (*f = (H5F_t *)H5VL_object(*file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -707,7 +717,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Create absolute heap */
- if(NULL == (*fh = H5HF_create(*f, dxpl, cparam)))
+ if(NULL == (*fh = H5HF_create(*f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(*fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -723,7 +733,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
} /* end if */
else {
/* Re-open heap */
- if(NULL == (*fh = H5HF_open(*f, dxpl, *fh_addr)))
+ if(NULL == (*fh = H5HF_open(*f, *fh_addr)))
FAIL_STACK_ERROR
} /* end else */
@@ -750,25 +760,26 @@ error:
*-------------------------------------------------------------------------
*/
static int
-reopen_heap(H5F_t *f, hid_t dxpl, H5HF_t **fh, haddr_t fh_addr,
+reopen_heap(H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
const fheap_test_param_t *tparam)
{
/* Check for closing & re-opening the heap */
if(tparam->reopen_heap) {
/* Close (empty) heap */
- if(H5HF_close(*fh, dxpl) < 0)
+ if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
+ *fh = NULL;
/* Re-open heap */
- if(NULL == (*fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (*fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
} /* end if */
/* Success */
- return(0);
+ return 0;
error:
- return(-1);
+ return -1;
} /* end reopen_heap() */
@@ -786,7 +797,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam,
+close_heap(char *filename, hid_t fapl, fheap_test_param_t *tparam,
hid_t file, H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids,
h5_stat_size_t empty_size)
@@ -794,7 +805,7 @@ close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam,
h5_stat_size_t file_size; /* Size of file currently */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -804,19 +815,19 @@ close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam,
/* Check for deleting the objects in the heap */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Delete objects inserted (either forward or reverse order) */
- if(del_objs(f, dxpl, fh, tparam, state, keep_ids))
+ if(del_objs(f, fh, tparam, state, keep_ids))
FAIL_STACK_ERROR
} /* end if */
/* Close the fractal heap */
- if(H5HF_close(*fh, dxpl) < 0)
+ if(H5HF_close(*fh) < 0)
FAIL_STACK_ERROR
*fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -855,7 +866,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam,
+del_objs_half_refill(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam,
fheap_heap_ids_t *keep_ids)
{
unsigned char *wobj; /* Buffer for object to insert */
@@ -890,11 +901,11 @@ del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tpar
half_nobjs = keep_ids->num_ids / 2;
for(u = 0; u < half_nobjs; u++) {
/* Remove object from heap */
- if(H5HF_remove(*fh, dxpl, &keep_ids->ids[id_len * obj_idx]) < 0)
+ if(H5HF_remove(*fh, &keep_ids->ids[id_len * obj_idx]) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Adjust index of object to delete next */
@@ -912,11 +923,11 @@ del_objs_half_refill(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tpar
for(u = 0; u < half_nobjs; u++) {
/* Re-insert object */
wobj = &shared_wobj_g[keep_ids->offs[obj_idx]];
- if(H5HF_insert(*fh, dxpl, keep_ids->lens[obj_idx], wobj, &keep_ids->ids[id_len * obj_idx]) < 0)
+ if(H5HF_insert(*fh, keep_ids->lens[obj_idx], wobj, &keep_ids->ids[id_len * obj_idx]) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Adjust index of object to delete next */
@@ -949,7 +960,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam,
+del_objs(H5F_t *f, H5HF_t **fh, fheap_test_param_t *tparam,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
haddr_t fh_addr = HADDR_UNDEF; /* Address of fractal heap */
@@ -965,7 +976,7 @@ del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam,
/* Check for first deleting half of objects & then re-inserting them */
if(tparam->drain_half == FHEAP_DEL_DRAIN_HALF)
- if(del_objs_half_refill(f, dxpl, fh, tparam, keep_ids))
+ if(del_objs_half_refill(f, fh, tparam, keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
@@ -987,11 +998,11 @@ del_objs(H5F_t *f, hid_t dxpl, H5HF_t **fh, fheap_test_param_t *tparam,
obj_idx = keep_ids->num_ids - 1;
for(u = 0; u < keep_ids->num_ids; u++) {
/* Remove object from heap */
- if(H5HF_remove(*fh, dxpl, &keep_ids->ids[id_len * obj_idx]) < 0)
+ if(H5HF_remove(*fh, &keep_ids->ids[id_len * obj_idx]) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Adjust index of object to delete next */
@@ -1041,7 +1052,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size,
+fill_heap(H5HF_t *fh, unsigned block_row, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned char *wobj; /* Buffer for object to insert */
@@ -1098,7 +1109,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size,
} /* end if */
/* Insert object */
- if(H5HF_insert(fh, dxpl, obj_size, wobj, curr_id_ptr) < 0)
+ if(H5HF_insert(fh, obj_size, wobj, curr_id_ptr) < 0)
FAIL_STACK_ERROR
*curr_len_ptr = obj_size;
*curr_off_ptr = obj_off;
@@ -1149,7 +1160,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size,
} /* end if */
/* Insert last object into the heap, using the remaining free space */
- if(H5HF_insert(fh, dxpl, last_obj_len, wobj, curr_id_ptr) < 0)
+ if(H5HF_insert(fh, last_obj_len, wobj, curr_id_ptr) < 0)
FAIL_STACK_ERROR
*curr_len_ptr = last_obj_len;
*curr_off_ptr = obj_off;
@@ -1174,7 +1185,7 @@ fill_heap(H5HF_t *fh, hid_t dxpl, unsigned block_row, size_t obj_size,
curr_off_ptr = shared_offs_g;
for(u = 0; u < num_ids; u++) {
/* Read in object */
- if(H5HF_read(fh, dxpl, curr_id_ptr, shared_robj_g) < 0)
+ if(H5HF_read(fh, curr_id_ptr, shared_robj_g) < 0)
FAIL_STACK_ERROR
/* Check that object is correct */
@@ -1233,7 +1244,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_root_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size,
+fill_root_row(H5HF_t *fh, unsigned row, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
hsize_t first_free_space; /* Size of free space in heap after the first block */
@@ -1303,7 +1314,7 @@ fill_root_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size,
state->man_alloc_size += block_size;
/* Fill a direct heap block up */
- if(fill_heap(fh, dxpl, row, obj_size, state, keep_ids))
+ if(fill_heap(fh, row, obj_size, state, keep_ids))
TEST_ERROR
} /* end for */
@@ -1330,7 +1341,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_partial_row(H5HF_t *fh, hid_t dxpl, unsigned row, unsigned width,
+fill_partial_row(H5HF_t *fh, unsigned row, unsigned width,
size_t obj_size, fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
size_t block_size; /* Size of direct block in this row */
@@ -1349,7 +1360,7 @@ fill_partial_row(H5HF_t *fh, hid_t dxpl, unsigned row, unsigned width,
state->man_alloc_size += block_size;
/* Fill a direct heap block up */
- if(fill_heap(fh, dxpl, row, obj_size, state, keep_ids))
+ if(fill_heap(fh, row, obj_size, state, keep_ids))
TEST_ERROR
} /* end for */
@@ -1376,7 +1387,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size,
+fill_row(H5HF_t *fh, unsigned row, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
/* Sanity check */
@@ -1384,7 +1395,7 @@ fill_row(H5HF_t *fh, hid_t dxpl, unsigned row, size_t obj_size,
HDassert(state);
/* Fill the entire row (with the partial row fill routine) */
- if(fill_partial_row(fh, dxpl, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids))
+ if(fill_partial_row(fh, row, DTABLE_WIDTH(fh), obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1413,7 +1424,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_root_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size,
+fill_root_direct(H5HF_t *fh, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */
@@ -1425,7 +1436,7 @@ fill_root_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size,
/* Loop over rows */
for(row = 0; row < max_dblock_rows; row++)
- if(fill_root_row(fh, dxpl, row, obj_size, state, keep_ids))
+ if(fill_root_row(fh, row, obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1453,7 +1464,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_2nd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
+fill_2nd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */
@@ -1465,7 +1476,7 @@ fill_2nd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
/* Loop over rows */
for(row = 0; row < max_dblock_rows; row++)
- if(fill_row(fh, dxpl, row, obj_size, state, keep_ids))
+ if(fill_row(fh, row, obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1492,7 +1503,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_all_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size,
+fill_all_direct(H5HF_t *fh, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned max_dblock_rows; /* Max. # of direct block rows in indirect block */
@@ -1504,7 +1515,7 @@ fill_all_direct(H5HF_t *fh, hid_t dxpl, size_t obj_size,
/* Loop over rows */
for(row = 0; row < max_dblock_rows; row++)
- if(fill_row(fh, dxpl, row, obj_size, state, keep_ids))
+ if(fill_row(fh, row, obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1532,7 +1543,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_2nd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
+fill_2nd_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned width; /* Width of heap's doubling table */
@@ -1543,7 +1554,7 @@ fill_2nd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
/* Loop over row of indirect blocks */
for(u = 0; u < width; u++)
- if(fill_2nd_indirect(fh, dxpl, pos, obj_size, state, keep_ids))
+ if(fill_2nd_indirect(fh, pos, obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1571,7 +1582,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size,
+fill_all_2nd_indirect_rows(H5HF_t *fh, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned width; /* Width of heap's doubling table */
@@ -1582,7 +1593,7 @@ fill_all_2nd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size,
/* Loop over rows of 2nd level deep indirect blocks */
for(u = 0; u < (H5VM_log2_of2(width) + 1); u++)
- if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids))
+ if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1610,18 +1621,18 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_3rd_indirect(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
+fill_3rd_indirect(H5HF_t *fh, unsigned pos, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned u; /* Local index variable */
/* Fill all direct block rows in third level indirect block */
- if(fill_all_direct(fh, dxpl, obj_size, state, keep_ids))
+ if(fill_all_direct(fh, obj_size, state, keep_ids))
TEST_ERROR
/* Fill rows of recursive indirect blocks in third level indirect block */
for(u = 0; u < pos; u++)
- if(fill_2nd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids))
+ if(fill_2nd_indirect_row(fh, (u + 1), obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1649,7 +1660,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_3rd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
+fill_3rd_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned width; /* Width of heap's doubling table */
@@ -1661,7 +1672,7 @@ fill_3rd_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
/* Loop over row of 3rd level indirect blocks */
for(u = 0; u < width; u++)
/* Fill third level indirect block */
- if(fill_3rd_indirect(fh, dxpl, pos, obj_size, state, keep_ids))
+ if(fill_3rd_indirect(fh, pos, obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1689,7 +1700,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size,
+fill_all_3rd_indirect_rows(H5HF_t *fh, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned width; /* Width of heap's doubling table */
@@ -1701,7 +1712,7 @@ fill_all_3rd_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size,
/* Loop over rows of 3rd level deep indirect blocks */
for(u = 0; u < (H5VM_log2_of2(width) + 1); u++)
/* Fill row of 3rd level indirect blocks */
- if(fill_3rd_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids))
+ if(fill_3rd_indirect_row(fh, (u + 1), obj_size, state, keep_ids))
TEST_ERROR
/* Operations succeeded */
@@ -1729,7 +1740,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_4th_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
+fill_4th_indirect_row(H5HF_t *fh, unsigned pos, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned width; /* Width of heap's doubling table */
@@ -1741,16 +1752,16 @@ fill_4th_indirect_row(H5HF_t *fh, hid_t dxpl, unsigned pos, size_t obj_size,
/* Loop over row of 4th level indirect blocks */
for(u = 0; u < width; u++) {
/* Fill all direct block rows in fourth level indirect block */
- if(fill_all_direct(fh, dxpl, obj_size, state, keep_ids))
+ if(fill_all_direct(fh, obj_size, state, keep_ids))
TEST_ERROR
/* Fill all rows of 2nd level deep indirect blocks in fourth level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, obj_size, state, keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, obj_size, state, keep_ids))
TEST_ERROR
/* Fill rows of third level indirect blocks in fourth level indirect block */
for(v = 0; v < pos; v++)
- if(fill_3rd_indirect_row(fh, dxpl, (v + 1), obj_size, state, keep_ids))
+ if(fill_3rd_indirect_row(fh, (v + 1), obj_size, state, keep_ids))
TEST_ERROR
} /* end for */
@@ -1779,7 +1790,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size,
+fill_all_4th_indirect_rows(H5HF_t *fh, size_t obj_size,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids)
{
unsigned width; /* Width of heap's doubling table */
@@ -1791,7 +1802,7 @@ fill_all_4th_indirect_rows(H5HF_t *fh, hid_t dxpl, size_t obj_size,
/* Loop over rows of 4th level deep indirect blocks */
for(u = 0; u < (H5VM_log2_of2(width) + 1); u++) {
/* Fill row of 4th level indirect blocks */
- if(fill_4th_indirect_row(fh, dxpl, (u + 1), obj_size, state, keep_ids))
+ if(fill_4th_indirect_row(fh, (u + 1), obj_size, state, keep_ids))
TEST_ERROR
/* Account for root indirect block doubling # of rows again */
@@ -1867,7 +1878,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -1879,7 +1890,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
*/
TESTING("fractal heap creation");
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -1892,7 +1903,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
HDmemset(&state, 0, sizeof(fheap_heap_state_t));
if(check_stats(fh, &state))
TEST_ERROR
- PASSED()
+ PASSED();
/* Query the type of address mapping */
TESTING("query heap creation parameters");
@@ -1903,11 +1914,12 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Delete heap */
- if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -1923,17 +1935,17 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5HF_close(fh);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_create() */
@@ -1985,7 +1997,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE)
@@ -2002,7 +2014,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TESTING("create, close & reopen fractal heap");
/* Create heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -2017,8 +2029,9 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Check for closing & re-opening the file */
if(tparam->reopen_heap) {
@@ -2031,7 +2044,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2041,7 +2054,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
} /* end if */
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Query the creation parameters */
@@ -2052,12 +2065,12 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Delete heap */
- if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -2074,15 +2087,15 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5HF_close(fh);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_reopen() */
@@ -2139,7 +2152,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
if(f->shared->fs_strategy == H5F_FSPACE_STRATEGY_PAGE)
@@ -2155,7 +2168,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TESTING("open fractal heap twice");
/* Create heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -2170,7 +2183,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Open the heap again, through the first file handle */
- if(NULL == (fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh2 = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -2181,12 +2194,12 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the second fractal heap wrapper */
- if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh2) < 0)
FAIL_STACK_ERROR
fh2 = NULL;
/* Check for closing & re-opening the heap & file */
- if(reopen_file(&file, &f, filename, fapl, H5AC_ind_read_dxpl_id, &fh, fh_addr, tparam) < 0)
+ if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2194,7 +2207,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f2 = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f2 = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2202,7 +2215,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Open the fractal heap through the second file handle */
- if(NULL == (fh2 = H5HF_open(f2, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh2 = H5HF_open(f2, fh_addr)))
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -2213,7 +2226,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the first fractal heap wrapper */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2225,12 +2238,12 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Close the second fractal heap wrapper */
- if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh2) < 0)
FAIL_STACK_ERROR
fh2 = NULL;
/* Delete heap */
- if(H5HF_delete(f2, H5AC_ind_read_dxpl_id, fh_addr) < 0)
+ if(H5HF_delete(f2, fh_addr) < 0)
FAIL_STACK_ERROR
/* Close the second file */
@@ -2247,21 +2260,21 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, H5AC_ind_read_dxpl_id);
+ H5HF_close(fh);
if(fh2)
- H5HF_close(fh2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
- H5Fclose(file2);
+ H5HF_close(fh2);
+ H5Fclose(file);
+ H5Fclose(file2);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_open_twice() */
@@ -2313,7 +2326,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2324,7 +2337,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TESTING("deleting open fractal heap");
/* Create heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -2339,11 +2352,11 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Open the heap again */
- if(NULL == (fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh2 = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Request that the heap be deleted */
- if(H5HF_delete(f, H5AC_ind_read_dxpl_id, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
/* Verify the creation parameters */
@@ -2354,24 +2367,25 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* Close the second fractal heap wrapper */
- if(H5HF_close(fh2, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh2) < 0)
FAIL_STACK_ERROR
fh2 = NULL;
/* Try re-opening the heap again (should fail, as heap will be deleted) */
H5E_BEGIN_TRY {
- fh2 = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr);
+ fh2 = H5HF_open(f, fh_addr);
} H5E_END_TRY;
if(fh2) {
/* Close opened heap */
- H5HF_close(fh2, H5AC_ind_read_dxpl_id);
+ H5HF_close(fh2);
+ fh2 = NULL;
/* Indicate error */
TEST_ERROR
} /* end if */
/* Close the first fractal heap wrapper */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2386,7 +2400,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2397,11 +2411,12 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Try re-opening the heap again (should fail, as heap is now deleted) */
H5E_BEGIN_TRY {
- fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr);
+ fh = H5HF_open(f, fh_addr);
} H5E_END_TRY;
if(fh) {
/* Close opened heap */
- H5HF_close(fh, H5AC_ind_read_dxpl_id);
+ H5HF_close(fh);
+ fh = NULL;
/* Indicate error */
TEST_ERROR
@@ -2420,19 +2435,19 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, H5AC_ind_read_dxpl_id);
+ H5HF_close(fh);
if(fh2)
- H5HF_close(fh2, H5AC_ind_read_dxpl_id);
- H5Fclose(file);
+ H5HF_close(fh2);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_delete_open() */
@@ -2453,7 +2468,6 @@ static unsigned
test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -2472,7 +2486,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2490,7 +2504,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 0;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2510,7 +2524,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2520,7 +2534,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 1;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2540,7 +2554,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2555,7 +2569,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2575,7 +2589,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2588,7 +2602,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Create absolute heap */
H5E_BEGIN_TRY {
- fh = H5HF_create(f, dxpl, &tmp_cparam);
+ fh = H5HF_create(f, &tmp_cparam);
} H5E_END_TRY;
if(NULL != fh)
FAIL_STACK_ERROR
@@ -2600,7 +2614,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 8;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2620,7 +2634,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2631,7 +2645,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 17;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2651,7 +2665,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2662,7 +2676,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 18;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2682,7 +2696,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2693,7 +2707,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 19;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2713,7 +2727,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2724,7 +2738,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
tmp_cparam.id_len = 45;
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Test ID length information for heap */
@@ -2744,7 +2758,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2756,7 +2770,7 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Create absolute heap */
H5E_BEGIN_TRY {
- fh = H5HF_create(f, dxpl, &tmp_cparam);
+ fh = H5HF_create(f, &tmp_cparam);
} H5E_END_TRY;
if(NULL != fh)
FAIL_STACK_ERROR
@@ -2767,17 +2781,17 @@ test_id_limits(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
- H5Fclose(file);
+ H5HF_close(fh);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_id_limits() */
@@ -2798,7 +2812,6 @@ static unsigned
test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -2815,7 +2828,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2835,7 +2848,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, &tmp_cparam)))
+ if(NULL == (fh = H5HF_create(f, &tmp_cparam)))
FAIL_STACK_ERROR
/* Get heap's address */
@@ -2845,7 +2858,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2858,7 +2871,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2866,7 +2879,7 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Query the heap creation parameters */
@@ -2877,8 +2890,9 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
@@ -2890,17 +2904,17 @@ test_filtered_create(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
H5O_msg_reset(H5O_PLINE_ID, &test_cparam.pline);
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
- H5Fclose(file);
+ H5HF_close(fh);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_filtered_create() */
@@ -2921,7 +2935,6 @@ static unsigned
test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -2938,7 +2951,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -2950,7 +2963,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
/* Get heap's address */
@@ -2961,24 +2974,24 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Get an empty heap's size */
empty_heap_size = 0;
- if(H5HF_size(fh, dxpl, &empty_heap_size) < 0)
+ if(H5HF_size(fh, &empty_heap_size) < 0)
FAIL_STACK_ERROR
if(empty_heap_size == 0)
TEST_ERROR
/* Insert an object */
- if(add_obj(fh, dxpl, (size_t)0, (size_t)10, NULL, NULL) < 0)
+ if(add_obj(fh, (size_t)0, (size_t)10, NULL, NULL) < 0)
TEST_ERROR
/* Get the heap's size after inserting one object */
one_heap_size = 0;
- if(H5HF_size(fh, dxpl, &one_heap_size) < 0)
+ if(H5HF_size(fh, &one_heap_size) < 0)
FAIL_STACK_ERROR
if(one_heap_size <= empty_heap_size)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -2992,7 +3005,7 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3000,48 +3013,48 @@ test_size(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Check the heap's size */
heap_size = 0;
- if(H5HF_size(fh, dxpl, &heap_size) < 0)
+ if(H5HF_size(fh, &heap_size) < 0)
FAIL_STACK_ERROR
if(heap_size != one_heap_size)
TEST_ERROR
/* Insert another object */
- if(add_obj(fh, dxpl, (size_t)1, (size_t)10, NULL, NULL) < 0)
+ if(add_obj(fh, (size_t)1, (size_t)10, NULL, NULL) < 0)
TEST_ERROR
/* Check the heap's size */
heap_size = 0;
- if(H5HF_size(fh, dxpl, &heap_size) < 0)
+ if(H5HF_size(fh, &heap_size) < 0)
FAIL_STACK_ERROR
if(heap_size != one_heap_size)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
-
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
- H5Fclose(file);
+ H5HF_close(fh);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_size() */
@@ -3066,7 +3079,6 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
{
hid_t file1 = -1; /* File ID */
hid_t file2 = -2; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3081,7 +3093,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file1)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file1)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3093,7 +3105,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
/* Get heap's address */
@@ -3103,11 +3115,11 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
TEST_ERROR
/* Insert an object */
- if(add_obj(fh, dxpl, (size_t)0, (size_t)10, NULL, NULL) < 0)
+ if(add_obj(fh, (size_t)0, (size_t)10, NULL, NULL) < 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -3125,7 +3137,7 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object (file1) */
- if(NULL == (f = (H5F_t *)H5I_object(file1)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file1)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3133,11 +3145,11 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* Open the heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Close the heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -3147,20 +3159,20 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
/* Get a pointer to the internal file object (file2) */
- if(NULL == (f = (H5F_t *)H5I_object(file2)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file2)))
FAIL_STACK_ERROR
/* Reopen the heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Check the heap's size */
heap_size = 0;
- if(H5HF_size(fh, dxpl, &heap_size) < 0)
+ if(H5HF_size(fh, &heap_size) < 0)
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
@@ -3169,14 +3181,14 @@ test_reopen_hdr(hid_t fapl, H5HF_create_t *cparam, hid_t fcpl)
FAIL_STACK_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file1);
H5Fclose(file2);
} H5E_END_TRY;
@@ -3202,7 +3214,6 @@ static unsigned
test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3220,7 +3231,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3228,7 +3239,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3243,7 +3254,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/*
@@ -3253,18 +3264,18 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
/* Attempt to insert 0-sized object into heap */
H5E_BEGIN_TRY {
- ret = H5HF_insert(fh, dxpl, (size_t)0, shared_wobj_g, heap_id);
+ ret = H5HF_insert(fh, (size_t)0, shared_wobj_g, heap_id);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
H5Eclear2(H5E_DEFAULT);
/* Insert a 1-sized object into heap (should be a 'tiny' object) */
- if(add_obj(fh, dxpl, (size_t)10, (size_t)1, &state, NULL))
+ if(add_obj(fh, (size_t)10, (size_t)1, &state, NULL))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check for correctly sized heap */
@@ -3272,7 +3283,7 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -3281,14 +3292,14 @@ test_man_insert_weird(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3314,7 +3325,6 @@ static unsigned
test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3330,7 +3340,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3338,7 +3348,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3353,7 +3363,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/*
@@ -3363,11 +3373,11 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check for correctly sized heap */
@@ -3375,7 +3385,7 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3383,14 +3393,14 @@ test_man_insert_first(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3415,7 +3425,6 @@ static unsigned
test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3431,7 +3440,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3439,7 +3448,7 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3458,19 +3467,19 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert second object */
- if(add_obj(fh, dxpl, (size_t)20, SMALL_OBJ_SIZE2, &state, NULL))
+ if(add_obj(fh, (size_t)20, SMALL_OBJ_SIZE2, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3478,14 +3487,14 @@ test_man_insert_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3511,7 +3520,6 @@ static unsigned
test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3528,7 +3536,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3536,7 +3544,7 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3560,15 +3568,15 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3576,14 +3584,14 @@ test_man_insert_root_mult(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3610,7 +3618,6 @@ static unsigned
test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3627,7 +3634,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3635,7 +3642,7 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3659,22 +3666,22 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force root indirect block creation */
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3682,14 +3689,14 @@ test_man_insert_force_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3716,7 +3723,6 @@ static unsigned
test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3733,7 +3739,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3741,7 +3747,7 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3765,22 +3771,22 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill the second direct block heap up (also creates initial root indirect block) */
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3788,14 +3794,14 @@ test_man_insert_fill_second(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3823,7 +3829,6 @@ static unsigned
test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3840,7 +3845,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3848,7 +3853,7 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3872,27 +3877,27 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill the second direct block heap up (also creates initial root indirect block) */
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of third direct block */
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3900,14 +3905,14 @@ test_man_insert_third_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -3934,7 +3939,6 @@ static unsigned
test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -3951,7 +3955,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -3959,7 +3963,7 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -3980,15 +3984,15 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
fill_size = get_fill_size(tparam);
/* Fill first row of [root] indirect block */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_root_row(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -3996,14 +4000,14 @@ test_man_fill_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4030,7 +4034,6 @@ static unsigned
test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4047,7 +4050,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4055,7 +4058,7 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4076,22 +4079,22 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
fill_size = get_fill_size(tparam);
/* Fill first root indirect row */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_root_row(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force expanding root indirect block to two rows */
state.man_size += cparam->managed.width * DBLOCK_SIZE(fh, 1);
state.man_alloc_size += DBLOCK_SIZE(fh, 1);
state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 1);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4099,14 +4102,14 @@ test_man_start_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4133,7 +4136,6 @@ static unsigned
test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4150,7 +4152,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4158,7 +4160,7 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4179,19 +4181,19 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
fill_size = get_fill_size(tparam);
/* Fill first root indirect row */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_root_row(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill second root indirect row */
- if(fill_root_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_root_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4199,14 +4201,14 @@ test_man_fill_second_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4234,7 +4236,6 @@ static unsigned
test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4251,7 +4252,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4259,7 +4260,7 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4280,15 +4281,15 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
fill_size = get_fill_size(tparam);
/* Fill first root indirect row */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_root_row(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill second root indirect row */
- if(fill_root_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_root_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force expanding root indirect block to four rows */
@@ -4298,11 +4299,11 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
state.man_alloc_size += DBLOCK_SIZE(fh, 2);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4310,14 +4311,14 @@ test_man_start_third_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4344,7 +4345,6 @@ static unsigned
test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4362,7 +4362,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4370,7 +4370,7 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4392,15 +4392,15 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
/* Loop over rows */
for(u = 0; u < 4; u++)
- if(fill_root_row(fh, dxpl, u, fill_size, &state, NULL))
+ if(fill_root_row(fh, u, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4408,14 +4408,14 @@ test_man_fill_fourth_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4442,7 +4442,6 @@ static unsigned
test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4459,7 +4458,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4467,7 +4466,7 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4488,15 +4487,15 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
fill_size = get_fill_size(tparam);
/* Fill all direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4504,14 +4503,14 @@ test_man_fill_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4538,7 +4537,6 @@ static unsigned
test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4555,7 +4553,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4563,7 +4561,7 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4584,20 +4582,20 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_
fill_size = get_fill_size(tparam);
/* Fill direct blocks up */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of first recursive indirect block */
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4605,14 +4603,14 @@ test_man_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4640,7 +4638,6 @@ static unsigned
test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4657,7 +4654,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4665,7 +4662,7 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4687,27 +4684,27 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe
fill_size = get_fill_size(tparam);
/* Fill direct blocks up */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill the first direct block in the recursive indirect block up */
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, NULL))
+ if(fill_heap(fh, 0, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of second direct block in
* first recursive indirect block
*/
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4715,14 +4712,14 @@ test_man_second_direct_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhe
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4750,7 +4747,6 @@ static unsigned
test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4767,7 +4763,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4775,7 +4771,7 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4797,19 +4793,19 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first recursive indirect block */
- if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4817,14 +4813,14 @@ test_man_fill_first_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4853,7 +4849,6 @@ static unsigned
test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4870,7 +4865,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4878,7 +4873,7 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -4900,26 +4895,26 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill first recursive indirect block */
- if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of second
* recursive indirect block
*/
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -4927,14 +4922,14 @@ test_man_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -4964,7 +4959,6 @@ static unsigned
test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -4981,7 +4975,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -4989,7 +4983,7 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5011,23 +5005,23 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill first recursive indirect block */
- if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill 2nd recursive indirect block */
- if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5035,14 +5029,14 @@ test_man_fill_second_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5072,7 +5066,6 @@ static unsigned
test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5089,11 +5082,11 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5115,19 +5108,19 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te
fill_size = get_fill_size(tparam);
/* Fill direct blocks in root indirect block up */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill row of recursive indirect blocks */
- if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5135,14 +5128,14 @@ test_man_fill_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_te
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5170,7 +5163,6 @@ static unsigned
test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5187,7 +5179,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5195,7 +5187,7 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5217,26 +5209,26 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
fill_size = get_fill_size(tparam);
/* Fill direct blocks in root indirect block up */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill row of recursive indirect blocks */
- if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of second
* recursive indirect block
*/
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5244,14 +5236,14 @@ test_man_start_2nd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5279,7 +5271,6 @@ static unsigned
test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5296,7 +5287,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5304,7 +5295,7 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5326,19 +5317,19 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5346,14 +5337,14 @@ test_man_recursive_indirect_two_deep(hid_t fapl, H5HF_create_t *cparam, fheap_te
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5382,7 +5373,6 @@ static unsigned
test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5399,7 +5389,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5407,7 +5397,7 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5429,26 +5419,26 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of third level deep
* recursive indirect block
*/
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5456,14 +5446,14 @@ test_man_start_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5492,7 +5482,6 @@ static unsigned
test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5509,7 +5498,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5517,7 +5506,7 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5539,27 +5528,27 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all direct block rows in third level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill row of recursive indirect blocks in third level indirect block */
- if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_2nd_indirect_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5567,14 +5556,14 @@ test_man_fill_first_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5603,7 +5592,6 @@ static unsigned
test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5620,7 +5608,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5628,7 +5616,7 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5650,23 +5638,23 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill 1st row of 3rd level indirect blocks */
- if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_3rd_indirect_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5674,14 +5662,14 @@ test_man_fill_3rd_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5710,7 +5698,6 @@ static unsigned
test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5727,7 +5714,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5735,7 +5722,7 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5757,23 +5744,23 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5781,14 +5768,14 @@ test_man_fill_all_3rd_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5818,7 +5805,6 @@ static unsigned
test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5835,7 +5821,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5843,7 +5829,7 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5865,30 +5851,30 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of four level deep
* recursive indirect block
*/
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -5896,14 +5882,14 @@ test_man_start_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -5933,7 +5919,6 @@ static unsigned
test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -5950,7 +5935,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -5958,7 +5943,7 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -5980,35 +5965,35 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill direct block rows in fourth level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level deep indirect blocks in fourth level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row of 3rd level deep indirect blocks in fourth level indirect block */
- if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_3rd_indirect_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -6016,14 +6001,14 @@ test_man_fill_first_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fh
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6053,7 +6038,6 @@ static unsigned
test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6070,7 +6054,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6078,7 +6062,7 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6100,27 +6084,27 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill 1st row of 4th level indirect blocks */
- if(fill_4th_indirect_row(fh, dxpl, 1, fill_size, &state, NULL))
+ if(fill_4th_indirect_row(fh, 1, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -6128,14 +6112,14 @@ test_man_fill_4th_recursive_indirect_row(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6165,7 +6149,6 @@ static unsigned
test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6182,7 +6165,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6190,7 +6173,7 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6212,27 +6195,27 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 4th level indirect blocks */
- if(fill_all_4th_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_4th_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -6240,14 +6223,14 @@ test_man_fill_all_4th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fhea
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6280,7 +6263,6 @@ static unsigned
test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6297,7 +6279,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6305,7 +6287,7 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, H5AC_ind_read_dxpl_id, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6328,46 +6310,46 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
fill_size = get_fill_size(tparam);
/* Fill direct blocks up in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap & file */
- if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap & file */
- if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap & file */
- if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 4th level indirect blocks */
- if(fill_all_4th_indirect_rows(fh, dxpl, fill_size, &state, NULL))
+ if(fill_all_4th_indirect_rows(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap & file */
- if(reopen_file(&file, &f, filename, fapl, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_file(&file, &f, filename, fapl, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to force creation of five level deep
* recursive indirect block
*/
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, NULL))
+ if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, NULL))
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -6375,14 +6357,14 @@ test_man_start_5th_recursive_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6409,7 +6391,6 @@ static unsigned
test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6431,7 +6412,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6439,7 +6420,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6454,7 +6435,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/*
@@ -6480,13 +6461,13 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
/* Try removing bogus heap ID from empty heap */
H5E_BEGIN_TRY {
- ret = H5HF_remove(fh, dxpl, heap_id);
+ ret = H5HF_remove(fh, heap_id);
} H5E_END_TRY;
if(ret >= 0)
FAIL_STACK_ERROR
/* Fill root direct blocks */
- if(fill_root_direct(fh, dxpl, fill_size, &state, NULL))
+ if(fill_root_direct(fh, fill_size, &state, NULL))
FAIL_STACK_ERROR
/* Get offset of random heap ID */
@@ -6507,7 +6488,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
/* Try removing bogus heap ID from heap w/objects */
H5E_BEGIN_TRY {
- ret = H5HF_remove(fh, dxpl, heap_id);
+ ret = H5HF_remove(fh, heap_id);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -6515,14 +6496,14 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
/* Try reading bogus heap ID from heap w/objects */
H5E_BEGIN_TRY {
- ret = H5HF_read(fh, dxpl, heap_id, shared_robj_g);
+ ret = H5HF_read(fh, heap_id, shared_robj_g);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
H5Eclear2(H5E_DEFAULT);
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -6530,7 +6511,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -6538,7 +6519,7 @@ error:
HDfprintf(stderr, "Random # seed was: %lu\n", seed);
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6563,7 +6544,6 @@ static unsigned
test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6584,7 +6564,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6592,7 +6572,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6609,7 +6589,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
/* Prepare for querying the size of a file with an empty heap */
/* Close (empty) heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -6625,7 +6605,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6633,7 +6613,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
STACK_ERROR
/* Re-open heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/*
@@ -6646,11 +6626,11 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
obj[u] = (unsigned char)u;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id) < 0)
+ if(H5HF_insert(fh, sizeof(obj), obj, &heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -6662,11 +6642,11 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -6678,8 +6658,9 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -6694,14 +6675,14 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6726,7 +6707,6 @@ static unsigned
test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6748,7 +6728,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6756,7 +6736,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6773,7 +6753,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
/* Prepare for querying the size of a file with an empty heap */
/* Close (empty) heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -6789,7 +6769,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6797,7 +6777,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
STACK_ERROR
/* Re-open heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/*
@@ -6810,11 +6790,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
obj[u] = (unsigned char)u;
/* Insert first object into heap */
- if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id1) < 0)
+ if(H5HF_insert(fh, sizeof(obj), obj, &heap_id1) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -6826,11 +6806,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Insert second object into heap */
- if(H5HF_insert(fh, dxpl, sizeof(obj), obj, &heap_id2) < 0)
+ if(H5HF_insert(fh, sizeof(obj), obj, &heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -6840,11 +6820,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -6854,11 +6834,11 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -6870,8 +6850,9 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -6886,14 +6867,14 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -6919,7 +6900,6 @@ static unsigned
test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -6941,7 +6921,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6949,7 +6929,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -6966,7 +6946,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Prepare for querying the size of a file with an empty heap */
/* Close (empty) heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -6982,7 +6962,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -6990,7 +6970,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
STACK_ERROR
/* Re-open heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/*
@@ -7003,11 +6983,11 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
obj = shared_wobj_g;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id) < 0)
+ if(H5HF_insert(fh, obj_len, obj, &heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7022,11 +7002,11 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7038,8 +7018,9 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7054,14 +7035,14 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -7087,7 +7068,6 @@ static unsigned
test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -7110,7 +7090,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7118,7 +7098,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -7135,7 +7115,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Prepare for querying the size of a file with an empty heap */
/* Close (empty) heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -7151,7 +7131,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7159,7 +7139,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
STACK_ERROR
/* Re-open heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/*
@@ -7175,11 +7155,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
obj = shared_wobj_g;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id1) < 0)
+ if(H5HF_insert(fh, obj_len, obj, &heap_id1) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7198,11 +7178,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
obj = shared_wobj_g;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id2) < 0)
+ if(H5HF_insert(fh, obj_len, obj, &heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7220,11 +7200,11 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Remove objects in different orders */
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7235,16 +7215,16 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
} /* end if */
else {
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7260,12 +7240,12 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
} /* end else */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7277,8 +7257,9 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7297,14 +7278,14 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -7330,7 +7311,6 @@ static unsigned
test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -7354,7 +7334,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7362,7 +7342,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -7379,7 +7359,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
/* Prepare for querying the size of a file with an empty heap */
/* Close (empty) heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
/* Close file */
@@ -7395,7 +7375,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7403,7 +7383,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
STACK_ERROR
/* Re-open heap */
- if(NULL == (fh = H5HF_open(f, dxpl, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/*
@@ -7419,11 +7399,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
obj = shared_wobj_g;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id1) < 0)
+ if(H5HF_insert(fh, obj_len, obj, &heap_id1) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7442,11 +7422,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
obj = shared_wobj_g;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id2) < 0)
+ if(H5HF_insert(fh, obj_len, obj, &heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7466,11 +7446,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
obj = shared_wobj_g;
/* Insert object into heap */
- if(H5HF_insert(fh, dxpl, obj_len, obj, &heap_id3) < 0)
+ if(H5HF_insert(fh, obj_len, obj, &heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7488,11 +7468,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
/* Remove objects in different orders */
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7503,11 +7483,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7518,16 +7498,16 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Remove third object from heap */
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
} /* end if */
else {
/* Remove third object from heap */
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7543,11 +7523,11 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7563,12 +7543,12 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
} /* end else */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7580,8 +7560,9 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
+ fh = NULL;
/* Close the file */
if(H5Fclose(file) < 0)
@@ -7600,14 +7581,14 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -7631,15 +7612,15 @@ static unsigned
test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
haddr_t fh_addr; /* Address of fractal heap */
- unsigned char heap_id[100][MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */
+ unsigned char **heap_id = NULL;
+ unsigned char *heap_id_data = NULL;
struct a_type_t1 {
char a[10];
- char b[29];
+ char b[40];
} obj1, obj2; /* Objects to insert/remove */
size_t id_len; /* Size of fractal heap IDs */
fheap_heap_state_t state; /* State of fractal heap */
@@ -7648,12 +7629,20 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
+ /* Set up data array */
+ if(NULL == (heap_id_data = (unsigned char *)HDcalloc(100 * MAX_HEAP_ID_LEN, sizeof(unsigned char))))
+ TEST_ERROR;
+ if(NULL == (heap_id = (unsigned char **)HDcalloc(100, sizeof(heap_id_data))))
+ TEST_ERROR;
+ for (i = 0; i < 100; i++)
+ heap_id[i] = heap_id_data + (i * MAX_HEAP_ID_LEN);
+
/* Create the file to work on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, tparam->my_fcpl, fapl)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -7661,7 +7650,7 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
STACK_ERROR
/* Create absolute heap */
- if(NULL == (fh = H5HF_create(f, dxpl, cparam)))
+ if(NULL == (fh = H5HF_create(f, cparam)))
FAIL_STACK_ERROR
if(H5HF_get_id_len(fh, &id_len) < 0)
FAIL_STACK_ERROR
@@ -7676,34 +7665,35 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
FAIL_STACK_ERROR
/*
- * Test incremental insert and removal
+ * Test incremental insert and removal
*/
TESTING("incremental object insertion and removal")
+ HDmemset(&obj1, 0, sizeof(obj1));
+ HDmemset(&obj2, 0, sizeof(obj2));
for(i = 0; i < 100; i++) {
- HDsprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
-
for(j = 0; j < i; j++) {
- HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
-
- if(H5HF_remove(fh, dxpl, heap_id[j]) < 0)
+ if(H5HF_remove(fh, heap_id[j]) < 0)
FAIL_STACK_ERROR
- if(H5HF_insert(fh, dxpl, (sizeof(obj2)), &obj2, heap_id[j]) < 0)
+
+ HDsprintf(obj2.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
+ if(H5HF_insert(fh, (sizeof(obj2)), &obj2, heap_id[j]) < 0)
FAIL_STACK_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object */
HDmemset(heap_id[i], 0, id_len);
- if(H5HF_insert(fh, dxpl, (sizeof(obj1)), &obj1, heap_id[i]) < 0)
+ HDsprintf(obj1.b, "%s%2d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
+ if(H5HF_insert(fh, (sizeof(obj1)), &obj1, heap_id[i]) < 0)
FAIL_STACK_ERROR
} /* end for */
-
+
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
TEST_ERROR
/* Close the file */
@@ -7711,17 +7701,24 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
TEST_ERROR
/* All tests passed */
- PASSED()
+ PASSED();
- return(0);
+ HDfree(heap_id);
+ HDfree(heap_id_data);
+
+ return 0;
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
- return(1);
+
+ HDfree(heap_id);
+ HDfree(heap_id_data);
+
+ return 1;
} /* test_man_incr_insert_remove() */
#endif /* QAK */
@@ -7746,7 +7743,6 @@ static unsigned
test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -7762,7 +7758,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -7770,12 +7766,12 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_heap(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7784,7 +7780,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -7794,7 +7790,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -7820,7 +7816,6 @@ static unsigned
test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -7836,7 +7831,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -7844,11 +7839,11 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_heap(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -7859,12 +7854,12 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
state.man_free_space = (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_heap(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7873,7 +7868,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -7883,7 +7878,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -7909,7 +7904,6 @@ static unsigned
test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -7925,17 +7919,17 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill first row of direct blocks */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7944,7 +7938,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -7954,7 +7948,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -7980,7 +7974,6 @@ static unsigned
test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -7996,19 +7989,19 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill first two rows of direct blocks */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_root_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8017,7 +8010,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8027,7 +8020,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8053,7 +8046,6 @@ static unsigned
test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8069,23 +8061,23 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill first two rows of direct blocks */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_root_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_root_row(fh, dxpl, 2, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 2, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_root_row(fh, dxpl, 3, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 3, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8094,7 +8086,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8104,7 +8096,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8130,7 +8122,6 @@ static unsigned
test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8146,17 +8137,17 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8165,7 +8156,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8175,7 +8166,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8201,7 +8192,6 @@ static unsigned
test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8217,21 +8207,21 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8240,7 +8230,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8250,7 +8240,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8276,7 +8266,6 @@ static unsigned
test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8292,25 +8281,25 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8319,7 +8308,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8329,7 +8318,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8360,7 +8349,6 @@ static unsigned
test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8376,7 +8364,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1;
@@ -8387,12 +8375,12 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8401,7 +8389,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8411,7 +8399,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8438,7 +8426,6 @@ static unsigned
test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8454,7 +8441,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -8467,30 +8454,30 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the heap block just created */
obj_size = (size_t)DBLOCK_FREE(fh, 2) - obj_size;
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert second "real" object, which should go in earlier direct block */
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8499,7 +8486,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8509,7 +8496,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8537,7 +8524,6 @@ static unsigned
test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8554,7 +8540,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -8567,40 +8553,40 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
state.man_free_space = cparam->managed.width * DBLOCK_FREE(fh, 0);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the heap block just created */
obj_size = (size_t)DBLOCK_FREE(fh, 2) - obj_size;
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add rows of blocks to "backfill" direct blocks that were skipped */
- if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert another object, which should extend direct blocks, instead of backfill */
state.man_alloc_size += DBLOCK_SIZE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, (size_t)SMALL_OBJ_SIZE2, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8609,7 +8595,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8619,7 +8605,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8647,7 +8633,6 @@ static unsigned
test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8663,7 +8648,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -8671,11 +8656,11 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -8689,12 +8674,12 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
state.man_free_space += (cparam->managed.width - 1 )* DBLOCK_FREE(fh, 0);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8703,7 +8688,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8713,7 +8698,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8744,7 +8729,6 @@ static unsigned
test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8762,7 +8746,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -8770,11 +8754,11 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -8788,29 +8772,29 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
state.man_free_space += (cparam->managed.width - 1 )* DBLOCK_FREE(fh, 0);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the (smaller) heap block just created */
obj_size = (size_t)DBLOCK_FREE(fh, 0) - SMALL_OBJ_SIZE1;
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill remainder of 2 * start size block */
obj_size = (size_t)DBLOCK_FREE(fh, 2) - ((size_t)DBLOCK_SIZE(fh, 0) + 1);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects to fill remaining rows of the starting block size */
@@ -8818,26 +8802,26 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
/* Fill remainder of first row of direct heap blocks up */
for(v = 0; v < (cparam->managed.width - 1); v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_heap(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Fill second row of direct blocks */
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to create new 2 * start size direct block */
state.man_alloc_size += DBLOCK_SIZE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8846,7 +8830,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -8856,7 +8840,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -8889,7 +8873,6 @@ static unsigned
test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -8907,7 +8890,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -8915,22 +8898,22 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
state.man_size = DBLOCK_SIZE(fh, 0);
state.man_alloc_size = DBLOCK_SIZE(fh, 0);
state.man_free_space = DBLOCK_FREE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_heap(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert small object, to create root indirect block */
state.man_size += (cparam->managed.width - 1) * DBLOCK_SIZE(fh, 0);
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
state.man_free_space += (cparam->managed.width - 1) * DBLOCK_FREE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -8944,67 +8927,67 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the (smaller) heap block just created */
obj_size = (size_t)DBLOCK_FREE(fh, 0) - SMALL_OBJ_SIZE1;
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill remainder of 4 * start size block */
obj_size = (size_t)DBLOCK_FREE(fh, 3) - ((size_t)DBLOCK_SIZE(fh, 2) + 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects to fill remaining heaps in first row */
for(u = 0; u < (cparam->managed.width - 2); u++) {
/* Fill a direct heap block up */
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(fill_heap(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_heap(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects to fill remaining heaps in second row */
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects to fill remaining heaps in third row */
- if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 2, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to create new 4 * start size direct block */
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, (size_t)SMALL_OBJ_SIZE1, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9013,7 +8996,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9023,7 +9006,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9055,7 +9038,6 @@ static unsigned
test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9072,16 +9054,16 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill first row of direct blocks */
- if(fill_root_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_root_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -9095,46 +9077,46 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 1);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 2);
state.man_free_space += cparam->managed.width * DBLOCK_FREE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill remainder of 4 * start size block */
obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects to fill remaining heaps in second row */
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects to fill remaining heaps in third row */
- if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 2, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to create new 4 * start size direct block */
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9143,7 +9125,7 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9153,7 +9135,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9182,7 +9164,6 @@ static unsigned
test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9201,7 +9182,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -9220,7 +9201,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
*/
obj_size = (size_t)DBLOCK_SIZE(fh, row - 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, row - 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Compute heap size & free space when all direct blocks allocated */
@@ -9237,12 +9218,12 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
obj_size = (size_t)DBLOCK_SIZE(fh, num_direct_rows - 2) + 1;
for(v = 0; v < cparam->managed.width; v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, num_direct_rows - 1);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Compute heap size & free space when root indirect block doubles again */
@@ -9257,12 +9238,12 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_direct_rows - 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_direct_rows - 1);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9271,7 +9252,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9281,7 +9262,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9309,7 +9290,6 @@ static unsigned
test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9326,16 +9306,16 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -9343,49 +9323,49 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
*/
obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add rows of blocks to "backfill" direct blocks that were skipped */
- if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the (biggest) heap block created */
obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill direct block heaps with 2 * initial block size in nested indirect block */
- if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 2, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert one more object, to create new 4 * start size direct block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9394,7 +9374,7 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9404,7 +9384,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9433,7 +9413,6 @@ static unsigned
test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9453,7 +9432,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -9461,11 +9440,11 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -9474,46 +9453,46 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
*/
obj_size = (size_t)DBLOCK_SIZE(fh, num_first_indirect_rows - 1) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of direct blocks that are smaller than large object's block size */
for(row = 0; row < num_first_indirect_rows; row++) {
/* Fill rows of direct blocks in skipped indirect blocks */
for(u = 0; u < cparam->managed.width; u++)
- if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids))
+ if(fill_row(fh, row, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill row of direct blocks in largest (i.e. non-skipped) indirect block */
- if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids))
+ if(fill_row(fh, row, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9522,7 +9501,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9532,7 +9511,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9562,7 +9541,6 @@ static unsigned
test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9581,7 +9559,7 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -9589,21 +9567,21 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row (except one) of 2nd level indirect blocks */
for(u = 0; u < cparam->managed.width - 1; u++)
/* Fill all rows of 2nd level indirect blocks in root block */
- if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_2nd_indirect(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -9615,20 +9593,20 @@ test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in 2nd level indirect block's direct blocks
@@ -9636,27 +9614,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
*/
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in skipped 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in current 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9665,7 +9643,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9675,7 +9653,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9708,7 +9686,6 @@ static unsigned
test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9728,7 +9705,7 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -9736,11 +9713,11 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -9752,20 +9729,20 @@ test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(hid_t fapl, H5
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object too large for initial block size in skipped indirect blocks */
@@ -9774,11 +9751,11 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, 4);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (medium) block just created */
@@ -9786,52 +9763,52 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#ifdef QAK
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Finish off blocks in row of medium block size (just to make row filling easier below) */
obj_size = (size_t)DBLOCK_FREE(fh, 4);
for(u = 1; u < cparam->managed.width; u++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 4);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of direct blocks that are smaller than large object's block size */
for(row = 0; row < num_first_indirect_rows; row++) {
/* Fill rows of direct blocks in skipped indirect blocks */
for(u = 0; u < cparam->managed.width; u++)
- if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids))
+ if(fill_row(fh, row, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill row of direct blocks in largest (i.e. non-skipped) indirect block */
/* (Skip the row of blocks filled above) */
if(row != 4)
- if(fill_row(fh, dxpl, row, fill_size, &state, &keep_ids))
+ if(fill_row(fh, row, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end while */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9840,7 +9817,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -9850,7 +9827,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -9878,7 +9855,6 @@ static unsigned
test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -9898,7 +9874,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -9907,11 +9883,11 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
max_dblock_rows = DTABLE_MAX_DROWS(fh);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -9919,71 +9895,71 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
*/
obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the (biggest) heap block created */
obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 1) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in indirect block's direct blocks */
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in first row of skipped 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block rows in second row of skipped 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in used 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows in second row of skipped 2nd level indirect blocks (and used 2nd level block) */
/* Direct block rows in skipped 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids))
+ if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Direct block row in used 2nd level indirect block */
- if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids))
+ if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9992,7 +9968,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10002,7 +9978,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10032,7 +10008,6 @@ static unsigned
test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10052,7 +10027,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -10061,11 +10036,11 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
max_dblock_rows = DTABLE_MAX_DROWS(fh);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of two rows of indirect blocks and
@@ -10073,20 +10048,20 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
*/
obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the (biggest) heap block created */
obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 1) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object that can't fit in first row of indirect blocks
@@ -10095,76 +10070,76 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
*/
obj_size = (size_t)DBLOCK_SIZE(fh, max_dblock_rows - 3) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 2);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert an object to fill up the (2nd biggest) heap block created */
obj_size = (size_t)DBLOCK_FREE(fh, max_dblock_rows - 2) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in indirect block's direct blocks */
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in first row of skipped 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block rows in second row of skipped 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in used 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows in second row of skipped 2nd level indirect blocks (and used 2nd level block) */
/* Finish blocks in partially used 2nd level indirect block */
- if(fill_partial_row(fh, dxpl, num_first_indirect_rows, cparam->managed.width - 1, fill_size, &state, &keep_ids))
+ if(fill_partial_row(fh, num_first_indirect_rows, cparam->managed.width - 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block rows in skipped 2nd level indirect blocks */
/* (less the one indirect block already used) */
for(v = 0; v < cparam->managed.width - 1; v++)
- if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids))
+ if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Direct block row in used 3rd row 2nd level indirect block */
- if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids))
+ if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, max_dblock_rows - 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10173,7 +10148,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10183,7 +10158,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10212,7 +10187,6 @@ static unsigned
test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10229,24 +10203,24 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -10255,43 +10229,43 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
*/
obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in 3rd level indirect block's direct blocks */
- if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 2, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10300,7 +10274,7 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10310,7 +10284,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10341,7 +10315,6 @@ static unsigned
test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10358,32 +10331,32 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in third level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -10392,45 +10365,45 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
*/
obj_size = (size_t)DBLOCK_SIZE(fh, 2) + 1;
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, 3) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (3rd level indirect block's) 2nd level
* indirect block's direct blocks
*/
- if(fill_row(fh, dxpl, 0, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 0, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
- if(fill_row(fh, dxpl, 2, fill_size, &state, &keep_ids))
+ if(fill_row(fh, 2, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, 3);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10439,7 +10412,7 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10449,7 +10422,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10479,7 +10452,6 @@ static unsigned
test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10498,7 +10470,7 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -10506,27 +10478,27 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in third level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -10538,20 +10510,20 @@ test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(h
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (first 3rd level indirect block's) 2nd level
@@ -10561,27 +10533,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 3rd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10590,7 +10562,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10600,7 +10572,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10631,7 +10603,6 @@ static unsigned
test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10650,7 +10621,7 @@ test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -10661,27 +10632,27 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
#endif /* QAK */
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in third level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -10693,11 +10664,11 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
@@ -10705,11 +10676,11 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#ifdef QAK
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (first 3rd level indirect block's) 2nd level
@@ -10719,31 +10690,31 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 3rd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Fill row of direct blocks in second 3rd level indirect block */
- if(fill_row(fh, dxpl, num_first_indirect_rows, fill_size, &state, &keep_ids))
+ if(fill_row(fh, num_first_indirect_rows, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows + 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10752,7 +10723,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10762,7 +10733,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10794,7 +10765,6 @@ static unsigned
test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10813,7 +10783,7 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -10821,37 +10791,37 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in root indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row (except one) of 3rd level indirect blocks */
for(u = 0; u < cparam->managed.width - 1; u++)
/* Fill 3rd level indirect block */
- if(fill_3rd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_3rd_indirect(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in last third level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -10863,20 +10833,20 @@ test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(hid_t
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in 2nd level indirect block's direct blocks
@@ -10885,27 +10855,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in current 3rd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10914,7 +10884,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -10924,7 +10894,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -10957,7 +10927,6 @@ static unsigned
test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -10976,7 +10945,7 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -10984,44 +10953,44 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in 4th level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row of 3rd level indirect blocks */
- if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 2nd row third level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row (except one) of 2nd level indirect blocks */
for(u = 0; u < cparam->managed.width - 1; u++)
- if(fill_2nd_indirect(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_2nd_indirect(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -11033,20 +11002,20 @@ test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_s
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in 2nd level indirect block's direct blocks
@@ -11054,27 +11023,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
*/
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in skipped 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in current 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11083,7 +11052,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -11093,7 +11062,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -11124,7 +11093,6 @@ static unsigned
test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -11143,7 +11111,7 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -11151,35 +11119,35 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in fourth level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -11191,20 +11159,20 @@ test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(hid_t fapl, H5
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (first 4th level indirect block's) 2nd level
@@ -11214,27 +11182,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 2nd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11243,7 +11211,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -11253,7 +11221,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -11286,7 +11254,6 @@ static unsigned
test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -11305,7 +11272,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -11313,51 +11280,51 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in fourth level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in fourth level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in fourth level indirect block's 3rd level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -11369,20 +11336,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_blo
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (first 4th level indirect block's first 3rd
@@ -11392,27 +11359,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 3rd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11421,7 +11388,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -11431,7 +11398,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -11466,7 +11433,6 @@ static unsigned
test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -11485,7 +11451,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -11493,31 +11459,31 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row of 4th level indirect blocks */
- if(fill_4th_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_4th_indirect_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Account for root indirect block doubling # of rows again */
@@ -11538,39 +11504,39 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
} /* end if */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 2nd row 4th level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in 2nd row 4th level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row of 3rd level indirect blocks in 2nd row 4th level indirect block */
- if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 4th level indirect block's 2nd row of 3rd level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -11582,20 +11548,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (first block in 2nd row 4th level indirect
@@ -11605,27 +11571,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 3rd level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11634,7 +11600,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -11644,7 +11610,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -11681,7 +11647,6 @@ static unsigned
test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -11700,7 +11665,7 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -11708,66 +11673,66 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 4th level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in 4th level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row (except one) of 3rd level indirect blocks in 4th level indirect block */
for(u = 0; u < cparam->managed.width - 1; u++) {
/* Fill all direct block rows in 3rd level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill row of 2nd level indirect blocks in 3rd level indirect block */
- if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_2nd_indirect_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 4th level indirect block's last 3rd level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -11779,20 +11744,20 @@ test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_star
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (4th level indirect block's first 3rd level
@@ -11802,27 +11767,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 4th level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11831,7 +11796,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -11841,7 +11806,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -11878,7 +11843,6 @@ static unsigned
test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -11897,7 +11861,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -11905,81 +11869,81 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
num_first_indirect_rows = IBLOCK_MAX_DROWS(fh, 1);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 3rd level indirect blocks */
- if(fill_all_3rd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_3rd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill first row (except one) of 4th level indirect blocks */
for(u = 0; u < cparam->managed.width - 1; u++) {
/* Fill all direct block rows in 4th level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in 4th level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill row of 3rd level indirect blocks in 4th level indirect block */
- if(fill_3rd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_3rd_indirect_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 4th level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in 4th level indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill row (except one) of 3rd level indirect blocks in 4th level indirect block */
for(u = 0; u < cparam->managed.width - 1; u++) {
/* Fill all direct block rows in 3rd level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Fill row of 2nd level indirect blocks in 3rd level indirect block */
- if(fill_2nd_indirect_row(fh, dxpl, 1, fill_size, &state, &keep_ids))
+ if(fill_2nd_indirect_row(fh, 1, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all direct block rows in 4th level indirect block's last 3rd level indirect block */
- if(fill_all_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Account for root indirect block doubling # of rows again */
@@ -12000,7 +11964,7 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
} /* end if */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert large object, to force creation of indirect block and
@@ -12012,20 +11976,20 @@ test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_
HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
#endif /* QAK */
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object to fill space in (large) block created */
obj_size = (size_t)DBLOCK_FREE(fh, num_first_indirect_rows) - obj_size;
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill rows skipped over in (4th level indirect block's first 3rd level
@@ -12035,27 +11999,27 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
for(u = 0; u < num_first_indirect_rows; u++) {
/* Direct block rows in 2nd level indirect blocks */
for(v = 0; v < cparam->managed.width; v++)
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
/* Direct block row in 4th level indirect block */
- if(fill_row(fh, dxpl, u, fill_size, &state, &keep_ids))
+ if(fill_row(fh, u, fill_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Add one more object, to create another "large" block */
obj_size = SMALL_OBJ_SIZE1;
state.man_alloc_size += DBLOCK_SIZE(fh, num_first_indirect_rows);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12064,7 +12028,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12074,7 +12038,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -12106,7 +12070,6 @@ static unsigned
test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -12123,7 +12086,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -12136,7 +12099,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
state.man_free_space = DBLOCK_FREE(fh, 0);
for(u = 0; u < cparam->managed.width; u++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
if(u == 0) {
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
@@ -12147,12 +12110,12 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
state.man_free_space += DBLOCK_FREE(fh, 1) * cparam->managed.width;
for(u = 0; u < cparam->managed.width; u++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* (Account for doubling root indirect block for rows 3-4 */
@@ -12163,34 +12126,34 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Add one more object, to create a 2 * start_block_size block */
state.man_alloc_size += DBLOCK_SIZE(fh, 2);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Go back and fill in direct blocks of initial block size (which have large free space in them) */
obj_size = (size_t)DBLOCK_FREE(fh, 0) - obj_size;
for(u = 0; u < cparam->managed.width; u++)
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
for(u = 0; u < cparam->managed.width; u++)
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill in 2 * start_block_size block */
obj_size = (size_t)DBLOCK_FREE(fh, 2) - ((size_t)DBLOCK_SIZE(fh, 0) / 2);
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12199,7 +12162,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12209,7 +12172,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -12238,7 +12201,6 @@ static unsigned
test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -12256,7 +12218,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -12272,7 +12234,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* First row */
for(u = 0; u < cparam->managed.width; u++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 0);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
if(u == 0) {
state.man_size = cparam->managed.width * DBLOCK_SIZE(fh, 0);
@@ -12284,12 +12246,12 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Second row */
for(u = 0; u < cparam->managed.width; u++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 1);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* (Account for doubling root indirect block for rows 3-4 */
@@ -12303,13 +12265,13 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
obj_size = (size_t)DBLOCK_SIZE(fh, u + 2) / 2;
for(v = 0; v < cparam->managed.width; v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, u + 2);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* (Account for doubling root indirect block for rows 5-8 */
@@ -12323,13 +12285,13 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
obj_size = (size_t)DBLOCK_SIZE(fh, u + 4) / 2;
for(v = 0; v < cparam->managed.width; v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, u + 4);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* (Account for doubling root indirect block for rows 9-16 */
@@ -12342,25 +12304,25 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
obj_size = (size_t)DBLOCK_SIZE(fh, 8) / 2;
for(v = 0; v < cparam->managed.width; v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, 8);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Go back and backfill all root block's direct blocks */
for(u = 0; u < root_direct_rows; u++) {
obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2);
for(v = 0; v < cparam->managed.width; v++)
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12369,7 +12331,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12379,7 +12341,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -12410,7 +12372,6 @@ static unsigned
test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -12429,7 +12390,7 @@ test_man_frag_2nd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -12440,11 +12401,11 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
#endif /* QAK */
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects small enough to fit into each direct block, but not to
@@ -12454,26 +12415,26 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
obj_size = (size_t)DBLOCK_SIZE(fh, u) / 2;
for(v = 0; v < cparam->managed.width; v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, u);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Go back and backfill all 2nd level indirect block's direct blocks */
for(u = 0; u < num_first_indirect_rows; u++) {
obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2);
for(v = 0; v < cparam->managed.width; v++)
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12482,7 +12443,7 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12492,7 +12453,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -12524,7 +12485,6 @@ static unsigned
test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -12543,7 +12503,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
@@ -12551,19 +12511,19 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
root_direct_rows = DTABLE_MAX_DROWS(fh);
/* Fill direct blocks in root indirect block */
- if(fill_root_direct(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_root_direct(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Fill all rows of 2nd level indirect blocks in root indirect block */
- if(fill_all_2nd_indirect_rows(fh, dxpl, fill_size, &state, &keep_ids))
+ if(fill_all_2nd_indirect_rows(fh, fill_size, &state, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert objects small enough to fit into each direct block, but not to
@@ -12573,26 +12533,26 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
obj_size = (size_t)DBLOCK_SIZE(fh, u) / 2;
for(v = 0; v < cparam->managed.width; v++) {
state.man_alloc_size += DBLOCK_SIZE(fh, u);
- if(add_obj(fh, dxpl, (size_t)10, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)10, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
} /* end for */
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Go back and backfill all 3rd level indirect block's direct blocks */
for(u = 0; u < root_direct_rows; u++) {
obj_size = (size_t)DBLOCK_FREE(fh, u) - ((size_t)DBLOCK_SIZE(fh, u) / 2);
for(v = 0; v < cparam->managed.width; v++)
- if(add_obj(fh, dxpl, (size_t)20, obj_size, &state, &keep_ids))
+ if(add_obj(fh, (size_t)20, obj_size, &state, &keep_ids))
TEST_ERROR
} /* end for */
/* Perform common file & heap close operations */
- if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12601,7 +12561,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12611,7 +12571,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -12639,7 +12599,6 @@ static unsigned
test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -12660,7 +12619,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -12675,7 +12634,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -12683,7 +12642,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12693,12 +12652,12 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -12706,11 +12665,11 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Delete individual objects, if we won't be deleting the entire heap later */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12722,14 +12681,14 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -12755,7 +12714,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12766,7 +12725,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -12792,7 +12751,6 @@ static unsigned
test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -12814,7 +12772,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -12831,7 +12789,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -12839,7 +12797,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12849,19 +12807,19 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert second object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -12869,7 +12827,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12879,12 +12837,12 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in second huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -12893,11 +12851,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
if(tparam->del_dir != FHEAP_DEL_HEAP) {
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12907,11 +12865,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12922,11 +12880,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
} /* end if */
else {
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12936,11 +12894,11 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -12953,14 +12911,14 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -12987,7 +12945,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -12999,7 +12957,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -13025,7 +12983,6 @@ static unsigned
test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -13048,7 +13005,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -13067,7 +13024,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
/* Insert first object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13075,7 +13032,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13085,19 +13042,19 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Read in first huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert second object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13105,7 +13062,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13115,19 +13072,19 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Read in second huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert third object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 3;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13135,7 +13092,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13145,12 +13102,12 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Read in third huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -13159,13 +13116,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
if(tparam->del_dir != FHEAP_DEL_HEAP) {
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13175,13 +13132,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13191,13 +13148,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Remove third object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13208,13 +13165,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
} /* end if */
else {
/* Remove third object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13224,13 +13181,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13240,13 +13197,13 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
TEST_ERROR
/* Remove first object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13259,14 +13216,14 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -13294,7 +13251,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -13307,7 +13264,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -13333,7 +13290,6 @@ static unsigned
test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -13358,7 +13314,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -13381,7 +13337,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert first object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13389,7 +13345,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13399,19 +13355,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in first huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert second object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13419,7 +13375,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13429,19 +13385,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in second huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert third object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 3;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13449,7 +13405,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13459,19 +13415,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in third huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert fourth object small enough to fit into 'normal' heap blocks */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id4) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id4) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id4, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13479,7 +13435,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13496,19 +13452,19 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in fourth ('normal') object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id4, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id4, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id4, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id4, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert fifth object small enough to fit into 'normal' heap blocks */
obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id5) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id5) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id5, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13516,7 +13472,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13534,12 +13490,12 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in fifth ('normal') object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id5, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id5, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id5, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id5, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -13548,13 +13504,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
if(tparam->del_dir != FHEAP_DEL_HEAP) {
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13564,13 +13520,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13580,13 +13536,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove third object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13596,36 +13552,36 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove fourth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id4) < 0)
+ if(H5HF_remove(fh, heap_id4) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Remove fifth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id5) < 0)
+ if(H5HF_remove(fh, heap_id5) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
} /* end if */
else {
/* Remove fifth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id5) < 0)
+ if(H5HF_remove(fh, heap_id5) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Remove fourth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id4) < 0)
+ if(H5HF_remove(fh, heap_id4) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Reset 'managed' object statistics after they are all removed */
@@ -13635,13 +13591,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
state.man_free_space = 0;
/* Remove third object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13651,13 +13607,13 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13667,11 +13623,11 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
} /* end else */
@@ -13683,14 +13639,14 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -13720,7 +13676,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -13735,7 +13691,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -13759,7 +13715,6 @@ static unsigned
test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -13767,16 +13722,17 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
H5HF_create_t tmp_cparam; /* Local heap creation parameters */
fheap_heap_ids_t keep_ids; /* Structure to retain heap IDs */
size_t id_len; /* Size of fractal heap IDs */
- h5_stat_size_t empty_size; /* Size of a file with an empty heap */
- h5_stat_size_t file_size; /* Size of file currently */
+ h5_stat_size_t empty_size; /* Size of a file with an empty heap */
+ h5_stat_size_t file_size; /* Size of file currently */
unsigned char *heap_id = NULL; /* Heap ID for object */
size_t obj_size; /* Size of object */
size_t robj_size; /* Size of object read */
unsigned char obj_type; /* Type of storage for object */
fheap_heap_state_t state; /* State of fractal heap */
unsigned deflate_level; /* Deflation level */
- size_t old_actual_id_len =0 ; /* Old actual ID length */
+ size_t old_actual_id_len = 0; /* Old actual ID length */
hbool_t huge_ids_direct; /* Are 'huge' objects directly acccessed? */
+ hbool_t pline_init = FALSE; /* Whether the I/O pipeline has been initialized */
const char *base_desc = "insert 'huge' object into heap with I/O filters, then remove %s"; /* Test description */
/* Copy heap creation properties */
@@ -13786,6 +13742,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
deflate_level = 6;
if(H5Z_append(&tmp_cparam.pline, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, (size_t)1, &deflate_level) < 0)
FAIL_STACK_ERROR
+ pline_init = TRUE;
/* Adjust actual ID length, if asking for IDs that can directly access 'huge' objects */
if(cparam->id_len == 1) {
@@ -13794,7 +13751,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
} /* end if */
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Perform common test initialization operations */
@@ -13829,7 +13786,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
/* Insert object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -13837,13 +13794,13 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* QAK */
#ifdef QAK
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -13856,7 +13813,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -13864,7 +13821,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
#endif /* QAK */
/* QAK */
@@ -13876,12 +13833,12 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
TEST_ERROR
/* Read in huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -13889,11 +13846,11 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
/* Delete individual objects, if we won't be deleting the entire heap later */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -13904,14 +13861,14 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
} /* end if */
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -13939,7 +13896,7 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si
H5MM_xfree(heap_id);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -13947,8 +13904,10 @@ error:
H5E_BEGIN_TRY {
H5MM_xfree(heap_id);
if(fh)
- H5HF_close(fh, dxpl);
- H5Fclose(file);
+ H5HF_close(fh);
+ if(pline_init)
+ H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_filtered_huge() */
@@ -13975,7 +13934,6 @@ static unsigned
test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -13996,7 +13954,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -14011,7 +13969,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert object small enough to encode in heap ID */
obj_size = tparam->actual_id_len - 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14019,7 +13977,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14029,12 +13987,12 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in tiny object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -14042,11 +14000,11 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Delete individual objects, if we won't be deleting the entire heap later */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14058,14 +14016,14 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -14091,7 +14049,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -14102,7 +14060,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -14128,7 +14086,6 @@ static unsigned
test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -14150,7 +14107,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -14167,7 +14124,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert object small enough to encode in heap ID */
obj_size = tparam->actual_id_len - 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14175,7 +14132,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14185,19 +14142,19 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in tiny object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert second object small enough to encode in heap ID */
obj_size = tparam->actual_id_len - 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14205,7 +14162,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14215,12 +14172,12 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in second tiny object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -14229,11 +14186,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
if(tparam->del_dir != FHEAP_DEL_HEAP) {
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14243,11 +14200,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14258,11 +14215,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
} /* end if */
else {
/* Remove second object from heap */
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14272,11 +14229,11 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14289,14 +14246,14 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -14323,7 +14280,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -14335,7 +14292,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -14362,7 +14319,6 @@ static unsigned
test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -14389,7 +14345,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Allocate heap ID(s) */
@@ -14416,7 +14372,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert first object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14424,7 +14380,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14434,26 +14390,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in first huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on first huge object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert second object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14461,7 +14417,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14471,26 +14427,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in second huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on second huge object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id2, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id2, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert third object too large for managed heap blocks */
obj_size = SMALL_STAND_SIZE + 3;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id3) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id3) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id3, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14498,7 +14454,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14508,26 +14464,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in third huge object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id3, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id3, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on third huge object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id3, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id3, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert fourth object small enough to fit into 'normal' heap blocks */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id4) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id4) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id4, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14535,7 +14491,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14552,26 +14508,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in fourth ('normal') object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id4, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id4, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id4, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id4, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on fourth ('normal') object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id4, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id4, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert fifth object small enough to fit into 'normal' heap blocks */
obj_size = (size_t)DBLOCK_SIZE(fh, 3) + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id5) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id5) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id5, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14579,7 +14535,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14597,19 +14553,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in fifth ('normal') object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id5, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id5, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id5, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id5, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on fifth ('normal') object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id5, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id5, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -14617,7 +14573,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Insert sixth object small enough to encode in heap ID */
obj_size = tparam->actual_id_len - 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id6) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id6) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id6, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14625,7 +14581,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14635,26 +14591,26 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in tiny object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id6, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id6, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on sixth ('tiny') object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id6, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id6, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Insert seventh object small enough to encode in heap ID */
obj_size = tparam->actual_id_len - 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id7) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id7) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id7, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -14662,7 +14618,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14672,19 +14628,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Read in tiny object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id7, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id7, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id7, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id7, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Check 'op' functionality on seventh ('tiny') object */
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_op(fh, dxpl, heap_id7, op_memcpy, shared_robj_g) < 0)
+ if(H5HF_op(fh, heap_id7, op_memcpy, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -14693,13 +14649,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
if(tparam->del_dir != FHEAP_DEL_HEAP) {
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove first object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14709,13 +14665,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14725,13 +14681,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove third object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14741,19 +14697,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove fourth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id4) < 0)
+ if(H5HF_remove(fh, heap_id4) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Remove fifth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id5) < 0)
+ if(H5HF_remove(fh, heap_id5) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Reset 'managed' object statistics after they are all removed */
@@ -14763,13 +14719,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
state.man_free_space = 0;
/* Remove sixth object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id6) < 0)
+ if(H5HF_remove(fh, heap_id6) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14779,22 +14735,22 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove seventh object from heap */
- if(H5HF_remove(fh, dxpl, heap_id7) < 0)
+ if(H5HF_remove(fh, heap_id7) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
} /* end if */
else {
/* Remove seventh object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id7, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id7, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id7) < 0)
+ if(H5HF_remove(fh, heap_id7) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14804,13 +14760,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove sixth object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id6, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id6, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id6) < 0)
+ if(H5HF_remove(fh, heap_id6) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14820,19 +14776,19 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove fifth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id5) < 0)
+ if(H5HF_remove(fh, heap_id5) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Remove fourth ('normal') object from heap */
- if(H5HF_remove(fh, dxpl, heap_id4) < 0)
+ if(H5HF_remove(fh, heap_id4) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Reset 'managed' object statistics after they are all removed */
@@ -14842,13 +14798,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
state.man_free_space = 0;
/* Remove third object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id3, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id3, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id3) < 0)
+ if(H5HF_remove(fh, heap_id3) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14858,13 +14814,13 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove second object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -14874,11 +14830,11 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
TEST_ERROR
/* Remove first object from heap */
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
} /* end else */
@@ -14890,14 +14846,14 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -14929,7 +14885,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -14946,7 +14902,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -14973,7 +14929,6 @@ static unsigned
test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -15001,7 +14956,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
FAIL_STACK_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Perform common test initialization operations */
@@ -15011,7 +14966,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
/* Insert object small enough to fit into direct heap block */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -15019,11 +14974,11 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -15036,7 +14991,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15044,7 +14999,7 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Check up on heap... */
@@ -15056,12 +15011,12 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
TEST_ERROR
/* Read in ('normal') object */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -15069,13 +15024,13 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
/* Delete individual objects, if we won't be deleting the entire heap later */
if(tparam->del_dir != FHEAP_DEL_HEAP) {
/* Remove object from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id) < 0)
+ if(H5HF_remove(fh, heap_id) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Check up on heap... */
@@ -15085,14 +15040,14 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
} /* end if */
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -15118,14 +15073,14 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si
H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -15149,7 +15104,6 @@ static unsigned
test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -15178,7 +15132,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Perform common test initialization operations */
@@ -15188,7 +15142,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Insert object #1, small enough to fit into direct heap block */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id1) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id1) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id1, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -15196,12 +15150,12 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Insert object #2, small enough to fit into direct heap block */
obj_size = (size_t)DBLOCK_SIZE(fh, 0) / 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, heap_id2) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, heap_id2) < 0)
FAIL_STACK_ERROR
if(H5HF_get_id_type_test(heap_id2, &obj_type) < 0)
FAIL_STACK_ERROR
@@ -15209,7 +15163,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -15222,7 +15176,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15230,7 +15184,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Check up on heap... */
@@ -15242,23 +15196,23 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Read in ('normal') object #1 */
- if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id1, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id1, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
/* Read in ('normal') object #2 */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
if(obj_size != robj_size)
TEST_ERROR
HDmemset(shared_robj_g, 0, obj_size);
- if(H5HF_read(fh, dxpl, heap_id2, shared_robj_g) < 0)
+ if(H5HF_read(fh, heap_id2, shared_robj_g) < 0)
FAIL_STACK_ERROR
if(HDmemcmp(shared_wobj_g, shared_robj_g, obj_size))
TEST_ERROR
@@ -15267,13 +15221,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
if(tparam->del_dir != FHEAP_DEL_HEAP) {
if(tparam->del_dir == FHEAP_DEL_FORWARD) {
/* Remove object #1 from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -15286,7 +15240,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15294,13 +15248,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Remove object #2 from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Check up on heap... */
@@ -15309,7 +15263,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -15322,7 +15276,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15330,7 +15284,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Check up on heap... */
@@ -15340,13 +15294,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
} /* end if */
else {
/* Remove object #2 from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id2, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id2, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id2) < 0)
+ if(H5HF_remove(fh, heap_id2) < 0)
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -15359,7 +15313,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15367,13 +15321,13 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Remove object #1 from heap */
- if(H5HF_get_obj_len(fh, dxpl, heap_id1, &robj_size) < 0)
+ if(H5HF_get_obj_len(fh, heap_id1, &robj_size) < 0)
FAIL_STACK_ERROR
- if(H5HF_remove(fh, dxpl, heap_id1) < 0)
+ if(H5HF_remove(fh, heap_id1) < 0)
FAIL_STACK_ERROR
/* Check up on heap... */
@@ -15382,7 +15336,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -15395,7 +15349,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -15403,7 +15357,7 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Check up on heap... */
@@ -15414,14 +15368,14 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
} /* end if */
/* Close the fractal heap */
- if(H5HF_close(fh, H5AC_ind_read_dxpl_id) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -15447,14 +15401,14 @@ HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_si
H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -15484,7 +15438,6 @@ static unsigned
test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -15518,7 +15471,7 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
} /* end if */
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Get information about heap ID lengths */
@@ -15559,11 +15512,11 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
obj_loc = (tmp_cparam.max_man_size + 255) - obj_size;
/* Insert object */
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Increment the amount of objects added */
@@ -15598,11 +15551,11 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
/* Delete objects inserted */
for(u = 0; u < keep_ids.num_ids; u++) {
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * u]) < 0)
+ if(H5HF_remove(fh, &keep_ids.ids[id_len * u]) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
} /* end for */
@@ -15612,14 +15565,14 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
} /* end if */
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -15648,7 +15601,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -15658,9 +15611,12 @@ error:
H5MM_xfree(keep_ids.ids);
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
+
+ if(tparam->comp == FHEAP_TEST_COMPRESS)
+ H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
if(fh)
- H5HF_close(fh, dxpl);
- H5Fclose(file);
+ H5HF_close(fh);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_random() */
@@ -15688,7 +15644,6 @@ static unsigned
test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -15722,7 +15677,7 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te
} /* end if */
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Get information about heap ID lengths */
@@ -15775,11 +15730,11 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
obj_loc = (tmp_cparam.max_man_size + 255) - obj_size;
/* Insert object */
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Increment the amount of objects added */
@@ -15814,11 +15769,11 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
/* Delete objects inserted */
for(u = 0; u < keep_ids.num_ids; u++) {
/* Remove object from heap */
- if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * u]) < 0)
+ if(H5HF_remove(fh, &keep_ids.ids[id_len * u]) < 0)
FAIL_STACK_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
} /* end for */
@@ -15828,14 +15783,14 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
} /* end if */
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
/* Check for deleting the entire heap */
if(tparam->del_dir == FHEAP_DEL_HEAP) {
/* Delete heap */
- if(H5HF_delete(f, dxpl, fh_addr) < 0)
+ if(H5HF_delete(f, fh_addr) < 0)
FAIL_STACK_ERROR
} /* end if */
@@ -15865,7 +15820,7 @@ HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -15876,8 +15831,10 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
- H5Fclose(file);
+ H5HF_close(fh);
+ if(tparam->comp == FHEAP_TEST_COMPRESS)
+ H5O_msg_reset(H5O_PLINE_ID, &tmp_cparam.pline); /* Release the I/O pipeline filter information */
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_random_pow2() */
@@ -15914,7 +15871,6 @@ static unsigned
test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -15973,7 +15929,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
} /* end if */
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, &tmp_cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Get information about heap ID lengths */
@@ -15985,16 +15941,16 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Create 'tiny' and 'huge' objects */
obj_size = id_len / 2;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, tiny_heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, tiny_heap_id) < 0)
FAIL_STACK_ERROR
obj_size = tmp_cparam.max_man_size + 1;
- if(H5HF_insert(fh, dxpl, obj_size, shared_wobj_g, huge_heap_id) < 0)
+ if(H5HF_insert(fh, obj_size, shared_wobj_g, huge_heap_id) < 0)
FAIL_STACK_ERROR
/* Verify that writing to 'huge' objects works for un-filtered heaps */
H5E_BEGIN_TRY {
- ret = H5HF_write(fh, dxpl, huge_heap_id, &id_changed, shared_wobj_g);
+ ret = H5HF_write(fh, huge_heap_id, &id_changed, shared_wobj_g);
} H5E_END_TRY;
HDassert(!id_changed);
if(tparam->comp == FHEAP_TEST_COMPRESS) {
@@ -16008,14 +15964,14 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Verify that writing to 'tiny' objects return failure (for now) */
H5E_BEGIN_TRY {
- ret = H5HF_write(fh, dxpl, tiny_heap_id, &id_changed, shared_wobj_g);
+ ret = H5HF_write(fh, tiny_heap_id, &id_changed, shared_wobj_g);
} H5E_END_TRY;
HDassert(!id_changed);
if(ret >= 0)
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -16036,7 +15992,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16044,7 +16000,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Initialize data to overwrite with */
@@ -16056,20 +16012,20 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
obj_size = 20;
for(u = 0; u < 40; u++) {
obj_loc = u;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
/* Check for closing & re-opening the heap */
- if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0)
+ if(reopen_heap(f, &fh, fh_addr, tparam) < 0)
TEST_ERROR
/* Overwrite data just written */
- if(H5HF_write(fh, dxpl, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0)
+ if(H5HF_write(fh, &keep_ids.ids[id_len * u], &id_changed, rewrite_obj) < 0)
FAIL_STACK_ERROR
HDassert(!id_changed);
/* Read data back in */
- if(H5HF_read(fh, dxpl, &keep_ids.ids[id_len * u], shared_robj_g) < 0)
+ if(H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0)
FAIL_STACK_ERROR
/* Compare data read in */
@@ -16084,7 +16040,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
} /* end for */
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -16103,7 +16059,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16111,14 +16067,14 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Verify changed objects */
obj_size = 20;
for(u = 0; u < 40; u++) {
/* Read data back in */
- if(H5HF_read(fh, dxpl, &keep_ids.ids[id_len * u], shared_robj_g) < 0)
+ if(H5HF_read(fh, &keep_ids.ids[id_len * u], shared_robj_g) < 0)
FAIL_STACK_ERROR
/* Compare data read in */
@@ -16133,7 +16089,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
} /* end for */
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -16152,7 +16108,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
H5MM_xfree(rewrite_obj);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -16163,7 +16119,7 @@ error:
H5MM_xfree(keep_ids.offs);
H5MM_xfree(rewrite_obj);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -16191,7 +16147,6 @@ static unsigned
test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
{
hid_t file = -1; /* File ID */
- hid_t dxpl = H5AC_ind_read_dxpl_id; /* DXPL to use */
char filename[FHEAP_FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5HF_t *fh = NULL; /* Fractal heap wrapper */
@@ -16212,7 +16167,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
HDmemset(&keep_ids, 0, sizeof(fheap_heap_ids_t));
/* Perform common file & heap open operations */
- if(open_heap(filename, fapl, dxpl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
+ if(open_heap(filename, fapl, cparam, tparam, &file, &f, &fh, &fh_addr, &state, &empty_size) < 0)
TEST_ERROR
/* Get information about heap ID lengths */
@@ -16224,36 +16179,36 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
/* Insert objects */
obj_size = 44;
obj_loc = 1;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
obj_size = 484;
obj_loc = 2;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
obj_size = 168;
obj_loc = 3;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
obj_size = 96;
obj_loc = 4;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
obj_size = 568;
obj_loc = 5;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
obj_size = 568;
obj_loc = 6;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -16268,7 +16223,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16276,15 +16231,15 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Remove one of the objects */
- if(H5HF_remove(fh, dxpl, &keep_ids.ids[id_len * 4]) < 0)
+ if(H5HF_remove(fh, &keep_ids.ids[id_len * 4]) < 0)
FAIL_STACK_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -16298,7 +16253,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Ignore metadata tags in the file's cache */
@@ -16306,17 +16261,17 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
FAIL_STACK_ERROR
/* Re-open the heap */
- if(NULL == (fh = H5HF_open(f, H5AC_ind_read_dxpl_id, fh_addr)))
+ if(NULL == (fh = H5HF_open(f, fh_addr)))
FAIL_STACK_ERROR
/* Insert another object */
obj_size = 208;
obj_loc = 6;
- if(add_obj(fh, dxpl, obj_loc, obj_size, NULL, &keep_ids))
+ if(add_obj(fh, obj_loc, obj_size, NULL, &keep_ids))
TEST_ERROR
/* Close the fractal heap */
- if(H5HF_close(fh, dxpl) < 0)
+ if(H5HF_close(fh) < 0)
FAIL_STACK_ERROR
fh = NULL;
@@ -16331,7 +16286,7 @@ test_bug1(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam)
H5MM_xfree(keep_ids.offs);
/* All tests passed */
- PASSED()
+ PASSED();
return(0);
@@ -16341,7 +16296,7 @@ error:
H5MM_xfree(keep_ids.lens);
H5MM_xfree(keep_ids.offs);
if(fh)
- H5HF_close(fh, dxpl);
+ H5HF_close(fh);
H5Fclose(file);
} H5E_END_TRY;
return(1);
@@ -16379,6 +16334,7 @@ main(void)
int ExpressMode; /* Express testing level */
const char *envval; /* Environment variable */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Don't run this test using certain file drivers */
envval = HDgetenv("HDF5_DRIVER");
@@ -16394,7 +16350,7 @@ main(void)
def_fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
- /*
+ /*
* Caution when turning on ExpressMode 0:
* It will activate testing with different combinations of
* page buffering and file space strategy and the
@@ -16418,6 +16374,10 @@ main(void)
init_small_cparam(&small_cparam);
init_large_cparam(&large_cparam);
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Allocate space for the shared objects */
shared_obj_size_g = large_cparam.max_man_size + 256;
shared_wobj_g = (unsigned char *)H5MM_malloc(shared_obj_size_g);
@@ -16440,12 +16400,12 @@ main(void)
for(v = 0; v < num_pb_fs; v++) {
/* Skip test when:
a) multi/split drivers and
- b) persisting free-space or using paged aggregation strategy
+ b) persisting free-space or using paged aggregation strategy
because the library will fail file creation (temporary) for the above conditions */
if(!contig_addr_vfd && v)
break;
- if((fcpl = H5Pcopy(def_fcpl)) < 0)
+ if((fcpl = H5Pcopy(def_fcpl)) < 0)
TEST_ERROR
switch(v) {
@@ -16458,6 +16418,33 @@ main(void)
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
TEST_ERROR
fapl = def_fapl;
+ /* This is a fix for the daily test failure from the checkin for libver bounds. */
+ /*
+ * Many tests failed the file size check when comparing (a) and (b) as below:
+ * --Create a file and close the file. Got the initial file size (a).
+ * --Reopen the file, perform fractal heap operations, and close the file.
+ * Got the file size (b).
+ * The cause for the file size differences:
+ * When the file is initially created with persisting free-space and with
+ * (earliest, latest) libver bounds, the file will have version 2 superblock
+ * due to non-default free-space handling. As the low bound is earliest,
+ * the library uses version 1 object header when creating the superblock
+ * extension message.
+ * When the file is reopened with the same libver bounds, the file's low
+ * bound is upgraded to v18 because the file has version 2 superblock.
+ * When the library creates the superblock extension message on file close,
+ * the library uses version 2 object header for the superblock extension
+ * message since the low bound is v18.
+ * This leads to the discrepancy in file sizes as the file is persisting
+ * free-space and there is object header version differences.
+ * The fix:
+ * Set libver bounds in fapl to (v18, latest) so that the file created in the
+ * test routines will have low bound set to v18. This will cause the
+ * library to use version 2 object header for the superblock extension
+ * message.
+ */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR
break;
case 2:
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0)
@@ -16486,7 +16473,7 @@ main(void)
}
/* Iterate over the testing parameters */
- for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) {
+ for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; curr_test++) {
/* Clear the testing parameters */
HDmemset(&tparam, 0, sizeof(fheap_test_param_t));
tparam.actual_id_len = HEAP_ID_LEN;
@@ -16528,7 +16515,7 @@ main(void)
fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */
/* Filling with different sized objects */
- for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) {
+ for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; fill++) {
tparam.fill = fill;
/* Set appropriate testing parameters for each test */
@@ -16621,9 +16608,9 @@ main(void)
fheap_test_del_drain_t drain_half; /* Deletion draining */
/* More complex removal patterns */
- for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
+ for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) {
tparam.del_dir = del_dir;
- for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) {
+ for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; drain_half++) {
tparam.drain_half = drain_half;
/* Don't need to test deletion directions when deleting entire heap */
if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL)
@@ -16731,7 +16718,7 @@ main(void)
} /* end switch */
/* Try several different methods of deleting objects */
- for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
+ for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) {
tparam.del_dir = del_dir;
/* Test 'huge' object insert & delete */
@@ -16759,7 +16746,7 @@ main(void)
{
fheap_test_del_dir_t del_dir; /* Deletion direction */
- for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
+ for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; del_dir++) {
tparam.del_dir = del_dir;
/* Controlled tests */
@@ -16853,12 +16840,12 @@ main(void)
if(H5Pclose(def_fcpl) < 0) TEST_ERROR
if(H5Pclose(pb_fapl) < 0) TEST_ERROR
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
/* Clean up file used */
-#ifndef QAK
h5_cleanup(FILENAME, def_fapl);
-#else /* QAK */
-HDfprintf(stderr, "Uncomment cleanup!\n");
-#endif /* QAK */
return 0;
@@ -16875,6 +16862,9 @@ error:
H5Pclose(def_fcpl);
H5Pclose(fcpl);
} H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */
diff --git a/test/file_image.c b/test/file_image.c
index 12f0a18..0d4873a 100644
--- a/test/file_image.c
+++ b/test/file_image.c
@@ -88,16 +88,16 @@ test_properties(void)
hid_t fapl_1 = -1;
hid_t fapl_2 = -1;
char *buffer = 0;
- int count = 10;
+ int count = 10;
void *temp = 0;
char *temp2 = 0;
- int i;
+ int i;
size_t size;
size_t temp_size;
int retval = 1;
TESTING("File image property list functions");
-
+
/* Initialize file image buffer
*
* Note: this image will not contain a valid HDF5 file, as it complicates testing
@@ -122,7 +122,7 @@ test_properties(void)
/* Set file image stuff */
if(H5Pset_file_image(fapl_1, (void *)buffer, size) < 0) FAIL_STACK_ERROR
-
+
/* Get the same */
if(H5Pget_file_image(fapl_1, (void **)&temp, &temp_size) < 0) FAIL_STACK_ERROR
@@ -137,9 +137,9 @@ test_properties(void)
/* Get values from the new fapl */
if(H5Pget_file_image(fapl_2, (void **)&temp2, &temp_size) < 0) FAIL_STACK_ERROR
-
+
/* Check that sizes are the same, and that the buffers are identical but separate */
- VERIFY(temp_size == size,"Sizes of buffers don't match");
+ VERIFY(temp_size == size,"Sizes of buffers don't match");
VERIFY(temp2 != NULL,"Recieved buffer not set");
VERIFY(temp2 != buffer, "Retrieved buffer is the same as original");
VERIFY(temp2 != temp, "Retrieved buffer is the same as previously retrieved buffer");
@@ -334,7 +334,7 @@ reset_udata(udata_t *u)
static int
test_callbacks(void)
{
- H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb,
+ H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb,
&free_cb, &udata_copy_cb, &udata_free_cb, NULL};
H5FD_file_image_callbacks_t null_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};
H5FD_file_image_callbacks_t callbacks;
@@ -388,9 +388,9 @@ test_callbacks(void)
/* Get file image callbacks */
callbacks = null_callbacks;
if(H5Pget_file_image_callbacks(fapl_1, &callbacks) < 0) FAIL_STACK_ERROR
-
+
/* Verify values */
- VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly");
+ VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly");
VERIFY(callbacks.image_memcpy == &memcpy_cb, "memcpy callback was not set or retrieved properly");
VERIFY(callbacks.image_realloc == &realloc_cb, "realloc callback was not set or retrieved properly");
VERIFY(callbacks.image_free == &free_cb, "free callback was not set or retrieved properly");
@@ -398,7 +398,7 @@ test_callbacks(void)
VERIFY(callbacks.udata_free == &udata_free_cb, "udata free callback was not set or retrieved properly");
VERIFY(callbacks.udata == udata, "udata was not set or retrieved properly");
-
+
/*
* Check callbacks in internal function without a previously set file image
*/
@@ -406,7 +406,7 @@ test_callbacks(void)
/* Copy fapl */
reset_udata(udata);
if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR
-
+
/* Verify that the property's copy callback used the correct image callbacks */
VERIFY(udata->used_callbacks == (UDATA_COPY), "Copying a fapl with no image used incorrect callbacks");
@@ -419,14 +419,14 @@ test_callbacks(void)
/* Copy again */
if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR
-
+
/* Remove property from fapl */
reset_udata(udata);
if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR
/* Verify that the property's delete callback was called using the correct image callbacks */
VERIFY(udata->used_callbacks == (UDATA_FREE), "Removing a property from a fapl with no image used incorrect callbacks");
-
+
/* Close it again */
if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR
@@ -442,15 +442,15 @@ test_callbacks(void)
if(H5Pset_file_image(fapl_1, (void *)file_image, size) < 0) FAIL_STACK_ERROR
VERIFY(udata->used_callbacks == (MALLOC | MEMCPY), "Setting a file image (first time) used incorrect callbacks");
-
+
/*
* Check callbacks in internal functions with a previously set file image
*/
-
+
/* Copy fapl */
reset_udata(udata);
if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR
-
+
/* Verify that the property's copy callback used the correct image callbacks */
VERIFY(udata->used_callbacks == (MALLOC | MEMCPY | UDATA_COPY), "Copying a fapl with an image used incorrect callbacks");
VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, "malloc callback has wrong source");
@@ -466,7 +466,7 @@ test_callbacks(void)
/* Copy again */
if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR
-
+
/* Remove property from fapl */
reset_udata(udata);
if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR
@@ -474,11 +474,11 @@ test_callbacks(void)
/* Verify that the property's delete callback was called using the correct image callbacks */
VERIFY(udata->used_callbacks == (FREE | UDATA_FREE), "Removing a property from a fapl with an image used incorrect callbacks");
VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, "free callback has wrong source");
-
+
/* Close it again */
if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR
- /* Get file image */
+ /* Get file image */
reset_udata(udata);
if(H5Pget_file_image(fapl_1, (void **)&temp_file_image, &temp_size) < 0) FAIL_STACK_ERROR
@@ -538,11 +538,11 @@ test_core(void)
int fd;
h5_stat_t sb;
herr_t ret;
- H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb,
+ H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb,
&free_cb, &udata_copy_cb, &udata_free_cb, NULL};
TESTING("Initial file image and callbacks in Core VFD");
-
+
/* Create fapl */
fapl = h5_fileaccess();
VERIFY(fapl >= 0, "fapl creation failed");
@@ -579,7 +579,8 @@ test_core(void)
reset_udata(udata);
file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl);
VERIFY(file >= 0, "H5Fopen failed");
- VERIFY(udata->used_callbacks == MALLOC, "opening a core file used the wrong callbacks");
+ VERIFY((udata->used_callbacks == MALLOC) ||
+ (udata->used_callbacks == (MALLOC | UDATA_COPY | UDATA_FREE)), "opening a core file used the wrong callbacks");
VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open");
/* Close file */
@@ -598,24 +599,24 @@ test_core(void)
dims[1] = DIM1;
space = H5Screate_simple(RANK, dims, dims);
VERIFY(space >= 0, "H5Screate failed");
-
+
/* Create new dset, invoking H5FD_core_write */
reset_udata(udata);
dset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset >=0, "H5Dcreate failed");
-
+
/* Flush the write and check the realloc callback */
ret = H5Fflush(file, H5F_SCOPE_LOCAL);
VERIFY(ret >= 0, "H5Fflush failed");
VERIFY(udata->used_callbacks == (REALLOC), "core write used the wrong callbacks");
VERIFY(udata->realloc_src == H5FD_FILE_IMAGE_OP_FILE_RESIZE, "Realloc callback came from wrong source in core write");
-
+
/* Close dset and space */
ret = H5Dclose(dset);
VERIFY(ret >= 0, "H5Dclose failed");
ret = H5Sclose(space);
VERIFY(ret >= 0, "H5Sclose failed");
-
+
/* Test file close */
reset_udata(udata);
ret = H5Fclose(file);
@@ -643,11 +644,11 @@ test_core(void)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Release resources */
- h5_clean_files(FILENAME, fapl);
+ h5_clean_files(FILENAME, fapl);
HDfree(udata);
HDfree(file_image);
HDremove(copied_filename);
-
+
PASSED();
return 0;
@@ -671,6 +672,13 @@ error:
*
******************************************************************************
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'member_file_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static int
test_get_file_image(const char * test_banner,
const int file_name_num,
@@ -710,7 +718,7 @@ test_get_file_image(const char * test_banner,
if(driver == H5FD_FAMILY)
is_family_file = TRUE;
-
+
/* setup the file name */
h5_fixname(FILENAME2[file_name_num], fapl, file_name, sizeof(file_name));
VERIFY(HDstrlen(file_name)>0, "h5_fixname failed");
@@ -733,7 +741,7 @@ test_get_file_image(const char * test_banner,
VERIFY(space_id >= 0, "H5Screate() failed");
/* Create a dataset */
- dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
+ dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset_id >=0, "H5Dcreate() failed");
@@ -742,7 +750,7 @@ test_get_file_image(const char * test_banner,
data[i] = i;
err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data);
VERIFY(err >= 0, "H5Dwrite() failed.");
-
+
/* Flush the file */
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VERIFY(err >= 0, "H5Fflush failed");
@@ -760,7 +768,7 @@ test_get_file_image(const char * test_banner,
VERIFY(bytes_read == image_size, "H5Fget_file_image(2) failed.");
/* Close dset and space */
- err = H5Dclose(dset_id);
+ err = H5Dclose(dset_id);
VERIFY(err >= 0, "H5Dclose failed");
err = H5Sclose(space_id);
VERIFY(err >= 0, "H5Sclose failed");
@@ -852,8 +860,8 @@ test_get_file_image(const char * test_banner,
file_size -= USERBLOCK_SIZE;
}
- /* with latest mods to truncate call in core file drive,
- * file size should match image size
+ /* with latest mods to truncate call in core file drive,
+ * file size should match image size
*/
VERIFY(file_size == image_size, "file size != image size.");
@@ -923,13 +931,13 @@ test_get_file_image(const char * test_banner,
h5_clean_files(FILENAME2, fapl);
/* discard the image buffer if it exists */
- if(image_ptr != NULL)
+ if(image_ptr != NULL)
HDfree(image_ptr);
/* discard the image buffer if it exists */
- if(file_image_ptr != NULL)
+ if(file_image_ptr != NULL)
HDfree(file_image_ptr);
-
+
PASSED();
return 0;
@@ -937,6 +945,7 @@ test_get_file_image(const char * test_banner,
error:
return 1;
} /* end test_get_file_image() */
+H5_GCC_DIAG_ON(format-nonliteral)
/******************************************************************************
@@ -977,10 +986,10 @@ test_get_file_image_error_rejection(void)
TESTING("H5Fget_file_image() error rejection");
/************************ Sub-Test #1 ********************************/
- /* set up a test file, and try to get its image with a buffer that is
+ /* set up a test file, and try to get its image with a buffer that is
* too small. Call to H5Fget_file_image() should fail.
*
- * Since we have already done the necessary setup, verify that
+ * Since we have already done the necessary setup, verify that
* H5Fget_file_image() will fail with:
*
* bad file id, or
@@ -1011,17 +1020,17 @@ test_get_file_image_error_rejection(void)
VERIFY(space_id >= 0, "H5Screate() failed");
/* Create a dataset */
- dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
+ dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset_id >=0, "H5Dcreate() failed");
/* write some data to the data set */
for (i = 0; i < 100; i++)
data[i] = i;
- err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *)data);
VERIFY(err >= 0, "H5Dwrite() failed.");
-
+
/* Flush the file */
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VERIFY(err >= 0, "H5Fflush failed");
@@ -1057,7 +1066,7 @@ test_get_file_image_error_rejection(void)
VERIFY(bytes_read < 0, "H5Fget_file_image(4 -- test 1) succeeded.");
/* Close dset and space */
- err = H5Dclose(dset_id);
+ err = H5Dclose(dset_id);
VERIFY(err >= 0, "H5Dclose failed");
err = H5Sclose(space_id);
VERIFY(err >= 0, "H5Sclose failed");
@@ -1070,11 +1079,11 @@ test_get_file_image_error_rejection(void)
h5_clean_files(FILENAME2, fapl_id);
/* discard the image buffer if it exists */
- if(image_ptr != NULL)
+ if(image_ptr != NULL)
HDfree(image_ptr);
/************************** Test #2 **********************************/
- /* set up a multi file driver test file, and try to get its image
+ /* set up a multi file driver test file, and try to get its image
* with H5Fget_file_image(). Attempt should fail.
*/
@@ -1121,7 +1130,7 @@ test_get_file_image_error_rejection(void)
VERIFY(fapl_id >= 0, "H5Pcreate(2) failed");
/* setup the fapl for the multi file driver */
- err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name,
+ err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name,
memb_addr, FALSE);
VERIFY(err >= 0, "H5Pset_fapl_multi failed");
@@ -1140,17 +1149,17 @@ test_get_file_image_error_rejection(void)
VERIFY(space_id >= 0, "H5Screate() failed");
/* Create a dataset */
- dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
+ dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset_id >=0, "H5Dcreate() failed");
/* write some data to the data set */
for (i = 0; i < 100; i++)
data[i] = i;
- err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *)data);
VERIFY(err >= 0, "H5Dwrite() failed.");
-
+
/* Flush the file */
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VERIFY(err >= 0, "H5Fflush failed");
@@ -1162,7 +1171,7 @@ test_get_file_image_error_rejection(void)
VERIFY(image_size == -1, "H5Fget_file_image(5) succeeded.");
/* Close dset and space */
- err = H5Dclose(dset_id);
+ err = H5Dclose(dset_id);
VERIFY(err >= 0, "H5Dclose failed");
err = H5Sclose(space_id);
VERIFY(err >= 0, "H5Sclose failed");
@@ -1175,11 +1184,11 @@ test_get_file_image_error_rejection(void)
h5_clean_files(FILENAME2, fapl_id);
/************************** Test #3 **********************************/
- /* set up a split file driver test file, and try to get its image
+ /* set up a split file driver test file, and try to get its image
* with H5Fget_file_image(). Attempt should fail.
*/
- /* create fapl */
+ /* create fapl */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
VERIFY(fapl_id >= 0, "H5Pcreate(3) failed");
@@ -1202,17 +1211,17 @@ test_get_file_image_error_rejection(void)
VERIFY(space_id >= 0, "H5Screate() failed");
/* Create a dataset */
- dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
+ dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset_id >=0, "H5Dcreate() failed");
/* write some data to the data set */
for (i = 0; i < 100; i++)
data[i] = i;
- err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *)data);
VERIFY(err >= 0, "H5Dwrite() failed.");
-
+
/* Flush the file */
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VERIFY(err >= 0, "H5Fflush failed");
@@ -1224,7 +1233,7 @@ test_get_file_image_error_rejection(void)
VERIFY(image_size == -1, "H5Fget_file_image(6) succeeded.");
/* Close dset and space */
- err = H5Dclose(dset_id);
+ err = H5Dclose(dset_id);
VERIFY(err >= 0, "H5Dclose failed");
err = H5Sclose(space_id);
VERIFY(err >= 0, "H5Sclose failed");
@@ -1237,11 +1246,11 @@ test_get_file_image_error_rejection(void)
h5_clean_files(FILENAME2, fapl_id);
/************************** Test #4 **********************************/
- /* set up a family file driver test file, and try to get its image
+ /* set up a family file driver test file, and try to get its image
* with H5Fget_file_image(). Attempt should fail.
*/
- /* create fapl */
+ /* create fapl */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
VERIFY(fapl_id >= 0, "H5Pcreate(3) failed");
@@ -1262,17 +1271,17 @@ test_get_file_image_error_rejection(void)
VERIFY(space_id >= 0, "H5Screate() failed");
/* Create a dataset */
- dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
+ dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VERIFY(dset_id >=0, "H5Dcreate() failed");
/* write some data to the data set */
for (i = 0; i < 100; i++)
data[i] = i;
- err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *)data);
VERIFY(err >= 0, "H5Dwrite() failed.");
-
+
/* Flush the file */
err = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
VERIFY(err >= 0, "H5Fflush failed");
@@ -1284,7 +1293,7 @@ test_get_file_image_error_rejection(void)
VERIFY(image_size == -1, "H5Fget_file_image(7) succeeded.");
/* Close dset and space */
- err = H5Dclose(dset_id);
+ err = H5Dclose(dset_id);
VERIFY(err >= 0, "H5Dclose failed");
err = H5Sclose(space_id);
VERIFY(err >= 0, "H5Sclose failed");
@@ -1295,7 +1304,7 @@ test_get_file_image_error_rejection(void)
/* tidy up */
h5_clean_files(FILENAME2, fapl_id);
-
+
PASSED();
return 0;
@@ -1353,14 +1362,14 @@ main(void)
} /* end for */
#if 0
- /* at present, H5Fget_file_image() rejects files opened with the
+ /* at present, H5Fget_file_image() rejects files opened with the
* family file driver, due to the addition of a driver info message
* in the super block. This message prevents the image being opened
- * with any driver other than the family file driver, which sort of
+ * with any driver other than the family file driver, which sort of
* defeats the purpose of the get file image operation.
*
* While this issues is quite fixable, we don't have time or resources
- * for this right now. Once we do, the following code should be
+ * for this right now. Once we do, the following code should be
* suitable for testing the fix.
*/
/* test H5Fget_file_image() with family file driver */
@@ -1377,10 +1386,10 @@ main(void)
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
- if(errors) {
- HDprintf("***** %d File Image TEST%s FAILED! *****\n",
- errors, errors > 1 ? "S" : "");
- return 1;
+ if(errors) {
+ HDprintf("***** %d File Image TEST%s FAILED! *****\n",
+ errors, errors > 1 ? "S" : "");
+ return 1;
}
HDprintf("All File Image tests passed.\n");
diff --git a/test/filenotclosed.c b/test/filenotclosed.c
index d1f468a..2d050eb 100644
--- a/test/filenotclosed.c
+++ b/test/filenotclosed.c
@@ -19,8 +19,8 @@
#include "h5test.h"
-#define FILENAME "filenotclosed"
-#define DATASET "dset"
+#define FILENAME "filenotclosed"
+#define DATASET_NAME "dset"
/*-------------------------------------------------------------------------
* Function: catch_signal
@@ -35,7 +35,7 @@
*/
static void catch_signal(int H5_ATTR_UNUSED signo)
{
- HDexit(1);
+ HDexit(EXIT_FAILURE);
} /* catch_signal() */
@@ -114,7 +114,7 @@ main(void)
TEST_ERROR
/* Create the dataset */
- if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, DATASET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Write to the dataset */
diff --git a/test/fill18.h5 b/test/fill18.h5
new file mode 100644
index 0000000..c092f59
--- /dev/null
+++ b/test/fill18.h5
Binary files differ
diff --git a/test/fillval.c b/test/fillval.c
index 8c8e902..72b8dcb 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,67 +710,74 @@ 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 rd_c, fill_c, should_be_c;
+ comp_datatype *buf_c=NULL;
H5D_space_status_t allocation;
- if(datatype==H5T_INTEGER)
+ fill_c.a = 0;
+ fill_c.x = 0;
+ fill_c.y = 0;
+ fill_c.z = 0;
+
+ if(datatype == H5T_INTEGER) {
fillval = *(int*)_fillval;
- else if(datatype==H5T_COMPOUND) {
- fill_c.a=((comp_datatype*)_fillval)->a;
+ }
+ else if(datatype == H5T_COMPOUND) {
+ fill_c.a=((comp_datatype*)_fillval)->a;
fill_c.x=((comp_datatype*)_fillval)->x;
fill_c.y=((comp_datatype*)_fillval)->y;
fill_c.z=((comp_datatype*)_fillval)->z;
- } else {
- puts("Invalid type for test");
+ }
+ else {
+ HDputs("Invalid type for test");
goto error;
}
@@ -786,27 +793,28 @@ 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 */
- } else if(datatype==H5T_COMPOUND) {
+ 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;
if(fill_time != H5D_FILL_TIME_NEVER && (!H5_FLT_ABS_EQUAL(rd_c.a, fill_c.a) ||
@@ -819,7 +827,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;
}
}
@@ -828,10 +836,10 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
/* Select all odd data locations in the file dataset */
for (i=0, nelmts=1; i<5; i++) {
- hs_size[i] = cur_size[i]/2;
- hs_offset[i] = 0;
- hs_stride[i] = 2;
- nelmts *= hs_size[i];
+ hs_size[i] = cur_size[i]/2;
+ hs_offset[i] = 0;
+ hs_stride[i] = 2;
+ nelmts *= hs_size[i];
}
if((mspace=H5Screate_simple(5, hs_size, hs_size)) < 0) goto error;
if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, hs_stride,
@@ -868,8 +876,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;
@@ -907,24 +915,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);
@@ -935,86 +943,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],
@@ -1023,11 +1031,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);
@@ -1042,16 +1050,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
*
@@ -1065,8 +1073,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.
*
*-------------------------------------------------------------------------
*/
@@ -1074,9 +1082,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};
@@ -1089,17 +1097,23 @@ test_rdwr(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)
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 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;
- } else if(H5D_COMPACT==layout) {
- if(H5Pset_layout(dcpl, H5D_COMPACT) < 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;
+ }
+ else if(H5D_COMPACT == layout) {
+ if(H5Pset_layout(dcpl, H5D_COMPACT) < 0)
+ goto error;
}
- if((ctype_id=create_compound_type()) < 0) goto error;
+ if((ctype_id = create_compound_type()) < 0)
+ goto error;
/* I. Test H5D_ALLOC_TIME_LATE space allocation cases */
if(H5D_COMPACT != layout) {
@@ -1145,7 +1159,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;
@@ -1202,7 +1216,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;
@@ -1212,22 +1226,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
*
*-------------------------------------------------------------------------
@@ -1246,16 +1260,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
*
*-------------------------------------------------------------------------
@@ -1284,16 +1298,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
*
*-------------------------------------------------------------------------
@@ -1304,16 +1318,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
*
*-------------------------------------------------------------------------
@@ -1339,16 +1353,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
*
*-------------------------------------------------------------------------
@@ -1380,16 +1394,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
*
*-------------------------------------------------------------------------
@@ -1406,16 +1420,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
*
*-------------------------------------------------------------------------
@@ -1424,13 +1438,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 *);
@@ -1438,12 +1452,16 @@ 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;
- comp_vl_datatype init_val_c = {87, "baz", "mumble", 129};
+ int val_rd_i, init_val_i = 9999;
+ comp_vl_datatype init_val_c = {87, NULL, NULL, 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 */
+
+ /* Set vl datatype init value strings */
+ init_val_c.a = HDstrdup("baz");
+ init_val_c.b = HDstrdup("mumble");
/* Make copy of dataset creation property list */
if((dcpl = H5Pcopy(_dcpl)) < 0) TEST_ERROR
@@ -1494,20 +1512,20 @@ 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
/* Release any VL components */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1517,10 +1535,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 */
@@ -1547,23 +1565,23 @@ 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 */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1585,26 +1603,26 @@ 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 */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1624,26 +1642,26 @@ 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 */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1665,26 +1683,26 @@ 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 */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1730,7 +1748,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if(H5Dwrite(dset, dtype, mspace, fspace, H5P_DEFAULT, fillval) < 0) TEST_ERROR
/* Release any VL components */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1749,7 +1767,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if(verify_rtn((unsigned)__LINE__, hs_offset, val_rd, fillval) < 0) TEST_ERROR
/* Release any VL components */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1758,26 +1776,26 @@ 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 */
- if(H5Dvlen_reclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
+ if(H5Treclaim(dtype, mspace, H5P_DEFAULT, val_rd) < 0) TEST_ERROR
/* Clear the read buffer */
HDmemset(val_rd, 0, val_size);
@@ -1788,8 +1806,10 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
/* Release elements & memory buffer */
for(i = 0; i < nelmts; i++)
release_rtn((void *)((char *)buf + (val_size * i)));
+
+ HDfree(init_val_c.a);
+ HDfree(init_val_c.b);
HDfree(buf);
- buf = NULL;
/* Cleanup IDs */
if(H5Pclose(dcpl) < 0) TEST_ERROR
@@ -1799,29 +1819,31 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
return 0;
error:
- if(buf)
- HDfree(buf);
+ HDfree(init_val_c.a);
+ HDfree(init_val_c.b);
+ 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:
@@ -1831,30 +1853,34 @@ 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];
+ comp_vl_datatype fillval_c = {32, NULL, NULL, 64}; /* Fill value for compound+vl datatype tests */
+ 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")
+
+ /* Set vl datatype fill value strings */
+ fillval_c.a = HDstrdup("foo");
+ fillval_c.b = HDstrdup("bar");
/* 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
/*
@@ -1868,13 +1894,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
@@ -1887,13 +1913,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
@@ -1905,9 +1931,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
@@ -1931,27 +1957,36 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Pclose(dcpl) < 0) TEST_ERROR
if(H5Fclose(file) < 0) TEST_ERROR
+ HDfree(fillval_c.a);
+ HDfree(fillval_c.b);
+
PASSED();
return 0;
error:
+ HDfree(fillval_c.a);
+ HDfree(fillval_c.b);
+
H5E_BEGIN_TRY {
H5Tclose(cmpd_vl_tid);
- H5Pclose(dcpl);
- H5Fclose(file);
+ H5Pclose(dcpl);
+ H5Fclose(file);
} H5E_END_TRY;
return 1;
skip:
+ HDfree(fillval_c.a);
+ HDfree(fillval_c.b);
+
H5E_BEGIN_TRY {
- H5Pclose(dcpl);
- H5Fclose(file);
+ H5Pclose(dcpl);
+ H5Fclose(file);
} H5E_END_TRY;
return 0;
} /* end test_extend() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compatible
*
@@ -1983,7 +2018,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;
}
@@ -1993,8 +2028,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;
}
@@ -2003,7 +2038,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;
@@ -2014,7 +2049,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;
@@ -2028,16 +2063,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;
@@ -2047,7 +2082,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;
@@ -2058,7 +2093,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;
@@ -2087,20 +2122,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.
*
*-------------------------------------------------------------------------
@@ -2109,12 +2144,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 */
@@ -2132,17 +2167,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);
@@ -2154,7 +2189,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;
@@ -2176,7 +2211,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,
@@ -2190,7 +2225,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,
@@ -2209,15 +2244,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
*
@@ -2237,9 +2272,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");
@@ -2253,86 +2288,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();
@@ -2346,29 +2381,27 @@ 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
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
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;
@@ -2380,8 +2413,8 @@ main(int argc, char *argv[])
else if(!strcmp(argv[argno], "compact"))
test_compact =1;
else {
- fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
+ HDexit(EXIT_FAILURE);
}
} /* end for */
} /* end if */
@@ -2444,15 +2477,15 @@ main(int argc, char *argv[])
if(nerrors)
goto error;
- puts("All fill value tests passed.");
+ HDputs("All fill value tests passed.");
if(h5_cleanup(FILENAME, fapl))
HDremove(FILE_NAME_RAW);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- puts("***** FILL VALUE TESTS FAILED *****");
- return 1;
+ HDputs("***** FILL VALUE TESTS FAILED *****");
+ HDexit(EXIT_FAILURE);
}
diff --git a/test/filter_fail.c b/test/filter_fail.c
index 76b3106..e5187be 100644
--- a/test/filter_fail.c
+++ b/test/filter_fail.c
@@ -50,8 +50,8 @@ const H5Z_class2_t H5Z_FAIL_TEST[1] = {{
/*-------------------------------------------------------------------------
* Function: filter_fail
*
- * Purpose: For testing library's behavior when a mandatory filter
- * fails to write a chunk.
+ * Purpose: For testing library's behavior when a mandatory filter
+ * fails to write a chunk.
*
* Return: Success: Data chunk size
* Failure: 0
@@ -74,7 +74,7 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
ret_value = nbytes;
} /* end if */
else { /* Write data */
- /* If it's the last chunk, pretend to fail. Otherwise, do nothing. */
+ /* If it's the last chunk, pretend to fail. Otherwise, do nothing. */
if(*dst == 8 || *dst == 9) {
ret_value = 0;
} else {
@@ -90,14 +90,14 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
/*-------------------------------------------------------------------------
* Function: test_filter_write_failure
*
- * Purpose: Tests the library's behavior when a mandate filter returns
+ * Purpose: Tests the library's behavior when a mandate filter returns
* failure. There're only 5 chunks with each of them having
- * 2 integers. The filter will fail in the last chunk. The
- * dataset should release all resources even though the last
+ * 2 integers. The filter will fail in the last chunk. The
+ * dataset should release all resources even though the last
* chunk can't be flushed to file. The file should close
* successfully.
*
- * Return:
+ * Return:
* Success: 0
* Failure: -1
*
@@ -107,7 +107,7 @@ filter_fail(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts,
* Modifications:
* Raymond Lu
* 5 Oct 2010
- * Test when the chunk cache is enable and disabled to make
+ * Test when the chunk cache is enable and disabled to make
* sure the library behaves properly.
*-------------------------------------------------------------------------
*/
@@ -151,7 +151,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
TEST_ERROR
/* create a dataset */
- if((dataset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dataset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Initialize the write buffer */
for(i = 0; i < DIM; i++)
@@ -160,7 +160,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
/* Write data. If the chunk cache is enabled, H5Dwrite should succeed. If it is
* diabled, H5Dwrite should fail. */
if(cache_enabled) {
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, points) < 0)
TEST_ERROR
} else {
/* Data writing should fail */
@@ -194,7 +194,7 @@ test_filter_write(char *file_name, hid_t my_fapl, hbool_t cache_enabled)
TEST_ERROR
}
- /* Even though H5Dclose or H5Dwrite fails, it should release all resources.
+ /* Even though H5Dclose or H5Dwrite fails, it should release all resources.
* So the file should close successfully. */
if(H5Fclose (file) < 0) TEST_ERROR
@@ -215,11 +215,11 @@ error:
/*-------------------------------------------------------------------------
* Function: test_filter_read
*
- * Purpose: Tests the library's behavior when a mandate filter returns
- * failure. The first 4 chunks should be in the file. The
+ * Purpose: Tests the library's behavior when a mandate filter returns
+ * failure. The first 4 chunks should be in the file. The
* last chunk should not.
*
- * Return:
+ * Return:
* Success: 0
* Failure: -1
*
@@ -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
}
}
@@ -305,20 +305,20 @@ test_filter_read(char *file_name, hid_t my_fapl)
if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, sid, H5P_DEFAULT, rbuf) < 0)
TEST_ERROR
- /* Check that the values read are the same as the values written.
+ /* Check that the values read are the same as the values written.
* The last chunk should not be in the file. */
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
}
}
@@ -344,20 +344,18 @@ error:
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Tests the library's behavior when a mandate filter returns
+ * 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/filter_plugin.c b/test/filter_plugin.c
new file mode 100644
index 0000000..9897c84
--- /dev/null
+++ b/test/filter_plugin.c
@@ -0,0 +1,1559 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+/*
+ * Purpose: Tests the plugin module (H5PL)
+ */
+
+#include "h5test.h"
+#include "H5srcdir.h"
+
+/*
+ * This file needs to access private datatypes from the H5Z and H5PL package.
+ */
+#define H5PL_FRIEND
+#include "H5PLpkg.h"
+#define H5Z_FRIEND
+#include "H5Zpkg.h"
+
+/* Filters IDs for test filter plugins */
+#define FILTER1_ID 257
+#define FILTER2_ID 258
+#define FILTER3_ID 259
+#define FILTER4_ID 260
+
+const char *FILENAME[] = {
+ "filter_plugin",
+ NULL
+};
+#define FILENAME_BUF_SIZE 1024
+
+/* Dataset names */
+#define DSET_DEFLATE_NAME "deflate dset"
+#define DSET_FILTER1_NAME "filter 1 dset"
+#define DSET_FILTER2_NAME "filter 2 dset"
+#define DSET_FILTER3_NAME "filter 3 dset"
+
+/* Array sizes used throughout the test */
+#define DSET_DIM1 100
+#define DSET_DIM2 200
+#define CHUNK_DIM1 2
+#define CHUNK_DIM2 25
+#define HYPERSLAB_OFFSET1 7
+#define HYPERSLAB_OFFSET2 30
+#define HYPERSLAB_SIZE1 4
+#define HYPERSLAB_SIZE2 50
+
+/* Global size arrays */
+const hsize_t sizes_g[2] = {DSET_DIM1, DSET_DIM2}; /* Dataset dimensions */
+const hsize_t hs_sizes_g[2] = {HYPERSLAB_SIZE1, HYPERSLAB_SIZE2}; /* Hyperslab sizes */
+const hsize_t hs_offsets_g[2] = {HYPERSLAB_OFFSET1, HYPERSLAB_OFFSET2}; /* Hyperslab offsets */
+const hsize_t chunk_sizes_g[2] = {CHUNK_DIM1, CHUNK_DIM2}; /* Chunk dimensions */
+
+/* Limit random number within 20000 */
+#define RANDOM_LIMIT 20000
+
+/* Things used in the groups + filter plugins test */
+#define N_SUBGROUPS 1000
+#define SUBGROUP_PREFIX "subgroup_"
+#define TOP_LEVEL_GROUP_NAME "top-level group"
+
+/* Global arrays in which to save data */
+int **orig_deflate_g = NULL;
+int **orig_dynlib1_g = NULL;
+int **orig_dynlib2_g = NULL;
+int **orig_dynlib4_g = NULL;
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: free_2D_array
+ *
+ * Purpose: Free up a dynamic 2D pseudo array and set the pointer to NULL
+ * Designed to be callable in error conditions so NULLs are okay
+ *
+ * Return: SUCCEED (always)
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+free_2D_array(int ***arr) {
+
+ if (arr && *arr && (*arr)[0])
+ HDfree((*arr)[0]);
+ if (arr && *arr)
+ HDfree(*arr);
+ *arr = NULL;
+
+ return SUCCEED;
+} /* end free_2D_array() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: allocate_and_init_2D_array
+ *
+ * Purpose: Initialize an array as a pseudo 2D array and copy in some
+ * initial values.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+allocate_and_init_2D_array(int ***arr, const hsize_t *sizes, int **initial_values) {
+
+ size_t r, c; /* Data rows and columns */
+ size_t i; /* Iterator */
+ size_t n_bytes; /* # of bytes to copy */
+
+ r = (size_t)sizes[0];
+ c = (size_t)sizes[1];
+
+ /* Allocate and set up pseudo-2D array */
+ if (NULL == (*arr = (int **)HDcalloc(r, sizeof(int *))))
+ TEST_ERROR;
+ if (NULL == ((*arr)[0] = (int *)HDcalloc(r * c, sizeof(int))))
+ TEST_ERROR;
+ for (i = 0; i < r; i++)
+ (*arr)[i] = (**arr + c * i);
+
+ /* Copy over the data elements */
+ if (initial_values) {
+ n_bytes = r * c * sizeof(int);
+ HDmemcpy((*arr)[0], initial_values[0], n_bytes);
+ }
+
+ return SUCCEED;
+error:
+ free_2D_array(arr);
+
+ return FAIL;
+} /* end allocate_and_init_2D_array() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: compare_2D_arrays
+ *
+ * Purpose: Compare two pseudo 2D arrays
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+compare_2D_arrays(int **dset1, int **dset2, const hsize_t *sizes, /*OUT*/ hbool_t *are_same) {
+ hsize_t i, j; /* index variables */
+
+ *are_same = TRUE;
+
+ /* Check all the array values. This could optionally emit any
+ * bad data, but it's not clear how that would help debugging.
+ */
+ for (i = 0; i < sizes[0]; i++)
+ for (j = 0; j < sizes[1]; j++)
+ if (dset1[i][j] != dset2[i][j]) {
+ *are_same = FALSE;
+ return SUCCEED;
+ }
+
+ return SUCCEED;
+
+} /* end compare_2D_arrays() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: ensure_filter_works
+ *
+ * Purpose: Tests writing entire data and partial data with filters
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+ensure_filter_works(hid_t fid, const char *name, hid_t dcpl_id)
+{
+ hid_t did = -1; /* Dataset ID */
+ hid_t dxpl_id = -1; /* Dataset xfer property list ID */
+ hid_t write_dxpl_id = -1; /* Dataset xfer property list ID for writing */
+ hid_t sid = -1; /* Dataspace ID */
+ void *tconv_buf = NULL; /* Temporary conversion buffer */
+ int **orig = NULL; /* Data written to the dataset */
+ int **read = NULL; /* Data read from the dataset */
+ size_t r, c; /* Data rows and columns */
+ size_t hs_r, hs_c, hs_offr, hs_offc; /* Hypserslab sizes and offsets */
+ size_t i, j; /* Local index variables */
+ int n = 0; /* Value written to point array */
+ hbool_t are_same; /* Output from dataset compare function */
+ int ***save_array = NULL; /* (Global) array where the final data go */
+
+ /* initialize */
+ r = (size_t)sizes_g[0];
+ c = (size_t)sizes_g[1];
+
+ /* Create the data space */
+ if ((sid = H5Screate_simple(2, sizes_g, NULL)) < 0)
+ TEST_ERROR;
+
+ /* Allocate memory for the data buffers
+ * We're using the hacky way of doing 2D arrays that uses a
+ * single data buffer but which allows normal 2D access.
+ */
+ if (allocate_and_init_2D_array(&orig, sizes_g, NULL) < 0)
+ TEST_ERROR;
+ if (allocate_and_init_2D_array(&read, sizes_g, NULL) < 0)
+ TEST_ERROR;
+
+ /* Create a small conversion buffer to test strip mining. We
+ * might as well test all we can!
+ */
+ if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ TEST_ERROR;
+ if (NULL == (tconv_buf = HDcalloc((size_t)1000, sizeof(char))))
+ TEST_ERROR;
+ if (H5Pset_buffer(dxpl_id, (size_t)1000, tconv_buf, NULL) < 0)
+ TEST_ERROR;
+ if ((write_dxpl_id = H5Pcopy(dxpl_id)) < 0)
+ TEST_ERROR;
+
+ TESTING(" filters (setup)");
+
+ /* Check if all the filters are available */
+ if (H5Pall_filters_avail(dcpl_id) != TRUE)
+ TEST_ERROR;
+
+ /* Create the dataset */
+ if ((did = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ /*----------------------------------------------------------------------
+ * STEP 1: Read uninitialized data. It should be zero.
+ *----------------------------------------------------------------------
+ */
+ TESTING(" filters (uninitialized read)");
+
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0)
+ TEST_ERROR;
+
+ /* The input buffer was calloc'd and has not been initialized yet */
+ if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0)
+ TEST_ERROR;
+ if (FALSE == are_same)
+ TEST_ERROR;
+
+ PASSED();
+
+ /*----------------------------------------------------------------------
+ * STEP 2: Test filters by setting up a chunked dataset and writing
+ * to it.
+ *----------------------------------------------------------------------
+ */
+ TESTING(" filters (write)");
+
+ n = 0;
+ for (i = 0; i < r; i++)
+ for (j = 0; j < c; j++)
+ orig[i][j] = n++;
+
+ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl_id, *orig) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ /*----------------------------------------------------------------------
+ * STEP 3: Try to read the data we just wrote.
+ *----------------------------------------------------------------------
+ */
+ TESTING(" filters (read)");
+
+ /* Read the dataset back */
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0)
+ TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0)
+ TEST_ERROR;
+ if (FALSE == are_same)
+ TEST_ERROR;
+
+ PASSED();
+
+ /*----------------------------------------------------------------------
+ * STEP 4: Write new data over the top of the old data. The new data is
+ * random thus not very compressible, and will cause the chunks to move
+ * around as they grow. We only change values for the left half of the
+ * dataset although we rewrite the whole thing.
+ *----------------------------------------------------------------------
+ */
+ TESTING(" filters (modify)");
+
+ for (i = 0; i < r; i++)
+ for (j = 0; j < c / 2; j++)
+ orig[i][j] = (int)HDrandom() % RANDOM_LIMIT;
+
+ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl_id, *orig) < 0)
+ TEST_ERROR;
+
+ /* Read the dataset back and check it */
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0)
+ TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0)
+ TEST_ERROR;
+ if (FALSE == are_same)
+ TEST_ERROR;
+
+ PASSED();
+
+ /*----------------------------------------------------------------------
+ * STEP 5: Close the dataset and then open it and read it again. This
+ * insures that the filters message is picked up properly from the
+ * object header.
+ *----------------------------------------------------------------------
+ */
+ TESTING(" filters (re-open)");
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, *read) < 0)
+ TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0)
+ TEST_ERROR;
+ if (FALSE == are_same)
+ TEST_ERROR;
+
+ PASSED();
+
+ /*----------------------------------------------------------------------
+ * STEP 6: Test partial I/O by writing to and then reading from a
+ * hyperslab of the dataset. The hyperslab does not line up on chunk
+ * boundaries (we know that case already works from above tests).
+ *----------------------------------------------------------------------
+ */
+ TESTING(" filters (partial I/O)");
+
+ hs_r = (size_t)hs_sizes_g[0];
+ hs_c = (size_t)hs_sizes_g[1];
+ hs_offr = (size_t)hs_offsets_g[0];
+ hs_offc = (size_t)hs_offsets_g[1];
+ for (i = 0; i < hs_r; i++)
+ for (j = 0; j < hs_c; j++)
+ orig[hs_offr + i][hs_offc + j] = (int)HDrandom() % RANDOM_LIMIT;
+
+ if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offsets_g, NULL, hs_sizes_g, NULL) < 0)
+ TEST_ERROR;
+
+ /* Use the "read" DXPL because partial I/O on corrupted data test
+ * needs to ignore errors during writing
+ */
+ if (H5Dwrite(did, H5T_NATIVE_INT, sid, sid, dxpl_id, *orig) < 0)
+ TEST_ERROR;
+
+ if (H5Dread(did, H5T_NATIVE_INT, sid, sid, dxpl_id, *read) < 0)
+ TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ if (compare_2D_arrays(orig, read, sizes_g, &are_same) < 0)
+ TEST_ERROR;
+ if (FALSE == are_same)
+ TEST_ERROR;
+
+ PASSED();
+
+ /* Save the data written to the file for later comparison when the file
+ * is reopened for read test.
+ */
+ if (!HDstrcmp(name, DSET_DEFLATE_NAME))
+ save_array = &orig_deflate_g;
+ else if (!HDstrcmp(name, DSET_FILTER1_NAME))
+ save_array = &orig_dynlib1_g;
+ else if (!HDstrcmp(name, DSET_FILTER2_NAME))
+ save_array = &orig_dynlib2_g;
+ else if (!HDstrcmp(name, DSET_FILTER3_NAME))
+ save_array = &orig_dynlib4_g;
+ else
+ TEST_ERROR;
+ if (allocate_and_init_2D_array(save_array, sizes_g, orig) < 0)
+ TEST_ERROR;
+
+ /* Clean up and exit */
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dxpl_id) < 0)
+ TEST_ERROR;
+ if (H5Pclose(write_dxpl_id) < 0)
+ TEST_ERROR;
+
+ free_2D_array(&orig);
+ free_2D_array(&read);
+
+ HDfree(tconv_buf);
+
+ return SUCCEED;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(dxpl_id);
+ H5Pclose(write_dxpl_id);
+ } H5E_END_TRY
+
+ /* NULLs are okay here */
+ free_2D_array(&orig);
+ free_2D_array(&read);
+
+ if (tconv_buf)
+ HDfree(tconv_buf);
+
+ return FAIL;
+} /* end ensure_filter_works() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_dataset_write_with_filters
+ *
+ * Purpose: Tests creating datasets and writing data with dynamically loaded filters
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_dataset_write_with_filters(hid_t fid)
+{
+ hid_t dcpl_id = -1; /* Dataset creation property list ID */
+ unsigned int compress_level; /* Deflate compression level */
+ unsigned int filter1_data; /* Data used by filter 1 */
+ unsigned int libver_values[4]; /* Used w/ the filter that makes HDF5 calls */
+
+ /*----------------------------------------------------------
+ * STEP 1: Test deflation by itself.
+ *----------------------------------------------------------
+ */
+ HDputs("Testing dataset writes with deflate filter");
+#ifdef H5_HAVE_FILTER_DEFLATE
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+ if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0)
+ TEST_ERROR;
+ compress_level = 6;
+ if (H5Pset_deflate(dcpl_id, compress_level) < 0)
+ TEST_ERROR;
+
+ /* Ensure the filter works */
+ if (ensure_filter_works(fid, DSET_DEFLATE_NAME, dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Clean up objects used for this test */
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+#else /* H5_HAVE_FILTER_DEFLATE */
+ SKIPPED();
+ HDputs(" Deflate filter not enabled");
+#endif /* H5_HAVE_FILTER_DEFLATE */
+
+ /*----------------------------------------------------------
+ * STEP 2: Test filter plugin 1 by itself.
+ *----------------------------------------------------------
+ */
+ HDputs(" dataset writes with filter plugin 1");
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+ if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0)
+ TEST_ERROR;
+
+ /* Set up the filter, passing in the amount the filter will add and subtract
+ * from each data element. Note that this value has an arbitrary max of 9.
+ */
+ filter1_data = 9;
+ if (H5Pset_filter(dcpl_id, FILTER1_ID, H5Z_FLAG_MANDATORY, (size_t)1, &filter1_data) < 0)
+ TEST_ERROR;
+
+ /* Ensure the filter works */
+ if (ensure_filter_works(fid, DSET_FILTER1_NAME, dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Clean up objects used for this test */
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Unregister the dynamic filter for testing purpose. The next time when this test is run for
+ * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
+ * for this filter.
+ */
+ if (H5Zunregister(FILTER1_ID) < 0)
+ TEST_ERROR;
+
+ /*----------------------------------------------------------
+ * STEP 3: Test filter plugin 2 by itself.
+ *----------------------------------------------------------
+ */
+ HDputs(" dataset writes with filter plugin 2");
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+ if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0)
+ TEST_ERROR;
+ if (H5Pset_filter(dcpl_id, FILTER2_ID, H5Z_FLAG_MANDATORY, 0, NULL) < 0)
+ TEST_ERROR;
+
+ /* Ensure the filter works */
+ if (ensure_filter_works(fid, DSET_FILTER2_NAME, dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Clean up objects used for this test */
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Unregister the dynamic filter for testing purpose. The next time when this test is run for
+ * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
+ * for this filter.
+ */
+ if (H5Zunregister(FILTER2_ID) < 0)
+ TEST_ERROR;
+
+ /*----------------------------------------------------------
+ * STEP 4: Test filter plugin 3 by itself.
+ * (This filter plugin makes HDF5 API calls)
+ *----------------------------------------------------------
+ */
+ HDputs(" dataset writes with filter plugin 3");
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+ if (H5Pset_chunk(dcpl_id, 2, chunk_sizes_g) < 0)
+ TEST_ERROR;
+
+ /* Set the add/subtract value for the filter */
+ libver_values[0] = 9;
+
+ /* Get the library bounds and add to the filter data */
+ if (H5get_libversion(&libver_values[1], &libver_values[2], &libver_values[3]) < 0)
+ TEST_ERROR;
+ if (H5Pset_filter(dcpl_id, FILTER3_ID, H5Z_FLAG_MANDATORY, (size_t)4, libver_values) < 0)
+ TEST_ERROR;
+
+ /* Ensure the filter works */
+ if (ensure_filter_works(fid, DSET_FILTER3_NAME, dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Clean up objects used for this test */
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* Unregister the dynamic filter for testing purpose. The next time when this test is run for
+ * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
+ * for this filter.
+ */
+ if (H5Zunregister(FILTER3_ID) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Pclose(dcpl_id);
+ } H5E_END_TRY
+
+ return FAIL;
+} /* end test_dataset_write_with_filters() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_read_data
+ *
+ * Purpose: Tests reading data and compares values
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_read_data(hid_t did, int *origin_data)
+{
+ int **check = NULL;
+ int *data_p = origin_data;
+ size_t i, j; /* Local index variables */
+
+ if (allocate_and_init_2D_array(&check, sizes_g, NULL) < 0)
+ TEST_ERROR;
+
+ /* Read the dataset back */
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, *check) < 0)
+ TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < sizes_g[0]; i++)
+ for(j = 0; j < sizes_g[1]; j++) {
+ if(*data_p != check[i][j])
+ TEST_ERROR
+ data_p++;
+ }
+
+ free_2D_array(&check);
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ free_2D_array(&check);
+
+ return FAIL;
+} /* end test_read_data() */
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_dataset_read_with_filters
+ *
+ * Purpose: Tests reading datasets created with dynamically-loaded
+ * filter plugins.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_dataset_read_with_filters(hid_t fid)
+{
+ hid_t did = -1; /* Dataset ID */
+
+ /*----------------------------------------------------------
+ * STEP 1: Test deflation by itself.
+ *----------------------------------------------------------
+ */
+ TESTING("dataset read I/O with deflate filter");
+
+#ifdef H5_HAVE_FILTER_DEFLATE
+ if (H5Zfilter_avail(H5Z_FILTER_DEFLATE) != TRUE)
+ TEST_ERROR;
+
+ if ((did = H5Dopen2(fid, DSET_DEFLATE_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (test_read_data(did, orig_deflate_g[0]) < 0)
+ TEST_ERROR;
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+
+#else /* H5_HAVE_FILTER_DEFLATE */
+ SKIPPED();
+ HDputs(" Deflate filter not enabled");
+#endif /* H5_HAVE_FILTER_DEFLATE */
+
+ /*----------------------------------------------------------
+ * STEP 2: Test filter plugin 1 by itself.
+ *----------------------------------------------------------
+ */
+ TESTING(" dataset reads with filter plugin 1");
+
+ if ((did = H5Dopen2(fid, DSET_FILTER1_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (test_read_data(did, orig_dynlib1_g[0]) < 0)
+ TEST_ERROR;
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+
+ /*----------------------------------------------------------
+ * STEP 3: Test filter plugin 2 by itself.
+ *----------------------------------------------------------
+ */
+ TESTING(" dataset reads with filter plugin 2");
+
+ if ((did = H5Dopen2(fid, DSET_FILTER2_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (test_read_data(did, orig_dynlib2_g[0]) < 0)
+ TEST_ERROR;
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+
+ /*----------------------------------------------------------
+ * STEP 4: Test filter plugin 3 by itself.
+ *----------------------------------------------------------
+ */
+ TESTING(" dataset reads with filter plugin 3");
+
+ if ((did = H5Dopen2(fid, DSET_FILTER3_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (test_read_data(did, orig_dynlib4_g[0]) < 0)
+ TEST_ERROR;
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ } H5E_END_TRY
+
+ return FAIL;
+} /* end test_dataset_read_with_filters() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: ensure_data_read_fails
+ *
+ * Purpose: Tests not reading data
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+ensure_data_read_fails(hid_t did)
+{
+ int **check = NULL;
+ herr_t ret = FAIL;
+
+ if (allocate_and_init_2D_array(&check, sizes_g, NULL) < 0)
+ TEST_ERROR;
+
+ /* Read the dataset back (should fail) */
+ H5E_BEGIN_TRY {
+ ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, *check);
+ } H5E_END_TRY
+ if(ret >= 0)
+ TEST_ERROR;
+
+ free_2D_array(&check);
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ free_2D_array(&check);
+ return FAIL;
+} /* end ensure_data_read_fails() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_no_read_when_plugins_disabled
+ *
+ * Purpose: Ensures we can't read data from a dataset that requires a
+ * filter located in a plugin.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_no_read_when_plugins_disabled(hid_t fid)
+{
+ hid_t did = -1; /* Dataset ID */
+ unsigned plugin_flags; /* Plugin access flags */
+
+ TESTING("filter plugin 1 with filter plugins disabled");
+
+ /* Get the existing plugin flags */
+ if (H5PLget_loading_state(&plugin_flags) < 0)
+ TEST_ERROR;
+
+ /* Disable filter plugins and use the new flags */
+ plugin_flags &= (unsigned)(~H5PL_FILTER_PLUGIN);
+ if (H5PLset_loading_state(plugin_flags) < 0)
+ TEST_ERROR;
+
+ /* Open a dataset that requires a filter plugin to read the data */
+ if ((did = H5Dopen2(fid, DSET_FILTER1_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Make sure we can't read the data */
+ if (ensure_data_read_fails(did) < 0)
+ TEST_ERROR;
+
+ /* Close down */
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+
+ /* Re-enable filter plugins */
+ plugin_flags |= (unsigned)H5PL_FILTER_PLUGIN;
+ if (H5PLset_loading_state(plugin_flags) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ plugin_flags |= (unsigned)H5PL_FILTER_PLUGIN;
+ H5PLset_loading_state(plugin_flags);
+ H5Dclose(did);
+ } H5E_END_TRY
+
+ return FAIL;
+} /* end test_no_read_when_plugins_disabled() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_creating_groups_using_plugins
+ *
+ * Purpose: Tests creating group with dynamically loaded filters
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_creating_groups_using_plugins(hid_t fid)
+{
+ hid_t gcpl_id = -1;
+ hid_t gid = -1;
+ hid_t sub_gid = -1;
+ int i;
+ char subgroup_name[256];
+
+ TESTING("creating groups with filter plugin 4");
+
+ if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ TEST_ERROR;
+
+ /* Use a filter plugin for creating groups */
+ if (H5Pset_filter(gcpl_id, FILTER4_ID, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0)
+ TEST_ERROR;
+
+ /* Create a group using this filter */
+ if ((gid = H5Gcreate2(fid, TOP_LEVEL_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create multiple groups under the top-level group */
+ for (i = 0; i < N_SUBGROUPS; i++) {
+ char *sp = subgroup_name;
+
+ sp += HDsprintf(subgroup_name, SUBGROUP_PREFIX);
+ HDsprintf(sp, "%d", i);
+
+ if ((sub_gid = H5Gcreate2(gid, subgroup_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if (H5Gclose(sub_gid) < 0)
+ TEST_ERROR;
+ }
+
+ /* Close everything */
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+ if (H5Pclose(gcpl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Gclose(sub_gid);
+ H5Gclose(gid);
+ H5Pclose(gcpl_id);
+ } H5E_END_TRY
+
+ return FAIL;
+} /* end test_creating_groups_using_plugins() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_opening_groups_using_plugins
+ *
+ * Purpose: Tests opening group with dynamically loaded filters
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_opening_groups_using_plugins(hid_t fid)
+{
+ hid_t gid = -1;
+ hid_t sub_gid = -1;
+ int i;
+ char subgroup_name[256];
+
+ TESTING("opening groups with filter plugin 4");
+
+ /* Open the top group */
+ if ((gid = H5Gopen2(fid, TOP_LEVEL_GROUP_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Open all the sub-groups under the top-level group */
+ for (i = 0; i < N_SUBGROUPS; i++) {
+ char *sp = subgroup_name;
+
+ sp += HDsprintf(subgroup_name, SUBGROUP_PREFIX);
+ HDsprintf(sp, "%d", i);
+
+ if ((sub_gid = H5Gopen2(gid, subgroup_name, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if (H5Gclose(sub_gid) < 0)
+ TEST_ERROR;
+ }
+
+ /* Close the top-level group */
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Gclose(gid);
+ H5Gclose(sub_gid);
+ } H5E_END_TRY
+
+ return FAIL;
+} /* end test_opening_groups_using_plugins() */
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_path_api_calls
+ *
+ * Purpose: Tests the H5PL API calls that manipulate the plugin search
+ * paths.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_path_api_calls(void)
+{
+ unsigned int n_starting_paths;
+ unsigned int u;
+ unsigned int n_paths;
+ herr_t ret;
+ ssize_t path_len = -1;
+ char path[256];
+ char temp_name[256];
+
+ HDputs("Testing access to the filter path table");
+
+ if (H5Zfilter_avail(FILTER1_ID) != TRUE)
+ TEST_ERROR;
+
+ /* Set the number of paths to create for this test.
+ *
+ * This should be set high enough to ensure that at least one array
+ * expansion will take place. See H5PLpath.c for details.
+ */
+ n_starting_paths = 42;
+
+ /* Check that initialization is correct */
+ TESTING(" initialize");
+
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths != 2)
+ TEST_ERROR;
+
+ PASSED();
+
+ /****************/
+ /* H5PLremove() */
+ /****************/
+
+ /* Remove all the current paths */
+ TESTING(" remove");
+
+ /* Get the current size */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+
+ /* Remove all existing paths */
+ for (u = n_paths; u > 0; u--)
+ if (H5PLremove(u-1) < 0) {
+ HDfprintf(stderr," at %u: %s\n", u, path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table is empty */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths > 0)
+ TEST_ERROR;
+
+ PASSED();
+
+
+ TESTING(" remove (index 0 in empty table)");
+
+ /* Try to remove index zero in an empty list (SHOULD FAIL) */
+ H5E_BEGIN_TRY {
+ ret = H5PLremove(0);
+ } H5E_END_TRY
+ if (ret >= 0)
+ TEST_ERROR;
+
+ PASSED();
+
+
+ /****************/
+ /* H5PLappend() */
+ /****************/
+
+ TESTING(" append");
+
+ /* Add a bunch of paths to the path table */
+ for (u = 0; u < n_starting_paths; u++) {
+ HDsprintf(path, "a_path_%u", u);
+ if (H5PLappend(path) < 0) {
+ HDfprintf(stderr," at %u: %s\n", u, path);
+ TEST_ERROR;
+ }
+ }
+
+ PASSED();
+
+
+ /**********************/
+ /* H5PLremove() again */
+ /**********************/
+
+ TESTING(" remove (index too high)");
+
+ /* Try to remove a path where the index is beyond the table capacity (SHOULD FAIL) */
+ H5E_BEGIN_TRY {
+ ret = H5PLremove(n_starting_paths);
+ } H5E_END_TRY
+
+ if (ret >= 0)
+ TEST_ERROR
+
+ PASSED();
+
+
+ /*************/
+ /* H5PLget() */
+ /*************/
+
+ TESTING(" get (path name)");
+
+ /* Get the path length by passing in NULL */
+ if ((path_len = H5PLget(0, NULL, 0)) <= 0) {
+ HDfprintf(stderr," get path 0 length failed\n");
+ TEST_ERROR;
+ }
+ if (path_len != 8)
+ TEST_ERROR;
+
+ /* Get the path */
+ if ((path_len = H5PLget(0, path, 256)) <= 0) {
+ HDfprintf(stderr," get 0 len: %u : %s\n", path_len, path);
+ TEST_ERROR;
+ }
+ if (HDstrcmp(path, "a_path_0") != 0) {
+ HDfprintf(stderr," get 0: %s\n", path);
+ TEST_ERROR;
+ }
+
+ PASSED();
+
+
+ TESTING(" get (high and low indices)");
+
+ /* Get path at index 1 */
+ if ((path_len = H5PLget(1, path, 256)) <= 0)
+ TEST_ERROR;
+ if (HDstrcmp(path, "a_path_1") != 0) {
+ HDfprintf(stderr," get 1: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Get path at the last index */
+ if ((path_len = H5PLget(n_starting_paths - 1, path, 256)) <= 0)
+ TEST_ERROR;
+ HDsprintf(temp_name, "a_path_%u", n_starting_paths - 1);
+ if (HDstrcmp(path, temp_name) != 0) {
+ HDfprintf(stderr," get %u: %s\n", n_starting_paths - 1, path);
+ TEST_ERROR;
+ }
+
+ PASSED();
+
+
+ TESTING(" get (index too high)");
+
+ /* Get path at the last + 1 index (SHOULD FAIL) */
+ H5E_BEGIN_TRY {
+ path_len = H5PLget(n_starting_paths, NULL, 0);
+ } H5E_END_TRY
+ if (path_len > 0)
+ TEST_ERROR;
+
+ PASSED();
+
+
+ /*****************/
+ /* H5PLprepend() */
+ /*****************/
+
+ /* We'll remove a path at an arbitrary index and then
+ * prepend a new path.
+ */
+
+ TESTING(" remove (arbitrary index 1)");
+
+ /* Remove one path */
+ if (H5PLremove(8) < 0)
+ TEST_ERROR;
+
+ /* Verify that the entries were moved */
+ if ((path_len = H5PLget(8, path, 256)) <= 0)
+ TEST_ERROR;
+ if (HDstrcmp(path, "a_path_9") != 0) {
+ HDfprintf(stderr," get 8: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table shrank */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths != n_starting_paths - 1)
+ TEST_ERROR;
+
+ PASSED();
+
+
+ TESTING(" prepend");
+
+ /* Prepend one path */
+ HDsprintf(path, "a_path_%d", n_starting_paths + 1);
+ if (H5PLprepend(path) < 0) {
+ HDfprintf(stderr," prepend %u: %s\n", n_starting_paths + 1, path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table increased */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths != n_starting_paths)
+ TEST_ERROR;
+
+ /* Verify that the entries were moved */
+ if (H5PLget(8, path, 256) <= 0)
+ TEST_ERROR;
+ if (HDstrcmp(path, "a_path_7") != 0) {
+ HDfprintf(stderr," get 8: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Verify that the path was inserted at index zero */
+ if (H5PLget(0, path, 256) <= 0)
+ TEST_ERROR;
+ HDsprintf(temp_name, "a_path_%d", n_starting_paths + 1);
+ if (HDstrcmp(path, temp_name) != 0) {
+ HDfprintf(stderr," get 0: %s\n", path);
+ TEST_ERROR;
+ }
+
+ PASSED();
+
+
+ /*****************/
+ /* H5PLreplace() */
+ /*****************/
+
+ TESTING(" replace");
+
+ /* Replace one path at index 1 */
+ HDsprintf(path, "a_path_%u", n_starting_paths + 4);
+ if (H5PLreplace(path, 1) < 0) {
+ HDfprintf(stderr," replace 1: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table size remained the same */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths != n_starting_paths)
+ TEST_ERROR;
+
+ /* Verify that the entries were not moved by
+ * inspecting the paths at indices +/- 1.
+ */
+
+ /* Check path at index 0 */
+ if (H5PLget(0, path, 256) <= 0)
+ TEST_ERROR;
+ HDsprintf(temp_name, "a_path_%u", n_starting_paths + 1);
+ if (HDstrcmp(path, temp_name) != 0) {
+ HDfprintf(stderr," get 0: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Check path at index 2 */
+ if (H5PLget(2, path, 256) <= 0)
+ TEST_ERROR;
+ if (HDstrcmp(path, "a_path_1") != 0) {
+ HDfprintf(stderr," get 2: %s\n", path);
+ TEST_ERROR;
+ }
+
+ PASSED();
+
+
+ /****************/
+ /* H5PLinsert() */
+ /****************/
+
+ /* We'll remove a path at an arbitrary index and then
+ * insert a new path.
+ */
+
+ TESTING(" remove (arbitrary index 2)");
+
+ /* Remove one path */
+ if (H5PLremove(4) < 0)
+ TEST_ERROR;
+
+ /* Verify that the entries were moved */
+ if (H5PLget(4, path, 256) <= 0)
+ TEST_ERROR;
+ if (HDstrcmp(path, "a_path_4") != 0) {
+ HDfprintf(stderr," get 4: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table size */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths != n_starting_paths - 1)
+ TEST_ERROR;
+ PASSED();
+
+
+ TESTING(" insert");
+
+ /* Insert one path at index 3*/
+ HDsprintf(path, "a_path_%d", n_starting_paths + 5);
+ if (H5PLinsert(path, 3) < 0) {
+ HDfprintf(stderr," insert 3: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Verify that the entries were moved */
+ if (H5PLget(4, path, 256) <= 0)
+ TEST_ERROR;
+ if (HDstrcmp(path, "a_path_2") != 0) {
+ HDfprintf(stderr," get 4: %s\n", path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table size increased */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths != n_starting_paths)
+ TEST_ERROR;
+
+ PASSED();
+
+
+ /****************/
+ /* H5PLremove() */
+ /****************/
+
+ /* Remove all the current paths */
+ TESTING(" remove (all)");
+
+ /* Get the current size */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+
+ /* Remove all existing paths */
+ for (u = n_paths; u > 0; u--)
+ if (H5PLremove(u-1) < 0) {
+ HDfprintf(stderr," at %u: %s\n", u, path);
+ TEST_ERROR;
+ }
+
+ /* Verify the table is empty */
+ if (H5PLsize(&n_paths) < 0)
+ TEST_ERROR;
+ if (n_paths > 0)
+ TEST_ERROR;
+
+ PASSED();
+
+
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end test_path_api_calls() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: disable_chunk_cache
+ *
+ * Purpose: Turns the chunk cache off
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+disable_chunk_cache(hid_t fapl_id) {
+ int mdc_nelmts;
+ size_t rdcc_nelmts;
+ size_t rdcc_nbytes;
+ double rdcc_w0;
+
+ if (H5Pget_cache(fapl_id, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0)
+ TEST_ERROR;
+ rdcc_nbytes = 0;
+ if (H5Pset_cache(fapl_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+error:
+ return FAIL;
+} /* end disable_chunk_cache() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests the plugin module (H5PL)
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ char filename[FILENAME_BUF_SIZE];
+ hid_t fid = -1;
+ hid_t old_ff_fapl_id = -1;
+ hid_t new_ff_fapl_id = -1;
+ unsigned new_format;
+ int nerrors = 0;
+
+ /*******************************************************************/
+ /* ENSURE THAT WRITING TO DATASETS AND CREATING GROUPS WORKS */
+ /*******************************************************************/
+ /* Test with old & new format groups */
+ for (new_format = FALSE; new_format <= TRUE; new_format++) {
+ hid_t my_fapl_id;
+
+ /* Testing setup */
+ h5_reset();
+
+ /* Get a VFD-dependent filename */
+ if ((old_ff_fapl_id = h5_fileaccess()) < 0)
+ TEST_ERROR;
+
+ /* Turn off the chunk cache, so all the chunks are immediately written to disk */
+ if (disable_chunk_cache(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+
+ /* Fix up the filename for the VFD */
+ h5_fixname(FILENAME[0], old_ff_fapl_id, filename, sizeof(filename));
+
+ /* Set the FAPL for the type of format */
+ if (new_format) {
+ HDputs("\nTesting with new file format:");
+ /* Copy the file access property list and set the latest file format on it */
+ if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ my_fapl_id = new_ff_fapl_id;
+ }
+ else {
+ HDputs("Testing with old file format:");
+ my_fapl_id = old_ff_fapl_id;
+ }
+
+ /* Create the file for this test */
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* Test creating datasets and writing to them using plugin filters */
+ nerrors += (test_dataset_write_with_filters(fid) < 0 ? 1 : 0);
+
+ /* Test creating groups using dynamically-loaded plugin filters */
+ nerrors += (test_creating_groups_using_plugins(fid) < 0 ? 1 : 0);
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* Close FAPLs */
+ if (H5Pclose(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+ if (new_format) {
+ if (H5Pclose(new_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
+
+ /* Restore the default error handler (set in h5_reset()) */
+ h5_restore_err();
+
+ /*******************************************************************/
+ /* ENSURE THAT READING FROM DATASETS AND OPENING GROUPS WORKS */
+ /*******************************************************************/
+
+ HDputs("\nTesting reading data with with dynamic plugin filters:");
+
+ /* Close the library so that all loaded plugin libraries are unloaded */
+ h5_reset();
+ if ((old_ff_fapl_id = h5_fileaccess()) < 0)
+ TEST_ERROR;
+
+ /* Set the FAPL for the type of format */
+ if (new_format) {
+ /* Copy the file access property list and set the latest file format on it */
+ if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ my_fapl_id = new_ff_fapl_id;
+ }
+ else
+ my_fapl_id = old_ff_fapl_id;
+
+ /* Reopen the file for testing data reading */
+ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* Read the data with filters */
+ nerrors += (test_dataset_read_with_filters(fid) < 0 ? 1 : 0);
+
+ /* Test creating groups using dynamically-loaded plugin filters */
+ nerrors += (test_opening_groups_using_plugins(fid) < 0 ? 1 : 0);
+
+ /* Close FAPLs */
+ if (H5Pclose(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+ if (new_format) {
+ if (H5Pclose(new_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
+
+ /* Restore the default error handler (set in h5_reset()) */
+ h5_restore_err();
+
+ /*******************************************************************/
+ /* ENSURE THAT DISABLING FILTER PLUGINS VIA THE FILTER FLAGS WORKS */
+ /*******************************************************************/
+
+ /* Close the library so that all loaded plugin libraries are unloaded */
+ h5_reset();
+ if ((old_ff_fapl_id = h5_fileaccess()) < 0)
+ TEST_ERROR;
+
+ /* Set the FAPL for the type of format */
+ if (new_format) {
+ /* Copy the file access property list and set the latest file format on it */
+ if ((new_ff_fapl_id = H5Pcopy(old_ff_fapl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pset_libver_bounds(new_ff_fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ my_fapl_id = new_ff_fapl_id;
+ }
+ else
+ my_fapl_id = old_ff_fapl_id;
+
+ /* Reopen the file for testing data reading */
+ if ((fid = H5Fopen(filename, H5F_ACC_RDONLY, my_fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* When filters are disabled, make sure we can't read data from a
+ * dataset that requires a filter plugin.
+ */
+ nerrors += (test_no_read_when_plugins_disabled(fid) < 0 ? 1 : 0);
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /*********************/
+ /* CLEAN UP */
+ /*********************/
+ /* Close FAPLs */
+ if (new_format) {
+ if (H5Pclose(new_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
+ else {
+ /* Restore the default error handler (set in h5_reset()) */
+ h5_restore_err();
+
+ if (H5Pclose(old_ff_fapl_id) < 0)
+ TEST_ERROR;
+ }
+
+ /* Free up saved arrays */
+ free_2D_array(&orig_deflate_g);
+ free_2D_array(&orig_dynlib1_g);
+ free_2D_array(&orig_dynlib2_g);
+ free_2D_array(&orig_dynlib4_g);
+ } /* end for */
+
+ h5_cleanup(FILENAME, old_ff_fapl_id);
+
+ /************************************/
+ /* TEST THE FILTER PLUGIN API CALLS */
+ /************************************/
+
+ /* Test the APIs for access to the filter plugin path table */
+ nerrors += (test_path_api_calls() < 0 ? 1 : 0);
+
+ if (nerrors)
+ TEST_ERROR;
+
+ HDprintf("All plugin tests passed.\n");
+
+ HDexit(EXIT_SUCCESS);
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Pclose(old_ff_fapl_id);
+ H5Pclose(new_ff_fapl_id);
+ } H5E_END_TRY
+
+ /* Free up saved arrays (NULLs okay) */
+ free_2D_array(&orig_deflate_g);
+ free_2D_array(&orig_dynlib1_g);
+ free_2D_array(&orig_dynlib2_g);
+ free_2D_array(&orig_dynlib4_g);
+
+ nerrors = MAX(1, nerrors);
+ HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
+
diff --git a/test/filter_plugin1_dsets.c b/test/filter_plugin1_dsets.c
new file mode 100644
index 0000000..a9a53ae
--- /dev/null
+++ b/test/filter_plugin1_dsets.c
@@ -0,0 +1,93 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Test dataset filter plugin for the filter_pluging.c test.
+ */
+
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "H5PLextern.h"
+
+#define FILTER1_ID 257
+
+static size_t add_sub_value(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* Filter class struct */
+const H5Z_class2_t FILTER_INFO[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER1_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 1", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)add_sub_value, /* The actual filter function */
+}};
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
+const void *H5PLget_plugin_info(void) {return FILTER_INFO;}
+
+
+/*-------------------------------------------------------------------------
+ * Function: add_sub_value
+ *
+ * Purpose: On write:
+ * Adds a caller-supplied value to the element
+ * On read:
+ * Subtracts a caller-supplied value from the element
+ *
+ * Return: Success: Data chunk size in bytes
+ * Failure: 0
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+add_sub_value(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values,
+ size_t nbytes, size_t *buf_size, void **buf)
+{
+ int *int_ptr = (int *)*buf; /* Pointer to the data values */
+ size_t buf_left = *buf_size; /* Amount of data buffer left to process */
+ int value = 0; /* Data value to add/subtract */
+
+ /* Check for the correct number of parameters */
+ if (0 == cd_nelmts)
+ return 0;
+
+ /* Check that permanent parameters are set correctly */
+ if (cd_values[0] > 9)
+ return 0;
+
+ value = (int)cd_values[0];
+
+ if (flags & H5Z_FLAG_REVERSE) {
+ /* READ - Substract the given value from all the data values */
+ while (buf_left > 0) {
+ *int_ptr++ -= value;
+ buf_left -= sizeof(int);
+ }
+ }
+ else {
+ /* WRITE - Add the given value to all the data values */
+ while (buf_left > 0) {
+ *int_ptr++ += value;
+ buf_left -= sizeof(int);
+ }
+ }
+
+ return nbytes;
+
+} /* end add_sub_value() */
+
diff --git a/test/filter_plugin2_dsets.c b/test/filter_plugin2_dsets.c
new file mode 100644
index 0000000..6a79148
--- /dev/null
+++ b/test/filter_plugin2_dsets.c
@@ -0,0 +1,88 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Test dataset filter plugin for the filter_pluging.c test.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "H5PLextern.h"
+
+#define FILTER2_ID 258
+#define MULTIPLIER 3
+
+static size_t mult_div_value(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* Filter class struct */
+const H5Z_class2_t FILTER_INFO[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER2_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 2", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)mult_div_value, /* The actual filter function */
+}};
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
+const void *H5PLget_plugin_info(void) {return FILTER_INFO;}
+
+
+/*-------------------------------------------------------------------------
+ * Function: mult_div_value
+ *
+ * Purpose: On write:
+ * Multiplies an element by a constant value.
+ * On read:
+ * Divides an element by a constant value.
+ *
+ * Return: Success: Data chunk size in bytes
+ * Failure: 0
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+mult_div_value(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf)
+{
+ int *int_ptr = (int *)*buf; /* Pointer to the data values */
+ size_t buf_left = *buf_size; /* Amount of data buffer left to process */
+
+ /* Check for the correct number of parameters */
+ if (cd_nelmts > 0)
+ return 0;
+
+ /* Assignment to eliminate unused parameter warning */
+ cd_values = cd_values;
+
+ if (flags & H5Z_FLAG_REVERSE) {
+ /* READ - Divide the original value by MULTIPLIER */
+ while (buf_left > 0) {
+ *int_ptr++ /= MULTIPLIER;
+ buf_left -= sizeof(int);
+ }
+ }
+ else {
+ /* WRITE - Multiply the original value by MULTIPLIER */
+ while (buf_left > 0) {
+ *int_ptr++ *= MULTIPLIER;
+ buf_left -= sizeof(int);
+ }
+ }
+
+ return nbytes;
+} /* end mult_div_value() */
+
diff --git a/test/filter_plugin3_dsets.c b/test/filter_plugin3_dsets.c
new file mode 100644
index 0000000..b43020f
--- /dev/null
+++ b/test/filter_plugin3_dsets.c
@@ -0,0 +1,119 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Test dataset filter plugin for the filter_pluging.c test.
+ * This filter makes an HDF5 API call to ensure that works correctly.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "H5PLextern.h"
+
+#define FILTER3_ID 259
+
+#define PUSH_ERR(func, minor, str) H5Epush2(H5E_DEFAULT, __FILE__, func, __LINE__, H5E_ERR_CLS, H5E_PLUGIN, minor, str)
+
+static size_t add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* Filter class struct */
+const H5Z_class2_t FILTER_INFO[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER3_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 3", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)add_sub_value_hdf5, /* The actual filter function */
+}};
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
+const void *H5PLget_plugin_info(void) {return FILTER_INFO;}
+
+
+/*-------------------------------------------------------------------------
+ * Function: add_sub_value_hdf5
+ *
+ * Purpose: On write:
+ * Adds a caller-supplied value to the element
+ * On read:
+ * Subtracts a caller-supplied value from the element
+ *
+ * NOTE: This filter is identical to filter #1 only it makes
+ * an HDF5 library call to ensure doing that doesn't
+ * cause problems.
+ *
+ * Return: Success: Data chunk size in bytes
+ * Failure: 0
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+add_sub_value_hdf5(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values,
+ size_t nbytes, size_t *buf_size, void **buf)
+{
+ int *int_ptr = (int *)*buf; /* Pointer to the data values */
+ size_t buf_left = *buf_size; /* Amount of data buffer left to process */
+ int value = 0; /* Data value to add/subtract */
+ unsigned majnum = 0; /* Output data from the HDF5 library call */
+ unsigned minnum = 0;
+ unsigned relnum = 0;
+
+ /* Check for the library version.
+ * We don't do anything with this information - it's just to ensure that
+ * HDF5 library calls work properly from inside filter plugins.
+ */
+ if (H5get_libversion(&majnum, &minnum, &relnum) < 0) {
+ PUSH_ERR("filter plugin 3", H5E_CALLBACK, "H5get_libversion");
+ return 0;
+ }
+
+ /* Check for the correct number of parameters */
+ if (cd_nelmts == 0)
+ return 0;
+
+ /* Check that permanent parameters are set correctly */
+ if (cd_values[0] > 9)
+ return 0;
+
+ /* Ensure that the version numbers match what was passed in.
+ * Again, this is trivial work, just to ensure that the library calls are
+ * working properly.
+ */
+ if (majnum != cd_values[1] || minnum != cd_values[2]) {
+ PUSH_ERR("filter plugin 3", H5E_CALLBACK, "library versions do not match");
+ return 0;
+ }
+
+ value = (int)cd_values[0];
+
+ if (flags & H5Z_FLAG_REVERSE) {
+ /* READ - Substract the given value from all the data values */
+ while (buf_left > 0) {
+ *int_ptr++ -= value;
+ buf_left -= sizeof(int);
+ }
+ }
+ else {
+ /* WRITE - Add the given value to all the data values */
+ while (buf_left > 0) {
+ *int_ptr++ += value;
+ buf_left -= sizeof(int);
+ }
+ }
+
+ return nbytes;
+} /* end add_sub_value_hdf5() */
+
diff --git a/test/filter_plugin4_groups.c b/test/filter_plugin4_groups.c
new file mode 100644
index 0000000..88ea20d
--- /dev/null
+++ b/test/filter_plugin4_groups.c
@@ -0,0 +1,106 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Test group filter plugin for the filter_pluging.c test.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "H5PLextern.h"
+
+#define FILTER4_ID 260
+#define SUFFIX_LEN 8
+#define GROUP_SUFFIX ".h5group"
+
+static size_t append_to_group_name(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
+
+/* Filter class struct */
+const H5Z_class2_t FILTER_INFO[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER4_ID, /* Filter ID number */
+ 1, /* Encoding enabled */
+ 1, /* Decoding enabled */
+ "test filter plugin 4", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ (H5Z_func_t)append_to_group_name, /* The actual filter function */
+}};
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_FILTER;}
+const void *H5PLget_plugin_info(void) {return FILTER_INFO;}
+
+
+/*-------------------------------------------------------------------------
+ * Function: append_to_group_name
+ *
+ * Purpose: On write:
+ * Appends the suffix ".h5group" to the group name
+ * On read:
+ * Removes the ".h5group" suffix from the group name
+ *
+ * Return: Success: Data size in bytes
+ * Failure: 0
+ *
+ *-------------------------------------------------------------------------
+ */
+static size_t
+append_to_group_name(unsigned int flags, size_t cd_nelmts,
+ const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf)
+{
+ size_t new_name_size = 0; /* Return value */
+
+ /* Check for the correct number of parameters */
+ if (cd_nelmts > 0)
+ return 0;
+
+ /* Assignment to eliminate unused parameter warning. */
+ cd_values = cd_values;
+
+ if (flags & H5Z_FLAG_REVERSE) {
+ /* READ - Remove the suffix from the group name */
+ new_name_size = *buf_size = nbytes - SUFFIX_LEN;
+ }
+ else {
+ /* WRITE - Append the suffix to the group name */
+ void *outbuf = NULL; /* Pointer to new buffer */
+ unsigned char *dst = NULL; /* Temporary pointer to destination buffer */
+
+ /* Get memory for the new, larger string buffer using the
+ * library's memory allocator.
+ */
+ if (NULL == (dst = (unsigned char *)(outbuf = H5allocate_memory(nbytes + SUFFIX_LEN, 0))))
+ return 0;
+
+ /* Copy raw data */
+ memcpy((void *)dst, (const void *)(*buf), nbytes);
+
+ /* Append suffix to raw data for storage */
+ dst += nbytes;
+ memcpy((void *)dst, (const void *)GROUP_SUFFIX, SUFFIX_LEN);
+
+ /* Free the passed-in buffer using the library's allocator */
+ H5free_memory(*buf);
+
+ /* Set return values */
+ *buf_size = nbytes + SUFFIX_LEN;
+ *buf = outbuf;
+ outbuf = NULL;
+ new_name_size = *buf_size;
+ }
+
+ return new_name_size;
+} /* append_to_group_name() */
+
diff --git a/test/flush1.c b/test/flush1.c
index bdbd731..04f24f7 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -73,7 +73,7 @@ create_file(const char *filename, hid_t fapl_id, hbool_t swmr)
hid_t fid = -1; /* file ID */
hid_t top_gid = -1; /* containing group ID */
hid_t gid = -1; /* subgroup ID */
- char group_name[16]; /* group name */
+ char group_name[32]; /* group name */
unsigned flags; /* file open flags */
int i; /* iterator */
@@ -99,7 +99,7 @@ create_file(const char *filename, hid_t fapl_id, hbool_t swmr)
if(H5Gclose(top_gid) < 0)
STACK_ERROR
-
+
return fid;
error:
@@ -185,7 +185,7 @@ error:
* a variety of situations.
*
* Part 1 of a two-part H5Fflush() test.
- *
+ *
* Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
@@ -209,7 +209,7 @@ main(void)
/* Check if the current VFD supports SWMR */
driver = HDgetenv("HDF5_DRIVER");
- vfd_supports_swmr = H5FD_supports_swmr_test(driver);
+ vfd_supports_swmr = H5FD__supports_swmr_test(driver);
/*************************************************/
/* NOTE: Not closing the file ID is intentional! */
diff --git a/test/flush2.c b/test/flush2.c
index 9fdf6c1..5fc716b 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"
@@ -135,7 +135,7 @@ file_ok(const char *filename, hid_t fapl_id, hbool_t check_second_dset)
hid_t fid = -1; /* file ID */
hid_t top_gid = -1; /* containing group ID */
hid_t gid = -1; /* subgroup ID */
- char group_name[16]; /* group name */
+ char group_name[32]; /* group name */
int i; /* iterator */
/* open file */
@@ -258,7 +258,7 @@ main(void)
/* Check if the current VFD supports SWMR */
driver = HDgetenv("HDF5_DRIVER");
- vfd_supports_swmr = H5FD_supports_swmr_test(driver);
+ vfd_supports_swmr = H5FD__supports_swmr_test(driver);
/* TEST 1 */
/* Check the case where the file was flushed */
@@ -266,7 +266,7 @@ main(void)
h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
check_second_dset = FALSE;
if(file_ok(filename, fapl_id, check_second_dset))
- PASSED()
+ PASSED();
else
TEST_ERROR
@@ -279,7 +279,7 @@ main(void)
if(clear_status_flags(filename, fapl_id) < 0)
TEST_ERROR
if(file_ok(filename, fapl_id, check_second_dset))
- PASSED()
+ PASSED();
else
TEST_ERROR
} /* end if */
@@ -305,7 +305,7 @@ main(void)
#endif
} /* end if */
else
- PASSED()
+ PASSED();
/* Turn the error stack back on */
if(H5Eset_auto2(H5E_DEFAULT, func, NULL) < 0)
FAIL_STACK_ERROR
@@ -332,7 +332,7 @@ main(void)
#endif
} /* end if */
else
- PASSED()
+ PASSED();
/* Turn the error stack back on */
if(H5Eset_auto2(H5E_DEFAULT, func, NULL) < 0)
FAIL_STACK_ERROR
@@ -348,13 +348,13 @@ main(void)
check_second_dset = TRUE;
h5_fixname(FILENAME[4], fapl_id, filename, sizeof(filename));
if(file_ok(filename, fapl_id, check_second_dset))
- PASSED()
+ PASSED();
else
TEST_ERROR
/* TEST 6 */
/* Check the case where the file was flushed, but more data was
- * added afterward and then flushed (w/SWMR)
+ * added afterward and then flushed (w/SWMR)
*/
TESTING("H5Fflush (part2 with flush and later addition and another flush + SWMR)");
if(vfd_supports_swmr) {
@@ -363,7 +363,7 @@ main(void)
if(clear_status_flags(filename, fapl_id) < 0)
TEST_ERROR
if(file_ok(filename, fapl_id, check_second_dset))
- PASSED()
+ PASSED();
else
TEST_ERROR
} /* end if */
@@ -391,7 +391,7 @@ main(void)
#endif
} /* end if */
else
- PASSED()
+ PASSED();
/* Turn the error stack back on */
if(H5Eset_auto2(H5E_DEFAULT, func, NULL) < 0)
FAIL_STACK_ERROR
diff --git a/test/flushrefresh.c b/test/flushrefresh.c
index 0775dee..2db1d6b 100644
--- a/test/flushrefresh.c
+++ b/test/flushrefresh.c
@@ -15,10 +15,10 @@
* Programmer: Mike McGreevy
* June 30, 2010
*
- * Purpose: This test file contains routines used to test flushing and
- * refreshing individual objects' metadata from the cache.
- *
- * Note: This file should NOT be run manually. Instead, invoke it
+ * Purpose: This test file contains routines used to test flushing and
+ * refreshing individual objects' metadata from the cache.
+ *
+ * Note: This file should NOT be run manually. Instead, invoke it
* via its associated test script, testflushrefresh.sh
*
*/
@@ -119,25 +119,25 @@ herr_t end_verification(void);
* Function: main
*
* Purpose: This function coordinates the test of flush/refresh
- * functionality verification. It accepts either one, two or
+ * functionality verification. It accepts either one, two or
* no command line parameters. The main test routine runs
* with no command line parameters specified, while verification
* routines run with one or two command line parameters.
- *
- * Note: This program should not be run manually, as the
+ *
+ * Note: This program should not be run manually, as the
* test is controlled by the testflushrefresh.sh script. Running
* the flushrefresh program manually will result in failure, as
* it will time out waiting for a signal from the test script
* which will never come.
*
- * Return: 0 on Success, 1 on Failure
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Mike McGreevy
* July 1, 2010
*
*-------------------------------------------------------------------------
*/
-int main(int argc, const char *argv[])
+int main(int argc, const char *argv[])
{
/* Variables */
const char *envval = NULL;
@@ -148,41 +148,44 @@ int main(int argc, const char *argv[])
/* Parse command line options */
if(argc == 1) {
- /* No arguments supplied. Run main test routines if
- * using sec2 or stdio driver, otherwise don't run
+ /* No arguments supplied. Run main test routines if
+ * using sec2 or stdio driver, otherwise don't run
* anything. */
/* Determine driver being used */
envval = HDgetenv("HDF5_DRIVER");
- if(envval == NULL || H5FD_supports_swmr_test(envval)) {
+ if(envval == NULL || H5FD__supports_swmr_test(envval)) {
if(test_flush() != SUCCEED) TEST_ERROR;
if(test_refresh() != SUCCEED) TEST_ERROR;
} /* end if */
else {
HDfprintf(stdout, "Skipping all flush/refresh tests (only run with SWMR-enabled file drivers).\n");
-
+
/* Test script is expecting some signals, so send them out to end it. */
if(end_verification() < 0) TEST_ERROR;
if(end_verification() < 0) TEST_ERROR;
} /* end else */
- } else if(argc == 3) {
+ }
+ else if(argc == 3) {
/* Two arguments supplied. Pass them to flush verification routine. */
if(flush_verification(argv[1], argv[2]) != 0) PROCESS_ERROR;
- } else if(argc == 2) {
+ }
+ else if(argc == 2) {
/* One argument supplied. Pass it to refresh verification routine. */
if(refresh_verification(argv[1]) != 0) PROCESS_ERROR;
- } else {
+ }
+ else {
/* Illegal number of arguments supplied. Error. */
HDfprintf(stderr, "Error. %d is an Invalid number of arguments to main().\n", argc);
PROCESS_ERROR
} /* end if */
- return SUCCEED;
+ return EXIT_SUCCESS;
error:
/* Return */
- return FAIL;
+ return EXIT_FAILURE;
} /* main */
@@ -199,29 +202,29 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t test_flush(void)
+herr_t test_flush(void)
{
/**************************************************************************
*
* Test Description:
*
- * This test will build an HDF5 file with several objects in a varying
+ * This test will build an HDF5 file with several objects in a varying
* hierarchical layout. It will then attempt to flush the objects
* in the file one by one, individually, using the four H5*flush
- * routines (D,G,T, and O). After each call to either create or flush an
+ * routines (D,G,T, and O). After each call to either create or flush an
* object, a series of verifications will occur on each object in the file.
*
* Each verification consists of spawning off a new process and determining
- * if the object can be opened and its information retreived in said
- * alternate process. It reports the results, which are compared to an
+ * if the object can be opened and its information retreived in said
+ * alternate process. It reports the results, which are compared to an
* expected value (either that the object can be found on disk, or that it
* cannot).
*
* Note that to spawn a verification, this program sends a signal (by creating
- * a file on disk) to the test script controlling it, indicating how to
+ * a file on disk) to the test script controlling it, indicating how to
* run the verification.
- *
- * Implementation is funky, but basically, an example:
+ *
+ * Implementation is funky, but basically, an example:
*
* Step 1. Dataset is created.
* Step 2. Verify that dataset can't be opened by separate process, as
@@ -230,14 +233,14 @@ herr_t test_flush(void)
* Step 4. Verify that group can't be opened by separate process.
* Step 5. H5Gflush is called on the group.
* Step 6. Verify that group CAN be opened, but dataset still has
- * yet to hit disk, and CANNOT be opened. Success! Only the group
+ * yet to hit disk, and CANNOT be opened. Success! Only the group
* was flushed.
*
**************************************************************************/
/**************************************************************************
* Generated Test File will look like this:
- *
+ *
* GROUP "/"
* DATASET "Dataset1"
* GROUP "Group1" {
@@ -262,14 +265,14 @@ herr_t test_flush(void)
/* Cleanup any old error or signal files */
CLEANUP_FILES;
-
+
/* ================ */
/* CREATE TEST FILE */
/* ================ */
/* Create file, open root group - have to use latest file format for SWMR */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR;
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR;
if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) TEST_ERROR;
if((rid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) TEST_ERROR;
@@ -338,7 +341,7 @@ herr_t test_flush(void)
if(run_flush_verification_process(T2, NOT_FLUSHED) != 0) TEST_ERROR;
if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR;
- /* Flush Group1 and Verify it is recently flushed, and nothing
+ /* Flush Group1 and Verify it is recently flushed, and nothing
* else has changed. */
if((status = H5Gflush(gid)) < 0) TEST_ERROR;
if(run_flush_verification_process(RG, FLUSHED) != 0) TEST_ERROR;
@@ -352,7 +355,7 @@ herr_t test_flush(void)
if(run_flush_verification_process(T2, NOT_FLUSHED) != 0) TEST_ERROR;
if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR;
- /* Flush Group2 and Verify it is recently flushed, and nothing
+ /* Flush Group2 and Verify it is recently flushed, and nothing
* else has changed. */
if((status = H5Gflush(gid2)) < 0) TEST_ERROR;
if(run_flush_verification_process(RG, FLUSHED) != 0) TEST_ERROR;
@@ -437,7 +440,7 @@ herr_t test_flush(void)
if(run_flush_verification_process(T3, NOT_FLUSHED) != 0) TEST_ERROR;
PASSED();
-
+
/* ============= */
/* FLUSH OBJECTS */
/* ============= */
@@ -487,7 +490,7 @@ herr_t test_flush(void)
PASSED();
/* ================== */
- /* Cleanup and Return */
+ /* Cleanup and Return */
/* ================== */
if(H5Pclose(fapl) < 0) TEST_ERROR;
if(H5Gclose(gid) < 0) TEST_ERROR;
@@ -512,7 +515,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_refresh
*
- * Purpose: This function tests refresh (evict/reload) of individual
+ * Purpose: This function tests refresh (evict/reload) of individual
* objects' metadata from the metadata cache.
*
* Return: 0 on Success, 1 on Failure
@@ -522,27 +525,27 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t test_refresh(void)
+herr_t test_refresh(void)
{
/**************************************************************************
*
* Test Description:
*
- * This test will build an HDF5 file with several objects in a varying
+ * This test will build an HDF5 file with several objects in a varying
* hierarchical layout. It will then flush the entire file to disk. Then,
* an attribute will be added to each object in the file.
- *
+ *
* One by one, this process will flush each object to disk, individually.
* It will also be coordinating with another process, which will open
* the object before it is flushed by this process, and then refresh the
* object after it's been flushed, comparing the before and after object
* information to ensure that they are as expected. (i.e., most notably,
- * that an attribute has been added, and is only visible after a
+ * that an attribute has been added, and is only visible after a
* successful call to a H5*refresh function).
- *
- * As with the flush case, the implemention is a bit tricky as it's
+ *
+ * As with the flush case, the implemention is a bit tricky as it's
* dealing with signals going back and forth between the two processes
- * to ensure the timing is correct, but basically, an example:
+ * to ensure the timing is correct, but basically, an example:
*
* Step 1. Dataset is created.
* Step 2. Dataset is flushed.
@@ -552,7 +555,7 @@ herr_t test_refresh(void)
* Step 5. This process flushes the dataset again (with Attribute attached).
* Step 6. The other process calls H5Drefresh, which should evict/reload
* the object's metadata, and thus pick up the attribute that's
- * attached to it. Most other before/after object information is
+ * attached to it. Most other before/after object information is
* compared for sanity as well.
* Step 7. Rinse and Repeat for each object in the file.
*
@@ -560,7 +563,7 @@ herr_t test_refresh(void)
/**************************************************************************
* Generated Test File will look like this:
- *
+ *
* GROUP "/"
* DATASET "Dataset1"
* GROUP "Group1" {
@@ -695,7 +698,6 @@ herr_t test_refresh(void)
/* ================= */
/* Refresh Datatypes */
/* ================= */
-
TESTING("to ensure that H5Trefresh correctly refreshes single datatypes");
/* Verify First Committed Datatype can be refreshed with H5Trefresh */
@@ -715,7 +717,6 @@ herr_t test_refresh(void)
if(H5Oflush(tid2) < 0) TEST_ERROR;
if(end_refresh_verification_process() != 0) TEST_ERROR;
-
PASSED();
/* =============== */
@@ -754,7 +755,7 @@ herr_t test_refresh(void)
PASSED();
/* ================== */
- /* Cleanup and Return */
+ /* Cleanup and Return */
/* ================== */
/* Close Stuff */
@@ -790,8 +791,8 @@ error:
*
* Purpose: This function is used to communicate with the test script
* in order to spawn off a process to verify that a flush
- * of an individual object was successful.
- *
+ * of an individual object was successful.
+ *
* Return: 0 on Success, 1 on Failure
*
* Programmer: Mike McGreevy
@@ -799,7 +800,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t run_flush_verification_process(const char * obj_pathname, const char * expected)
+herr_t run_flush_verification_process(const char * obj_pathname, const char * expected)
{
HDremove(SIGNAL_FROM_SCRIPT);
@@ -824,10 +825,10 @@ error:
* Function: flush_verification
*
* Purpose: This function tries to open target object in the test file.
- * It compares the success of the open function to the expected
+ * It compares the success of the open function to the expected
* value, and succeeds if they are equal and fails if they differ.
*
- * Note that full path to the object must be provided as the
+ * Note that full path to the object must be provided as the
* obj_pathname argument.
*
* Return: 0 on Success, 1 on Failure
@@ -837,18 +838,18 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t flush_verification(const char * obj_pathname, const char * expected)
+herr_t flush_verification(const char * obj_pathname, const char * expected)
{
/* Variables */
hid_t oid = -1, fid = -1;
herr_t status = 0;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
/* Try to open the testfile and then obj_pathname within the file */
H5E_BEGIN_TRY {
fid = H5Fopen(FILENAME, H5F_ACC_SWMR_READ, H5P_DEFAULT);
oid = H5Oopen(fid, obj_pathname, H5P_DEFAULT);
- status = H5Oget_info(oid, &oinfo);
+ status = H5Oget_info3(oid, &oinfo, H5O_INFO_BASIC);
} H5E_END_TRY;
/* Compare to expected result */
@@ -886,7 +887,7 @@ error:
* Purpose: This function is used to communicate with the test script
* in order to spawn off a process which will test the
* H5*refresh routine.
- *
+ *
* Return: 0 on Success, 1 on Failure
*
* Programmer: Mike McGreevy
@@ -894,14 +895,14 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t start_refresh_verification_process(const char * obj_pathname)
+herr_t start_refresh_verification_process(const char * obj_pathname)
{
HDremove(SIGNAL_BETWEEN_PROCESSES_1);
- /* Send Signal to SCRIPT indicating that it should kick off a refresh
+ /* Send Signal to SCRIPT indicating that it should kick off a refresh
verification process */
h5_send_message(SIGNAL_TO_SCRIPT, obj_pathname, NULL);
-
+
/* Wait for Signal from VERIFICATION PROCESS indicating that it's opened the
target object and ready for MAIN PROCESS to modify it */
if(h5_wait_message(SIGNAL_BETWEEN_PROCESSES_1) < 0) TEST_ERROR;
@@ -921,10 +922,10 @@ error:
* Function: end_refresh_verification_process
*
* Purpose: This function is used to communicate with the verification
- * process spawned by the start_refresh_verification_process
+ * process spawned by the start_refresh_verification_process
* function. It gives it the go-ahead to call H5*refresh
* on an object and conlcude the refresh verification.
- *
+ *
* Return: 0 on Success, 1 on Failure
*
* Programmer: Mike McGreevy
@@ -932,8 +933,8 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t end_refresh_verification_process(void)
-{
+herr_t end_refresh_verification_process(void)
+{
HDremove(SIGNAL_FROM_SCRIPT);
/* Send Signal to REFRESH VERIFICATION PROCESS indicating that the object
@@ -973,15 +974,18 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t refresh_verification(const char * obj_pathname)
+herr_t refresh_verification(const char * obj_pathname)
{
/* Variables */
hid_t oid,fid,status = 0;
- H5O_info_t flushed_oinfo;
- H5O_info_t refreshed_oinfo;
+ H5O_info2_t flushed_oinfo;
+ H5O_info2_t refreshed_oinfo;
+ H5O_native_info_t flushed_ninfo;
+ H5O_native_info_t refreshed_ninfo;
int tries = 800, sleep_tries = 400;
+ int token_cmp;
hbool_t ok = FALSE;
-
+
HDremove(SIGNAL_BETWEEN_PROCESSES_2);
/* Open Object */
@@ -989,37 +993,40 @@ herr_t refresh_verification(const char * obj_pathname)
if((oid = H5Oopen(fid, obj_pathname, H5P_DEFAULT)) < 0) PROCESS_ERROR;
/* Get Object info */
- if((status = H5Oget_info(oid, &flushed_oinfo)) < 0) PROCESS_ERROR;
-
+ if((status = H5Oget_info3(oid, &flushed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS)) < 0) PROCESS_ERROR;
+ if((status = H5Oget_native_info(oid, &flushed_ninfo, H5O_NATIVE_INFO_HDR)) < 0) PROCESS_ERROR;
+
/* Make sure there are no attributes on the object. This is just a sanity
check to ensure we didn't erroneously flush the attribute before
starting the verification. */
if(flushed_oinfo.num_attrs != 0)
- PROCESS_ERROR;
+ PROCESS_ERROR;
- /* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the
+ /* Send Signal to MAIN PROCESS indicating that it can go ahead and modify the
object. */
h5_send_message(SIGNAL_BETWEEN_PROCESSES_1, obj_pathname, NULL);
- /* Wait for Signal from MAIN PROCESS indicating that it's modified the
+ /* Wait for Signal from MAIN PROCESS indicating that it's modified the
object and we can run verification now. */
if(h5_wait_message(SIGNAL_BETWEEN_PROCESSES_2) < 0) PROCESS_ERROR;
- /* Get object info again. This will NOT reflect what's on disk, only what's
- in the cache. Thus, all values will be unchanged from above, despite
+ /* Get object info again. This will NOT reflect what's on disk, only what's
+ in the cache. Thus, all values will be unchanged from above, despite
newer information being on disk. */
- if((status = H5Oget_info(oid, &refreshed_oinfo)) < 0) PROCESS_ERROR;
+ if((status = H5Oget_info3(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS)) < 0) PROCESS_ERROR;
+ if((status = H5Oget_native_info(oid, &refreshed_ninfo, H5O_NATIVE_INFO_HDR)) < 0) PROCESS_ERROR;
/* Verify that before doing a refresh, getting the object info returns stale
information. (i.e., unchanged from above, despite new info on disk). */
- if(flushed_oinfo.addr != refreshed_oinfo.addr) PROCESS_ERROR;
- if(flushed_oinfo.type != refreshed_oinfo.type) PROCESS_ERROR;
- if(flushed_oinfo.hdr.version != refreshed_oinfo.hdr.version) PROCESS_ERROR;
- if(flushed_oinfo.hdr.flags != refreshed_oinfo.hdr.flags) PROCESS_ERROR;
- if(flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) PROCESS_ERROR;
- if(flushed_oinfo.hdr.nmesgs != refreshed_oinfo.hdr.nmesgs) PROCESS_ERROR;
- if(flushed_oinfo.hdr.nchunks != refreshed_oinfo.hdr.nchunks) PROCESS_ERROR;
- if(flushed_oinfo.hdr.space.total != refreshed_oinfo.hdr.space.total) PROCESS_ERROR;
+ if(H5Otoken_cmp(oid, &flushed_oinfo.token, &refreshed_oinfo.token, &token_cmp) < 0) PROCESS_ERROR;
+ if(token_cmp) PROCESS_ERROR;
+ if(flushed_oinfo.type != refreshed_oinfo.type) PROCESS_ERROR;
+ if(flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) PROCESS_ERROR;
+ if(flushed_ninfo.hdr.version != refreshed_ninfo.hdr.version) PROCESS_ERROR;
+ if(flushed_ninfo.hdr.flags != refreshed_ninfo.hdr.flags) PROCESS_ERROR;
+ if(flushed_ninfo.hdr.nmesgs != refreshed_ninfo.hdr.nmesgs) PROCESS_ERROR;
+ if(flushed_ninfo.hdr.nchunks != refreshed_ninfo.hdr.nchunks) PROCESS_ERROR;
+ if(flushed_ninfo.hdr.space.total != refreshed_ninfo.hdr.space.total) PROCESS_ERROR;
/* Refresh object */
/* The H5*refresh function called depends on which object we are trying
@@ -1027,55 +1034,58 @@ herr_t refresh_verification(const char * obj_pathname)
* test cases is easy). */
do {
- if((HDstrcmp(obj_pathname, D1) == 0) || (HDstrcmp(obj_pathname, D2) == 0)) {
- if(H5Drefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, G1) == 0) || (HDstrcmp(obj_pathname, G2) == 0)) {
- if(H5Grefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, T1) == 0) || (HDstrcmp(obj_pathname, T2) == 0)) {
- if(H5Trefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else if((HDstrcmp(obj_pathname, D3) == 0) || (HDstrcmp(obj_pathname, G3) == 0) ||
+ if((HDstrcmp(obj_pathname, D1) == 0) || (HDstrcmp(obj_pathname, D2) == 0)) {
+ if(H5Drefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, G1) == 0) || (HDstrcmp(obj_pathname, G2) == 0)) {
+ if(H5Grefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, T1) == 0) || (HDstrcmp(obj_pathname, T2) == 0)) {
+ if(H5Trefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else if((HDstrcmp(obj_pathname, D3) == 0) || (HDstrcmp(obj_pathname, G3) == 0) ||
(HDstrcmp(obj_pathname, T3) == 0)) {
- if(H5Orefresh(oid) < 0) PROCESS_ERROR;
- } /* end if */
- else {
- HDfprintf(stdout, "Error. %s is an unrecognized object.\n", obj_pathname);
- PROCESS_ERROR;
- } /* end else */
-
- /* Get object info. This should now accurately reflect the refreshed object on disk. */
- if((status = H5Oget_info(oid, &refreshed_oinfo)) < 0) PROCESS_ERROR;
-
- /* Confirm following (first 4) attributes are the same: */
- /* Confirm following (last 4) attributes are different */
- if( (flushed_oinfo.addr == refreshed_oinfo.addr) &&
- (flushed_oinfo.type == refreshed_oinfo.type) &&
- (flushed_oinfo.hdr.version == refreshed_oinfo.hdr.version) &&
- (flushed_oinfo.hdr.flags == refreshed_oinfo.hdr.flags) &&
- (flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) &&
- (flushed_oinfo.hdr.nmesgs != refreshed_oinfo.hdr.nmesgs) &&
- (flushed_oinfo.hdr.nchunks != refreshed_oinfo.hdr.nchunks) &&
- (flushed_oinfo.hdr.space.total != refreshed_oinfo.hdr.space.total) ) {
- ok = TRUE;
- break;
- }
- if(tries == sleep_tries)
- HDsleep(1);
+ if(H5Orefresh(oid) < 0) PROCESS_ERROR;
+ } /* end if */
+ else {
+ HDfprintf(stdout, "Error. %s is an unrecognized object.\n", obj_pathname);
+ PROCESS_ERROR;
+ } /* end else */
+
+ /* Get object info. This should now accurately reflect the refreshed object on disk. */
+ if((status = H5Oget_info3(oid, &refreshed_oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS)) < 0) PROCESS_ERROR;
+ if((status = H5Oget_native_info(oid, &refreshed_ninfo, H5O_NATIVE_INFO_HDR)) < 0) PROCESS_ERROR;
+ if(H5Otoken_cmp(oid, &flushed_oinfo.token, &refreshed_oinfo.token, &token_cmp) < 0) PROCESS_ERROR;
+
+ /* Confirm following (first 4) attributes are the same: */
+ /* Confirm following (last 4) attributes are different */
+ if( (!token_cmp) &&
+ (flushed_oinfo.type == refreshed_oinfo.type) &&
+ (flushed_oinfo.num_attrs != refreshed_oinfo.num_attrs) &&
+ (flushed_ninfo.hdr.version == refreshed_ninfo.hdr.version) &&
+ (flushed_ninfo.hdr.flags == refreshed_ninfo.hdr.flags) &&
+ (flushed_ninfo.hdr.nmesgs != refreshed_ninfo.hdr.nmesgs) &&
+ (flushed_ninfo.hdr.nchunks != refreshed_ninfo.hdr.nchunks) &&
+ (flushed_ninfo.hdr.space.total != refreshed_ninfo.hdr.space.total) ) {
+ ok = TRUE;
+ break;
+ }
+
+ if(tries == sleep_tries)
+ HDsleep(1);
} while(--tries);
-
+
if(!ok) {
- printf("FLUSHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
- (int)flushed_oinfo.num_attrs, (int)flushed_oinfo.hdr.nmesgs,
- (int)flushed_oinfo.hdr.nchunks, (int)flushed_oinfo.hdr.space.total);
- printf("REFRESHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
- (int)refreshed_oinfo.num_attrs, (int)refreshed_oinfo.hdr.nmesgs,
- (int)refreshed_oinfo.hdr.nchunks, (int)refreshed_oinfo.hdr.space.total);
- PROCESS_ERROR;
+ HDprintf("FLUSHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
+ (int)flushed_oinfo.num_attrs, (int)flushed_ninfo.hdr.nmesgs,
+ (int)flushed_ninfo.hdr.nchunks, (int)flushed_ninfo.hdr.space.total);
+ HDprintf("REFRESHED: num_attrs=%d, nmesgs=%d, nchunks=%d, total=%d\n",
+ (int)refreshed_oinfo.num_attrs, (int)refreshed_ninfo.hdr.nmesgs,
+ (int)refreshed_ninfo.hdr.nchunks, (int)refreshed_ninfo.hdr.space.total);
+ PROCESS_ERROR;
}
-
+
/* Close objects */
if(H5Oclose(oid) < 0) PROCESS_ERROR;
if(H5Fclose(fid) < 0) PROCESS_ERROR;
@@ -1095,7 +1105,7 @@ error:
* processes to see if they've succeeded. It checks for the
* existance of flushrefresh_ERROR file. If present, that indicates
* an external verification process has failed, and this function
- * thus fails as well. If not present, then nothing else has
+ * thus fails as well. If not present, then nothing else has
* failed, and this function succeeds.
*
* Return: 0 on Success, 1 on Failure
@@ -1105,7 +1115,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-herr_t check_for_errors(void)
+herr_t check_for_errors(void)
{
FILE * file;
@@ -1121,24 +1131,24 @@ herr_t check_for_errors(void)
/*-------------------------------------------------------------------------
* Function: end_verification
- *
- * Purpose: Tells test script that verification routines are completed and
- * that the test can wrap up.
+ *
+ * Purpose: Tells test script that verification routines are completed and
+ * that the test can wrap up.
*
* Return: void
*
* Programmer: Mike McGreevy
* July 16, 2010
- *
+ *
*-------------------------------------------------------------------------
*/
-herr_t end_verification(void)
+herr_t end_verification(void)
{
HDremove(SIGNAL_FROM_SCRIPT);
/* Send Signal to SCRIPT to indicate that we're done with verification. */
h5_send_message(SIGNAL_TO_SCRIPT, "VERIFICATION_DONE", "VERIFICATION_DONE");
-
+
/* Wait for Signal from SCRIPT indicating that we can continue. */
if(h5_wait_message(SIGNAL_FROM_SCRIPT) < 0) TEST_ERROR;
diff --git a/test/flushrefreshTest.cmake b/test/flushrefreshTest.cmake
new file mode 100644
index 0000000..6faf37b
--- /dev/null
+++ b/test/flushrefreshTest.cmake
@@ -0,0 +1,172 @@
+#
+# 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.
+#
+# runTest.cmake executes a command and captures the output in a file. File is then compared
+# against a reference file. Exit status of command can also be compared.
+cmake_policy(SET CMP0007 NEW)
+
+# arguments checking
+if (NOT TEST_PROGRAM)
+ message (FATAL_ERROR "Require TEST_PROGRAM to be defined")
+endif ()
+if (NOT TEST_FOLDER)
+ message (FATAL_ERROR "Require TEST_FOLDER to be defined")
+endif ()
+if (NOT TEST_OUTPUT)
+ message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
+endif ()
+if (NOT PERL_SCRIPT)
+ message (STATUS "Require PERL_BIN_DIR to be defined")
+endif ()
+if (NOT PERL_EXECUTABLE)
+ message (STATUS "Require PERL_EXECUTABLE to be defined")
+endif ()
+
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
+ file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
+endif ()
+
+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 OR MINGW)
+ set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
+ else ()
+ set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
+ endif ()
+endif ()
+
+if (TEST_ENV_VAR)
+ set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
+ #message (STATUS "ENV:${TEST_ENV_VAR}=$ENV{${TEST_ENV_VAR}}")
+endif ()
+
+message (STATUS "Background: ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}")
+execute_process (
+ COMMAND ${PERL_EXECUTABLE} ${PERL_SCRIPT} ${TEST_PROGRAM}
+ RESULT_VARIABLE SCRIPT_RESULT
+ ERROR_VARIABLE SCRIPT_ERR
+ OUTPUT_VARIABLE SCRIPT_OUTPUT
+ WORKING_DIRECTORY ${TEST_FOLDER}
+)
+message (STATUS "Background: ${SCRIPT_OUTPUT}")
+if (SCRIPT_RESULT)
+ message (FATAL_ERROR "Failed: The background script failed ${SCRIPT_RESULT}: ${SCRIPT_ERR}")
+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}")
+ # Error exit script
+ set (verification_done "3")
+ 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}")
+ if (len_v1)
+ list (GET v1 0 param1)
+ list (GET v1 -1 param2)
+ endif ()
+ file (REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message (STATUS "PARAM1:${param1} PARAM2:${param2}")
+
+ if (param1 MATCHES "VERIFICATION_DONE")
+ set (verification_done "1")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all flush verification complete")
+ message (STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else ()
+ message (STATUS "execute: ${TEST_PROGRAM} ${param1} ${param2}")
+ execute_process (
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${TEST_PROGRAM} ${param1} ${param2}
+ RESULT_VARIABLE TEST_RESULT
+ OUTPUT_FILE ${TEST_OUTPUT}
+ ERROR_FILE ${TEST_OUTPUT}.err
+ OUTPUT_VARIABLE TEST_OUT
+ ERROR_VARIABLE TEST_ERROR
+ WORKING_DIRECTORY ${TEST_FOLDER}
+ )
+ message (STATUS "flush verification: ${TEST_OUT}")
+ if (TEST_RESULT)
+ message (FATAL_ERROR "Failed: The flush verification failed ${TEST_RESULT}: ${TEST_ERROR}")
+ endif ()
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "verification flush process done")
+ endif ()
+ else ()
+ message (STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ #execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
+ endif ()
+endwhile ()
+
+while (verification_done LESS "2")
+ message (STATUS "checking second stage:${TEST_FOLDER}/${TEST_ARGS1}")
+ if (EXISTS "${TEST_FOLDER}/${TEST_ERR}")
+ # Error exit script
+ set (verification_done "3")
+ 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}")
+ if (len_v1)
+ list (GET v1 0 param1)
+ list (GET v1 -1 param2)
+ endif ()
+ file (REMOVE ${TEST_FOLDER}/${TEST_ARGS1})
+ message (STATUS "PARAM1:${param1} PARAM2:${param2}")
+
+ if (param1 MATCHES "VERIFICATION_DONE")
+ set (verification_done "2")
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "all refresh verification complete")
+ message (STATUS "write: ${TEST_FOLDER}/${TEST_ARGS2}")
+ else ()
+ message (STATUS "execute: ${TEST_PROGRAM} ${param1}")
+ execute_process (
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${TEST_PROGRAM} ${param1}
+ RESULT_VARIABLE TEST_RESULT
+ OUTPUT_FILE ${TEST_OUTPUT}
+ ERROR_FILE ${TEST_OUTPUT}.err
+ OUTPUT_VARIABLE TEST_OUT
+ ERROR_VARIABLE TEST_ERROR
+ WORKING_DIRECTORY ${TEST_FOLDER}
+ )
+ message (STATUS "refresh verification: ${TEST_OUT}")
+ if (TEST_RESULT)
+ message (FATAL_ERROR "Failed: The refresh verification failed ${TEST_RESULT}: ${TEST_ERROR}")
+ endif ()
+ file (WRITE ${TEST_FOLDER}/${TEST_ARGS2} "refresh verifiction process done")
+ endif ()
+ else ()
+ message (STATUS "waiting: ${TEST_FOLDER}/${TEST_ARGS1}")
+ #execute_process (COMMAND ${CMAKE_COMMAND} -E sleep 2)
+ endif ()
+endwhile ()
+
+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}")
+ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
+ message (STATUS "Output :\n${TEST_STREAM}")
+ endif ()
+ endif ()
+ message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
+endif ()
+
+message (STATUS "COMMAND Error: ${TEST_ERROR}")
+
+# everything went fine...
+message (STATUS "Passed")
diff --git a/test/freespace.c b/test/freespace.c
index 39c5688..124ae3e 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -23,7 +23,10 @@
/* Other private headers that this test requires */
#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "H5Fpkg.h"
+
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VMprivate.h"
#define FILENAME_LEN 1024
@@ -446,7 +449,6 @@ static unsigned
test_fs_create(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -479,26 +481,23 @@ test_fs_create(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* initialize creation parameters for free-space manager */
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
- if (frsp->nclasses != nclasses)
+ if(frsp->nclasses != nclasses)
TEST_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -506,18 +505,18 @@ test_fs_create(hid_t fapl)
TEST_ERROR
HDmemset(&test_cparam, 0, sizeof(H5FS_create_t));
- if(H5FS_get_cparam_test(frsp, &test_cparam) < 0)
+ if(H5FS__get_cparam_test(frsp, &test_cparam) < 0)
FAIL_STACK_ERROR
- if (H5FS_cmp_cparam_test(&cparam, &test_cparam))
+ if(H5FS__cmp_cparam_test(&cparam, &test_cparam))
FAIL_STACK_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr,
+ if(NULL == (frsp = H5FS_open(f, fs_addr,
nclasses, test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -527,12 +526,12 @@ test_fs_create(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -548,20 +547,15 @@ test_fs_create(hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- /* Close the dxpl */
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR;
-
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_create() */
@@ -595,7 +589,6 @@ static unsigned
test_fs_sect_add(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl_id (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -630,19 +623,16 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -654,7 +644,7 @@ test_fs_sect_add(hid_t fapl)
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -669,7 +659,7 @@ test_fs_sect_add(hid_t fapl)
fr_meta_size = H5FS_HEADER_SIZE(f) + H5FS_SINFO_PREFIX_SIZE(f);
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
@@ -684,7 +674,7 @@ test_fs_sect_add(hid_t fapl)
if (tmp_file_size <= (file_size+fr_meta_size))
TEST_ERROR
- PASSED()
+ PASSED();
TESTING("adding a section via H5FS_sect_add() to free-space with H5FS_CLS_GHOST_OBJ: test 2");
@@ -697,14 +687,14 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
init_flags = H5FS_CLS_GHOST_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -717,7 +707,7 @@ test_fs_sect_add(hid_t fapl)
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
0, NULL) < 0)
FAIL_STACK_ERROR
@@ -732,7 +722,7 @@ test_fs_sect_add(hid_t fapl)
fr_meta_size = H5FS_HEADER_SIZE(f);
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -746,7 +736,7 @@ test_fs_sect_add(hid_t fapl)
if (tmp_file_size != (file_size+fr_meta_size))
TEST_ERROR
- PASSED()
+ PASSED();
TESTING("adding a section via H5FS_sect_add() to free-space: test 3");
@@ -767,7 +757,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
@@ -776,7 +766,7 @@ test_fs_sect_add(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = 0;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -791,7 +781,7 @@ test_fs_sect_add(hid_t fapl)
*/
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -802,12 +792,12 @@ test_fs_sect_add(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -815,7 +805,7 @@ test_fs_sect_add(hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
TESTING("adding a section via H5FS_sect_add() to free-space: test 4");
@@ -836,7 +826,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
@@ -845,7 +835,7 @@ test_fs_sect_add(hid_t fapl)
nclasses = NELMTS(test_classes);
init_flags = 0;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -860,7 +850,7 @@ test_fs_sect_add(hid_t fapl)
*/
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_DESERIALIZING, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -872,7 +862,7 @@ test_fs_sect_add(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -881,22 +871,20 @@ test_fs_sect_add(hid_t fapl)
sect_node = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return 0;
@@ -905,9 +893,8 @@ error:
if(sect_node)
TEST_sect_free((H5FS_section_info_t *)sect_node);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_sect_add() */
@@ -937,7 +924,6 @@ static unsigned
test_fs_sect_find(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -961,19 +947,16 @@ test_fs_sect_find(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -985,7 +968,7 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -995,16 +978,16 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
- PASSED()
+ PASSED();
TESTING("H5FS_sect_find() a section equal to requested-size from free-space");
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses,
+ if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses,
test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1021,7 +1004,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1042,7 +1025,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1061,7 +1044,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1080,7 +1063,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1091,7 +1074,7 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1104,11 +1087,11 @@ test_fs_sect_find(hid_t fapl)
TEST_ERROR
/* remove sections A, C and D */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node3) < 0)
FAIL_STACK_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node4) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1123,16 +1106,16 @@ test_fs_sect_find(hid_t fapl)
sect_node4 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
- PASSED()
+ PASSED();
TESTING("H5FS_sect_find() a section greater than requested-size from free-space");
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses,
+ if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses,
test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1149,7 +1132,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1169,7 +1152,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1180,7 +1163,7 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1194,7 +1177,7 @@ test_fs_sect_find(hid_t fapl)
node = NULL;
/* remove sections A */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1203,16 +1186,16 @@ test_fs_sect_find(hid_t fapl)
sect_node1 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
- PASSED()
+ PASSED();
TESTING("H5FS_sect_find(): cannot find a section with requested-size from free-space");
/* reopen the free-space manager */
- if(NULL == (frsp = H5FS_open(f, dxpl_id, fs_addr, nclasses,
+ if(NULL == (frsp = H5FS_open(f, fs_addr, nclasses,
test_classes, NULL, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1229,7 +1212,7 @@ test_fs_sect_find(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1241,14 +1224,14 @@ test_fs_sect_find(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* remove sections A */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1257,22 +1240,20 @@ test_fs_sect_find(hid_t fapl)
sect_node1 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return 0;
@@ -1285,9 +1266,8 @@ error:
if(sect_node4)
TEST_sect_free((H5FS_section_info_t *)sect_node4);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_sect_find() */
@@ -1329,7 +1309,6 @@ static unsigned
test_fs_sect_merge(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -1356,19 +1335,16 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1383,7 +1359,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1403,7 +1379,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1421,7 +1397,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1439,7 +1415,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1451,7 +1427,7 @@ test_fs_sect_merge(hid_t fapl)
/* should be able to find the merged section of A, B, C & D */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1464,12 +1440,12 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -1477,7 +1453,7 @@ test_fs_sect_merge(hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
/*
* TEST 2
@@ -1489,14 +1465,14 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1511,7 +1487,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1531,7 +1507,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1544,17 +1520,17 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should not be able to find the merged section of A & B */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* remove section A from free-space */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* remove section B from free-space */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -1566,12 +1542,12 @@ test_fs_sect_merge(hid_t fapl)
sect_node2 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -1579,7 +1555,7 @@ test_fs_sect_merge(hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
/*
* TEST 3
@@ -1591,14 +1567,14 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
init_flags = 0; /* reset */
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1613,7 +1589,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1633,7 +1609,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1653,7 +1629,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1671,7 +1647,7 @@ test_fs_sect_merge(hid_t fapl)
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node4,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node4,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -1687,14 +1663,14 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should not be able to find a merged section of A, B, C & D */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE10+TEST_SECT_SIZE30+TEST_SECT_SIZE50+TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* should be able to find the merged section of B & C */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE30+TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1708,7 +1684,7 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should be able to find section A */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE10), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1721,7 +1697,7 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* should be able to find section D */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE80), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1734,22 +1710,20 @@ test_fs_sect_merge(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return 0;
@@ -1760,8 +1734,7 @@ error:
if(sect_node2)
TEST_sect_free((H5FS_section_info_t *)sect_node2);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
- H5Pclose(dxpl_id);
+ H5FS_close(f, frsp);
H5Fclose(file);
} H5E_END_TRY;
return 1;
@@ -1805,7 +1778,6 @@ static unsigned
test_fs_sect_shrink(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -1830,7 +1802,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1838,13 +1810,10 @@ test_fs_sect_shrink(hid_t fapl)
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1860,7 +1829,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
can_shrink = FALSE;
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1873,7 +1842,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section A should still be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -1889,14 +1858,14 @@ test_fs_sect_shrink(hid_t fapl)
* Re-add section A that allow shrinking and its section class type defines "can_shrink"
*/
if(NULL == (sect_node1 = (TEST_free_section_t *)HDmalloc(sizeof(TEST_free_section_t))))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
can_shrink = FALSE;
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* should have nothing in free-space */
HDmemset(&state, 0, sizeof(frspace_state_t));
@@ -1905,27 +1874,27 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section A should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
- FAIL_STACK_ERROR
+ if(H5FS_close(f, frsp) < 0)
+ FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
- FAIL_STACK_ERROR
+ if(H5FS_delete(f, fs_addr) < 0)
+ FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
/* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 2");
@@ -1935,7 +1904,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1945,7 +1914,7 @@ test_fs_sect_shrink(hid_t fapl)
/* does not allow merging */
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -1960,7 +1929,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1980,7 +1949,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -1989,7 +1958,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section B should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -2001,7 +1970,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section A should still be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE20), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -2014,12 +1983,12 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2027,7 +1996,7 @@ test_fs_sect_shrink(hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
TESTING("shrinking of sections when H5FS_sect_add() to free-space: test 3");
@@ -2036,7 +2005,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2045,7 +2014,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
init_flags = 0; /* reset */
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2060,7 +2029,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -2080,7 +2049,7 @@ test_fs_sect_shrink(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, &can_shrink) < 0)
FAIL_STACK_ERROR
@@ -2090,7 +2059,7 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section B should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE50), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
@@ -2098,38 +2067,35 @@ test_fs_sect_shrink(hid_t fapl)
TEST_ERROR
/* section A should not be there in free-space */
- if((node_found = H5FS_sect_find(f, dxpl_id, frsp,
+ if((node_found = H5FS_sect_find(f, frsp,
(hsize_t)(TEST_SECT_SIZE30), (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if (node_found) TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_sect_shrink() */
@@ -2155,7 +2121,6 @@ static unsigned
test_fs_sect_change_class(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -2178,20 +2143,17 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
init_flags = H5FS_CLS_GHOST_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2206,7 +2168,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2226,7 +2188,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2237,7 +2199,7 @@ test_fs_sect_change_class(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node1,
TEST_FSPACE_SECT_TYPE_NONE) < 0)
TEST_ERROR
@@ -2246,7 +2208,7 @@ test_fs_sect_change_class(hid_t fapl)
if(check_stats(f, frsp, &state))
TEST_ERROR
- if(H5FS_sect_find(f, dxpl_id, frsp,
+ if(H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE30, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
@@ -2256,7 +2218,7 @@ test_fs_sect_change_class(hid_t fapl)
if(TEST_sect_free((H5FS_section_info_t *)node) < 0)
TEST_ERROR
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node2) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -2265,12 +2227,12 @@ test_fs_sect_change_class(hid_t fapl)
sect_node2 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
@@ -2278,7 +2240,7 @@ test_fs_sect_change_class(hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
/*
* TEST 2
@@ -2290,14 +2252,14 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2312,7 +2274,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2324,7 +2286,7 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2336,17 +2298,17 @@ test_fs_sect_change_class(hid_t fapl)
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node3,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
/* change the class of B to A's class */
- if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node2,
TEST_FSPACE_SECT_TYPE) < 0)
TEST_ERROR
/* change the class of C to A's class */
- if (H5FS_sect_change_class(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node3,
+ if (H5FS_sect_change_class(f, frsp, (H5FS_section_info_t *)sect_node3,
TEST_FSPACE_SECT_TYPE) < 0)
TEST_ERROR
@@ -2356,7 +2318,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section B has changed class */
- if(H5FS_sect_find(f, dxpl_id, frsp,
+ if(H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE50, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
@@ -2367,7 +2329,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* verify that section C has changed class */
- if(H5FS_sect_find(f, dxpl_id, frsp,
+ if(H5FS_sect_find(f, frsp,
(hsize_t)TEST_SECT_SIZE80, (H5FS_section_info_t **)&node) < 0)
FAIL_STACK_ERROR
@@ -2378,7 +2340,7 @@ test_fs_sect_change_class(hid_t fapl)
TEST_ERROR
/* remove section A from free-space */
- if(H5FS_sect_remove(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1) < 0)
+ if(H5FS_sect_remove(f, frsp, (H5FS_section_info_t *)sect_node1) < 0)
FAIL_STACK_ERROR
/* Free the section node(s) */
@@ -2387,22 +2349,20 @@ test_fs_sect_change_class(hid_t fapl)
sect_node1 = NULL;
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return 0;
@@ -2413,9 +2373,8 @@ error:
if(sect_node2)
TEST_sect_free((H5FS_section_info_t *)sect_node2);
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_sect_change_class() */
@@ -2455,7 +2414,6 @@ static unsigned
test_fs_sect_extend(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -2476,14 +2434,11 @@ test_fs_sect_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
/*
* TEST 1
@@ -2491,7 +2446,7 @@ test_fs_sect_extend(hid_t fapl)
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2506,7 +2461,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2526,7 +2481,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2538,7 +2493,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend a block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_SIZE80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
FAIL_STACK_ERROR
if(FALSE == status)
TEST_ERROR
@@ -2551,23 +2506,23 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- PASSED()
+ PASSED();
/*
* TEST 2
*/
TESTING("a block's extension by requested-size which is > adjoining free section's size: Test 2");
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2582,7 +2537,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2602,7 +2557,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2614,7 +2569,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE50, 0, NULL)) < 0)
FAIL_STACK_ERROR
if(TRUE == status)
TEST_ERROR
@@ -2624,23 +2579,23 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- PASSED()
+ PASSED();
/*
* Test 3
*/
TESTING("a block's extension by requested-size which is < adjoining free section's size: Test 3");
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2655,7 +2610,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2675,7 +2630,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2687,7 +2642,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, (hsize_t)TEST_SECT_SIZE30, 0, NULL)) < 0)
TEST_ERROR
if(FALSE == status)
TEST_ERROR
@@ -2698,23 +2653,23 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- PASSED()
+ PASSED();
/*
* TEST 4
*/
TESTING("a block's extension by requested-size which does not adjoin any free section: Test 4");
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2729,7 +2684,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node1,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node1,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2749,7 +2704,7 @@ test_fs_sect_extend(hid_t fapl)
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node2,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node2,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
@@ -2761,7 +2716,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Extend the block by requested-size */
- if((status = H5FS_sect_try_extend(f, dxpl_id, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
+ if((status = H5FS_sect_try_extend(f, frsp, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE15, (hsize_t)TEST_SECT_SIZE40, 0, NULL)) < 0)
TEST_ERROR
if(TRUE == status)
TEST_ERROR
@@ -2771,31 +2726,28 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- PASSED()
+ PASSED();
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
return 0;
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_sect_extend() */
@@ -2813,7 +2765,6 @@ static unsigned
test_fs_sect_iterate(hid_t fapl)
{
hid_t file = -1; /* File ID */
- hid_t dxpl_id = -1; /* dxpl ID (for tag) */
char filename[FILENAME_LEN]; /* Filename to use */
H5F_t *f = NULL; /* Internal file object pointer */
H5FS_t *frsp = NULL; /* pointer to free space structure */
@@ -2837,7 +2788,7 @@ test_fs_sect_iterate(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2845,14 +2796,11 @@ test_fs_sect_iterate(hid_t fapl)
udata.tot_size = 0;
udata.tot_sect_count = 0;
- /* Create the dxpl and tag it with the global free space tag */
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
- FAIL_STACK_ERROR
- if(H5AC_tag(dxpl_id, H5AC__FREESPACE_TAG, NULL) < 0)
- FAIL_STACK_ERROR
+ /* Tag with the global free space tag */
+ H5AC_tag(H5AC__FREESPACE_TAG, NULL);
init_flags = H5FS_CLS_SEPAR_OBJ;
- if(NULL == (frsp = H5FS_create(f, dxpl_id, &fs_addr,
+ if(NULL == (frsp = H5FS_create(f, &fs_addr,
&cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
FAIL_STACK_ERROR
@@ -2866,12 +2814,12 @@ test_fs_sect_iterate(hid_t fapl)
sect_size = (unsigned)((i-1) % 9) + 1;
init_sect_node(sect_node, (haddr_t)i*10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
- if(H5FS_sect_add(f, dxpl_id, frsp, (H5FS_section_info_t *)sect_node,
+ if(H5FS_sect_add(f, frsp, (H5FS_section_info_t *)sect_node,
H5FS_ADD_RETURNED_SPACE, NULL) < 0)
FAIL_STACK_ERROR
} /* end for */
- if(H5FS_sect_iterate(f, dxpl_id, frsp, TEST_sects_cb, &udata) < 0)
+ if(H5FS_sect_iterate(f, frsp, TEST_sects_cb, &udata) < 0)
TEST_ERROR
H5FS_sect_stats(frsp, &tot_space, &nsects);
@@ -2882,31 +2830,28 @@ test_fs_sect_iterate(hid_t fapl)
TEST_ERROR
/* Close the free space manager */
- if(H5FS_close(f, dxpl_id, frsp) < 0)
+ if(H5FS_close(f, frsp) < 0)
FAIL_STACK_ERROR
frsp = NULL;
/* Delete free space manager */
- if(H5FS_delete(f, dxpl_id, fs_addr) < 0)
+ if(H5FS_delete(f, fs_addr) < 0)
FAIL_STACK_ERROR
fs_addr = HADDR_UNDEF;
- /* Close the file and dxpl */
+ /* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(dxpl_id) < 0)
- FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return 0;
error:
H5E_BEGIN_TRY {
if(frsp)
- H5FS_close(f, dxpl_id, frsp);
+ H5FS_close(f, frsp);
H5Fclose(file);
- H5Pclose(dxpl_id);
} H5E_END_TRY;
return 1;
} /* test_fs_sect_iterate() */
@@ -2917,12 +2862,7 @@ main(void)
{
hid_t fapl = -1; /* File access property list for data files */
unsigned nerrors = 0; /* Cumulative error count */
- const char *env_h5_drvr = NULL; /* File Driver value from environment */
-
- /* Get the VFD to use */
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
@@ -2931,6 +2871,10 @@ main(void)
PUTS_ERROR("Can't get VFD-dependent fapl")
} /* end if */
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* make sure alignment is not set for tests to succeed */
if(H5Pset_alignment(fapl, (hsize_t)1, (hsize_t)1) < 0) {
nerrors++;
@@ -2953,6 +2897,10 @@ main(void)
goto error;
HDputs("All free-space tests passed.");
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
h5_cleanup(FILENAME, fapl);
HDexit(EXIT_SUCCESS);
@@ -2961,6 +2909,9 @@ error:
H5E_BEGIN_TRY {
H5Pclose(fapl);
} H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
HDexit(EXIT_FAILURE);
} /* main() */
diff --git a/test/gen_bad_compound.c b/test/gen_bad_compound.c
index c52eb95..292659c 100644
--- a/test/gen_bad_compound.c
+++ b/test/gen_bad_compound.c
@@ -61,7 +61,7 @@ int main()
aid = H5Acreate(gid, "attr", cmpd_dt, sid, H5P_DEFAULT);
assert(aid > 0);
- /* Commit the datatype */
+ /* Commit the datatype */
ret = H5Tcommit(file, "cmpnd", cmpd_dt);
assert(ret >= 0);
diff --git a/test/gen_bad_offset.c b/test/gen_bad_offset.c
index 82e94cd..b485e36 100644
--- a/test/gen_bad_offset.c
+++ b/test/gen_bad_offset.c
@@ -28,8 +28,8 @@
/*-------------------------------------------------------------------------
* Function: main
*
- * Generate an HDF5 file with groups, datasets and symbolic links.
- * After the file is generated, write bad offset values to
+ * Generate an HDF5 file with groups, datasets and symbolic links.
+ * After the file is generated, write bad offset values to
* the heap at 3 locations in the file:
* (A) Open the file:
* fd = HDopen(TESTFILE, O_RDWR, 0663);
@@ -37,7 +37,7 @@
* (1) HDlseek(fd, (HDoff_t)880, SEEK_SET);
* "/group1/group2": replace heap offset "8" by bad offset
* (2) HDlseek(fd, (HDoff_t)1512, SEEK_SET);
- * "/dsetA": replace name offset into private heap "72" by bad offset
+ * "/dsetA": replace name offset into private heap "72" by bad offset
* (3) HDlseek(fd, (HDoff_t)1616, SEEK_SET);
* /soft_one: replace link value offset in the scratch pad "32" by bad offset
* (C) Write the bad offset value to the file for (1), (2) and (3):
@@ -98,7 +98,7 @@ main(void)
if(H5Fclose(fid) < 0)
FAIL_STACK_ERROR
- /*
+ /*
* Write bad offset values at 3 locations in the file
*/
diff --git a/test/gen_bogus.c b/test/gen_bogus.c
index ec29eb9..1ab18a4 100644
--- a/test/gen_bogus.c
+++ b/test/gen_bogus.c
@@ -37,12 +37,12 @@
#ifdef H5O_ENABLE_BOGUS
/*
- * Create datasets in the location (in "/" or "/group") with
+ * Create datasets in the location (in "/" or "/group") with
* message id: (a) H5O_BOGUS_VALID_ID or (b)H5O_BOGUS_INVALID_ID
* and various unknown message flags
*/
static int
-generate_datasets(hid_t loc_id, unsigned bogus_id)
+generate_datasets(hid_t loc_id, unsigned bogus_id)
{
hid_t sid = -1; /* Dataspace ID */
hid_t dcpl = -1; /* Dataset creation property list ID */
@@ -89,6 +89,14 @@ generate_datasets(hid_t loc_id, unsigned bogus_id)
if((did = H5Dcreate2(loc_id, "Dataset4", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
+ /* Set "shareable" message flag for bogus message */
+ bogus_flags = H5O_MSG_FLAG_SHAREABLE;
+ if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error;
+
+ /* Create fourth dataset, with "shareable" message flag */
+ if((did = H5Dcreate2(loc_id, "Dataset5", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
+ if(H5Dclose(did) < 0) goto error;
+
/* Close dataset creation property list */
if(H5Pclose(dcpl) < 0) goto error;
diff --git a/test/gen_bounds.c b/test/gen_bounds.c
new file mode 100644
index 0000000..2f696e6
--- /dev/null
+++ b/test/gen_bounds.c
@@ -0,0 +1,1172 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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: This program is to generate HDF5 data files used to test
+ * version bounds.
+ *
+ * Description
+ * ===========
+ * gen_bounds.c will generate the following files:
+ * - bounds_earliest_latest.h5
+ * - bounds_earliest_v18.h5
+ * - bounds_latest_latest.h5
+ * - bounds_v18_latest.h5
+ * - bounds_v18_v18.h5
+ * These files are copied to 1.6 and 1.8 libraries for verifying
+ * that they can or cannot read particular file format.
+ */
+
+/*
+ * Add two routines gen_ref_files() and gen_sel_files() to generate the
+ * following test files:
+ *
+ * (1) gen_ref_files():
+ * bounds_ref_earliest_latest.h5
+ * bounds_ref_latest_latest.h5
+ * bounds_ref_v110_v110.h5
+ * bounds_ref_v18_v18.h5
+ * (1) gen_sel_files():
+ * bounds_sel_earliest_latest.h5
+ * bounds_sel_latest_latest.h5
+ * bounds_sel_v112_v112.h5
+ * bounds_sel_v110_v110.h5
+ *
+ * These test files will be copied to 1.12, 1.10 and 1.8 libraries for
+ * compatibility testing.
+ */
+#include "h5test.h"
+
+/*
+ * Defines for gen_ref_files()
+ */
+/* File names used for references */
+#define FILENAME_REF_E_L "bounds_ref_earliest_latest.h5"
+#define FILENAME_REF_L_L "bounds_ref_latest_latest.h5"
+#define FILENAME_REF_V112_V112 "bounds_ref_v112_v112.h5"
+#define FILENAME_REF_V110_V110 "bounds_ref_v110_v110.h5"
+#define FILENAME_REF_V18_V18 "bounds_ref_v18_v18.h5"
+
+/* Dataset names for references */
+#define REVISED_REFS_DSET "Revised_refs_dset"
+#define OLD_REF_OBJ_DSET "Old_ref_object_dset"
+#define OLD_REF_REG_DSET "Old_ref_region_dset"
+
+#define GROUP "Group"
+#define ATTR "Attr"
+#define DATASET "Dataset"
+#define POWER32 4294967296 /* 2^32 */
+
+/*
+ * Defines for gen_sel_files()
+ */
+/* File names for hyperslab/point selections */
+#define FILENAME_SEL_E_L "bounds_sel_earliest_latest.h5"
+#define FILENAME_SEL_L_L "bounds_sel_latest_latest.h5"
+#define FILENAME_SEL_V112_V112 "bounds_sel_v112_v112.h5"
+#define FILENAME_SEL_V110_V110 "bounds_sel_v110_v110.h5"
+
+/* Dataset names for hyperslab/point selections */
+#define SEL_EX_REG_DSET "Sel_ex32_reg_dset"
+#define SEL_EX_IRR_DSET "Sel_ex32_irr_dset"
+#define SEL_EX_PT_DSET "Sel_ex32_pt_dset"
+
+
+/***********************************************************************
+ * gen_earliest_latest() creates file "bounds_earliest_latest.h5"
+ *
+ * File contents:
+ * - Version 0 superblock (default)
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+
+/* File names for different file format */
+#define FILENAME_E_L "bounds_earliest_latest.h5"
+#define FILENAME_E_18 "bounds_earliest_v18.h5"
+#define FILENAME_L_L "bounds_latest_latest.h5"
+#define FILENAME_18_L "bounds_v18_latest.h5"
+#define FILENAME_18_18 "bounds_v18_v18.h5"
+
+/* 2-D dataset with fixed dimensions */
+#define RANK 2
+#define DIM1 100
+#define DIM2 200
+#define CHK_DIM1 50
+#define CHK_DIM2 50
+
+static herr_t gen_earliest_latest(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the earliest/latest version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_E_L, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Close property list and dataset, will reuse dataspace */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts)
+ */
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Disable partial chunk filters, triggers layout version 4 */
+ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_earliest_latest */
+
+/***********************************************************************
+ * gen_earliest_v18() creates file "bounds_earliest_v18.h5"
+ *
+ * File contents:
+ * - Version 0 superblock (default)
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_earliest_v18(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the earliest/v18 version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_E_18, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_earliest_v18 */
+
+/***********************************************************************
+ * gen_latest_latest() creates file "bounds_latest_latest.h5"
+ *
+ * NOTE: As of March 2018, latest is 1.10.
+ *
+ * File contents:
+ * - Version 3 superblock (NOTE: this can also be triggered by passing in
+ * H5F_ACC_SWMR_WRITE, in place of H5F_ACC_TRUNC, to H5Fcreate)
+ * - A chunked dataset with layout version 4, "DS_chunked_layout_4".
+ * (triggered by H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_latest_latest(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the latest/latest version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Create the file with version 3 superblock */
+ fid = H5Fcreate(FILENAME_L_L, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ if (fid < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Disable partial chunk filters, triggers layout version 4 */
+ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_latest_latest */
+
+/***********************************************************************
+ * gen_v18_latest() creates file "bounds_v18_latest.h5"
+ *
+ * NOTE: As of March 2018, latest is 1.10.
+ *
+ * File contents:
+ * - Version 2 superblock
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_v18_latest(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the v18/latest version of the format" bounds
+ for creating objects in the file, also trigger version 2 superblock */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_18_L, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close property list and dataset, will reuse dataspace */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_v18_latest */
+
+/***********************************************************************
+ * gen_v18_v18() creates file "bounds_v18_v18.h5"
+ *
+ * File contents:
+ * - Version 2 superblock (H5Pset_libver_bounds(v18, v18)
+ * - A chunked dataset with layout version 3, "DS_chunked_layout_3". (default)
+ * - A chunked dataset with layout version 4, "DS_chunked_layout_4". (H5Pset_chunk_opts)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_v18_v18(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t fcpl = -1; /* File creation property list ID */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ float *buf = NULL; /* Buffer for writing data */
+ float *bufp = NULL; /* Pointer to data buffer */
+ hsize_t dims[RANK] = {DIM1, DIM2}; /* Dimensions */
+ hsize_t chunk_dims[RANK] = {CHK_DIM1, CHK_DIM2}; /* Dimensions of chunk */
+ int i, j;
+ herr_t ret = SUCCEED; /* Generic return value */
+
+ /* Create file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the v18 version of the format" bounds
+ for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0)
+ TEST_ERROR;
+
+ /* Create file */
+ if((fid = H5Fcreate(FILENAME_18_18, H5F_ACC_TRUNC, fcpl, fapl)) <0)
+ TEST_ERROR;
+
+ /* Close file property lists */
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Pclose(fcpl) < 0) TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 3 (default)
+ */
+
+ buf = (float *)HDmalloc((size_t)DIM1 * (size_t)DIM2 * sizeof(float));
+ if (buf == NULL) TEST_ERROR;
+
+ /* Fill sample data */
+ bufp = buf;
+ for (i = 0; i < DIM1; i++)
+ for (j = 0; j < DIM2; j++)
+ *bufp = 100.0F;
+
+ /* Create the dataspace */
+ if((space = H5Screate_simple(RANK, dims, NULL)) < 0) TEST_ERROR;
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_3", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Close property list and dataset, will reuse dataspace */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+
+ /* Close the file, then reopen it with the latest version */
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set the "use the v18/latest version of the format" bounds
+ for creating a layout version 4 object in the file */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ if((fid = H5Fopen(FILENAME_18_18, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR;
+
+ /*
+ * Add a chunked dataset with layout version 4 (H5Pset_chunk_opts)
+ */
+
+ /* Create the dataset creation property list */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+
+ /* Set up for chunked data */
+ if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) TEST_ERROR;
+
+ /* Disable partial chunk filters */
+ if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0)
+ TEST_ERROR;
+
+ /* Create and write the dataset */
+ dset = H5Dcreate2(fid, "DS_chunked_layout_4", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (dset < 0) TEST_ERROR;
+ ret = H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR;
+
+ /* Release allocated buffer */
+ HDfree(buf);
+ bufp = buf = NULL;
+
+ /* Close everything */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
+ if(H5Pclose(fapl) < 0) TEST_ERROR;
+ if(H5Dclose(dset) < 0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
+ if(H5Fclose(fid) < 0) TEST_ERROR;
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Pclose(fcpl);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(buf);
+ } H5E_END_TRY;
+ return FAIL;
+} /* gen_v18_v18 */
+
+/***********************************************************************
+ * gen_sel_files() is used to create the following test files:
+ * bounds_sel_earliest_latest.h5
+ * bounds_sel_latest_latest.h5
+ * bounds_sel_v112_v112.h5
+ * bounds_sel_v110_v110.h5
+ *
+ * File contents for:
+ * --bounds_sel_earliest_latest.h5
+ * --bounds_sel_latest_latest.h5
+ * --bounds_sel_v112_v112.h5
+ * --each file contains 3 datasets with old region reference type
+ * (1) Sel_ex32_reg_dset:
+ * --regular hyperslab selection exceeding 32 bits integer limit
+ * (2) Sel_ex32_irr_dset:
+ * --irregular hyperslab selection exceeding 32 bits integer limit
+ * (3) Sel_ex32_pt_dset:
+ * --point selection exceeding 32 bits integer limit
+ *
+ * File contents for:
+ * --bounds_ref_v110_v110.h5
+ * (1) Sel_ex32_reg_dset: a dataset with old region reference type
+ * --regular hyperslab selection exceeding 32 bits integer limit
+ * (2) Sel_ex32_irr_dset: does not exist, cannot be created
+ * (3) Sel_ex32_pt_dset: does not exist, cannot be created
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_sel_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bound)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hsize_t numparticles = 8388608;
+ hsize_t total_particles = numparticles * 513;
+ hsize_t vdsdims[1] = {total_particles}; /* Dataset dimension size */
+ hsize_t coord[4]; /* Point selection */
+ hsize_t ref_start; /* Starting location of hyperslab */
+ hsize_t ref_stride; /* Stride of hyperslab */
+ hsize_t ref_count; /* Element count of hyperslab */
+ hsize_t ref_block; /* Block size of hyperslab */
+ hid_t ref_sid = H5I_INVALID_HID; /* Dataspace ID for the reference dataset */
+ hid_t ref_did = H5I_INVALID_HID; /* Dataset ID for the reference dataset */
+ hsize_t ref_dims[1] = {1}; /* Dimension for reference dataset */
+ hdset_reg_ref_t ref_wbuf[1]; /* Buffer for dataset region reference */
+
+ /*
+ * Create test file, attribute, group and dataset
+ */
+
+ /* Create the test file */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create a dataset */
+ if((sid = H5Screate_simple(1, vdsdims, NULL)) < 0)
+ TEST_ERROR;
+
+ if((did = H5Dcreate2(fid, DATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(did) < 0)
+ TEST_ERROR;
+
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ TEST_ERROR;
+
+ /* Set to use the low/high bounds in fapl */
+ if(H5Pset_libver_bounds(fapl, low_bound, high_bound) < 0)
+ TEST_ERROR;
+
+ /* Open the file with fapl */
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR;
+
+ /* Open the dataset */
+ if((did = H5Dopen2(fid, DATASET, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Get the dataset's dataspace */
+ if((sid = H5Dget_space(did)) < 0)
+ TEST_ERROR;
+
+ /* Create dataspace for the reference dataset */
+ ref_dims[0] = 1;
+ if((ref_sid = H5Screate_simple(1, ref_dims, NULL)) < 0)
+ TEST_ERROR;
+
+ /* Generate regular hyperslab exceeding 32 */
+ ref_start = 0;
+ ref_count = 2;
+ ref_block = 4;
+ ref_stride = POWER32;
+
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, &ref_start, &ref_stride, &ref_count, &ref_block) < 0)
+ TEST_ERROR;
+
+ /* Should succeed for v110 and above */
+ if(high_bound >= H5F_LIBVER_V110) {
+
+ /* Create the first reference */
+ if(H5Rcreate(&ref_wbuf[0], fid, DATASET, H5R_DATASET_REGION, sid) < 0)
+ TEST_ERROR;
+
+ /* Create the reference datset */
+ if((ref_did = H5Dcreate2(fid, SEL_EX_REG_DSET, H5T_STD_REF_DSETREG, ref_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Write to the reference datset */
+ if(H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(ref_did) < 0)
+ TEST_ERROR;
+ }
+
+ /* Generate irregular hyperslab exceeding 32 */
+ ref_start = 8;
+ ref_count = 5;
+ ref_block = 2;
+ ref_stride = POWER32;
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_OR, &ref_start, &ref_stride, &ref_count, &ref_block) < 0)
+ TEST_ERROR;
+
+ /* Should succeed for v112 and above */
+ if(high_bound >= H5F_LIBVER_V112) {
+
+ /* Create the second reference */
+ if(H5Rcreate(&ref_wbuf[0], fid, DATASET, H5R_DATASET_REGION, sid) < 0)
+ TEST_ERROR;
+
+ /* Create the reference datset */
+ if((ref_did = H5Dcreate2(fid, SEL_EX_IRR_DSET, H5T_STD_REF_DSETREG, ref_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Write to the reference datset */
+ if(H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(ref_did) < 0)
+ TEST_ERROR;
+ }
+
+ /* Generate point selection exceeding 32 */
+ coord[0] = 5;
+ coord[1] = 15;
+ coord[2] = POWER32 + 1;
+ coord[3] = 19;
+
+ if(H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)4, coord) < 0)
+ TEST_ERROR;
+
+ /* Should succeed for v112 and above */
+ if(high_bound >= H5F_LIBVER_V112) {
+
+ /* Create the third reference */
+ if(H5Rcreate(&ref_wbuf[0], fid, DATASET, H5R_DATASET_REGION, sid) < 0)
+ TEST_ERROR;
+
+ /* Create the reference datset */
+ if((ref_did = H5Dcreate2(fid, SEL_EX_PT_DSET, H5T_STD_REF_DSETREG, ref_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Write to the reference datset */
+ if(H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(ref_did) < 0)
+ TEST_ERROR;
+ }
+
+ /* Closing */
+ if(H5Sclose(ref_sid) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(did) < 0)
+ TEST_ERROR;
+
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(ref_did);
+ H5Sclose(ref_sid);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* gen_sel_files() */
+
+/***********************************************************************
+ * gen_ref_files() is used to create the following test files:
+ * bounds_ref_earliest_latest.h5
+ * bounds_ref_latest_latest.h5
+ * bounds_ref_v110_v110.h5
+ * bounds_ref_v18_v18.h5
+ *
+ * File contents for:
+ * --bounds_ref_earliest_latest.h5
+ * --bounds_ref_latest_latest.h5
+ * --bounds_ref_v112_v112.h5
+ * (1) Revised_refs_dset: a dataset created with the revised reference type
+ * --attribute reference
+ * --object reference
+ * --dataset region reference
+ * (2) Old_ref_object_dset:
+ * --a dataset created with the old object reference type
+ * (3) Old_ref_region_dset:
+ * --a dataset created with the old dataset region reference type
+ *
+ * File contents for:
+ * --bounds_ref_v110_v110.h5
+ * --bounds_ref_v18_v18.h5
+ * (1) Old_ref_object_dset:
+ * --a dataset created with the old object reference type
+ * (2) Old_ref_region_dset:
+ * --a dataset created with the old dataset region reference type
+ *
+ * Return: SUCCEED/FAIL
+ *
+ ***********************************************************************/
+static herr_t gen_ref_files(const char *filename, H5F_libver_t low_bound, H5F_libver_t high_bound)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t asid = H5I_INVALID_HID; /* Dataspace ID for attribute */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hsize_t dims[1] = {100}; /* Dimension size */
+ unsigned *dwbuf = NULL; /* Buffer for writing data */
+ hid_t ref_sid = H5I_INVALID_HID; /* Dataspace ID for the reference dataset */
+ hid_t ref_did = H5I_INVALID_HID; /* Dataset ID for the reference dataset */
+ hsize_t rev_ref_dims[1] = {3}; /* Dimension size for the reference dataset */
+ H5R_ref_t rev_ref_wbuf[3]; /* Buffer for storing the revised references */
+ hobj_ref_t old_ref_obj_wbuf[1]; /* Buffer for storing the old reference object */
+ hdset_reg_ref_t old_ref_reg_wbuf[1]; /* Buffer for storing the old dataset region reference */
+ hsize_t old_ref_dims[] = {1}; /* Dimension size for the reference dataset */
+ hsize_t start[1]; /* Starting location of hyperslab */
+ hsize_t stride[1]; /* Stride of hyperslab */
+ hsize_t count[1]; /* Element count of hyperslab */
+ hsize_t block[1]; /* Block size of hyperslab */
+ unsigned i; /* Local index variable */
+
+ /*
+ * Create test file, attribute, group and dataset
+ */
+
+ if((dwbuf = HDcalloc(sizeof(unsigned), 100)) == NULL)
+ TEST_ERROR;
+
+ /* Create the test file */
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create dataspace for the attribute */
+ if((asid = H5Screate(H5S_SCALAR)) < 0)
+ TEST_ERROR;
+
+ /* Create an attribute to the root group */
+ if((aid = H5Acreate2(fid, ATTR, H5T_NATIVE_UINT, asid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create a group */
+ if((gid = H5Gcreate2(fid, GROUP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create dataspace for the dataset */
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR;
+
+ /* Create a dataset in the group */
+ if((did = H5Dcreate2(gid, DATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Initialize data to write */
+ for(i = 0; i < 100; i++)
+ dwbuf[i] = i * 3;
+
+ /* Write data to disk */
+ if(H5Dwrite(did, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf) < 0)
+ TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(did) < 0)
+ TEST_ERROR;
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if(H5Sclose(asid) < 0)
+ TEST_ERROR;
+ if(H5Aclose(aid) < 0)
+ TEST_ERROR;
+ if(H5Gclose(gid) < 0)
+ TEST_ERROR;
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ if(dwbuf) {
+ HDfree(dwbuf);
+ dwbuf = NULL;
+ }
+
+ /* Create file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR;
+
+ /* Set to use the low/high bounds in fapl */
+ if(H5Pset_libver_bounds(fapl, low_bound, high_bound) < 0)
+ TEST_ERROR;
+
+ /* Open the file with fapl */
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) <0)
+ TEST_ERROR;
+
+ /*
+ * Create the revised and old references in the file
+ */
+
+ /* Retrieve dataspace for the existing dataset */
+ if((did = H5Dopen2(fid, "/Group/Dataset", H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if((sid = H5Dget_space(did)) < 0)
+ TEST_ERROR;
+
+ /* Select 15 2x1 hyperslabs for the dataset region reference */
+ start[0] = 2;
+ stride[0] = 5;
+ count[0] = 15;
+ block[0] = 2;
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR;
+
+
+ if(high_bound >= H5F_LIBVER_V112) {
+
+ /* Create dataspace for the reference dataset */
+ if((ref_sid = H5Screate_simple(1, rev_ref_dims, NULL)) < 0)
+ TEST_ERROR;
+
+ /* Create a dataset with the revised reference type */
+ ref_did = H5Dcreate2(fid, REVISED_REFS_DSET, H5T_STD_REF, ref_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* Store the reference to "Attr" */
+ if(H5Rcreate_attr(fid, "/", "Attr", H5P_DEFAULT, &rev_ref_wbuf[0]) < 0)
+ TEST_ERROR;
+
+ /* Store the reference to /Group */
+ if(H5Rcreate_object(fid, "/Group", H5P_DEFAULT, &rev_ref_wbuf[1]) < 0)
+ TEST_ERROR;
+
+ /* Store the dataset region referenced to /Group/Dataset */
+ if(H5Rcreate_region(fid, "/Group/Dataset", sid, H5P_DEFAULT, &rev_ref_wbuf[2]) < 0)
+ TEST_ERROR;
+
+ /* Write to the reference dataset */
+ if(H5Dwrite(ref_did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rev_ref_wbuf) < 0)
+ TEST_ERROR;
+
+ /* Destroy references */
+ for(i = 0; i < 3; i++)
+ if(H5Rdestroy(&rev_ref_wbuf[i]) < 0)
+ TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(ref_did) < 0)
+ TEST_ERROR;
+
+ if(H5Sclose(ref_sid) < 0)
+ TEST_ERROR;
+ }
+
+ /* Create dataspace for the reference dataset */
+ if((ref_sid = H5Screate_simple(1, old_ref_dims, NULL)) < 0)
+ TEST_ERROR;
+
+ /* Create a dataset with the old object reference type */
+ if((ref_did = H5Dcreate2(fid, OLD_REF_OBJ_DSET, H5T_STD_REF_OBJ, ref_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create reference to /Group */
+ if(H5Rcreate(&old_ref_obj_wbuf[0], fid, "/Group", H5R_OBJECT, -1) < 0)
+ TEST_ERROR;
+
+ /* Write to the reference dataset */
+ if(H5Dwrite(ref_did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, old_ref_obj_wbuf) < 0)
+ TEST_ERROR;
+
+ /* Close the dataset */
+ if(H5Dclose(ref_did) < 0)
+ TEST_ERROR;
+
+
+ /* Create a dataset with the old dataset region reference type */
+ if((ref_did = H5Dcreate2(fid, OLD_REF_REG_DSET, H5T_STD_REF_DSETREG, ref_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Create dataset region reference */
+ if(H5Rcreate(&old_ref_reg_wbuf[0], fid, "/Group/Dataset", H5R_DATASET_REGION, sid) < 0)
+ TEST_ERROR;
+
+ /* Write selection to the reference dataset */
+ if(H5Dwrite(ref_did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, old_ref_reg_wbuf) < 0)
+ TEST_ERROR;
+
+ /* Closing */
+ if(H5Dclose(ref_did) < 0)
+ TEST_ERROR;
+ if(H5Sclose(ref_sid) < 0)
+ TEST_ERROR;
+
+ if(H5Dclose(did) < 0)
+ TEST_ERROR;
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if(H5Pclose(fapl) < 0)
+ TEST_ERROR;
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(ref_did);
+ H5Sclose(ref_sid);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Pclose(fapl);
+ H5Fclose(fid);
+ HDfree(dwbuf);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* gen_ref_files() */
+
+int main(void)
+{
+ /* Generate file bounds_earliest_latest.h5 */
+ if (gen_earliest_latest() < 0) TEST_ERROR;
+
+ /* Generate file bounds_earliest_v18.h5 */
+ if (gen_earliest_v18() < 0) TEST_ERROR;
+
+ /* Generate file bounds_latest_latest.h5 */
+ if (gen_latest_latest() < 0) TEST_ERROR;
+
+ /* Generate file bounds_v18_latest.h5 */
+ if (gen_v18_latest() < 0) TEST_ERROR;
+
+ /* Generate file bounds_v18_v18.h5 */
+ if (gen_v18_v18() < 0) TEST_ERROR;
+
+
+ /*
+ * Files generated via gen_ref_files()
+ */
+
+ /* Generate bounds_ref_earliest_latest.h5 */
+ if(gen_ref_files(FILENAME_REF_E_L, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_ref_latest_latest.h5 */
+ if(gen_ref_files(FILENAME_REF_L_L, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_ref_v112_v112.h5 */
+ if(gen_ref_files(FILENAME_REF_V112_V112, H5F_LIBVER_V112, H5F_LIBVER_V112) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_ref_v110_v110.h5 */
+ if(gen_ref_files(FILENAME_REF_V110_V110, H5F_LIBVER_V110, H5F_LIBVER_V110) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_ref_v18_v18.h5 */
+ if(gen_ref_files(FILENAME_REF_V18_V18, H5F_LIBVER_V18, H5F_LIBVER_V18) < 0)
+ TEST_ERROR;
+
+ /*
+ * Files generated via gen_sel_files()
+ */
+
+ /* Generate bounds_sel_earliest_latest.h5 */
+ if(gen_sel_files(FILENAME_SEL_E_L, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_sel_latest_latest.h5 */
+ if(gen_sel_files(FILENAME_SEL_L_L, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_sel_v112_v112.h5 */
+ if(gen_sel_files(FILENAME_SEL_V112_V112, H5F_LIBVER_V112, H5F_LIBVER_V112) < 0)
+ TEST_ERROR;
+
+ /* Generate bounds_sel_v110_v110.h5 */
+ if(gen_sel_files(FILENAME_SEL_V110_V110, H5F_LIBVER_V110, H5F_LIBVER_V110) < 0)
+ TEST_ERROR;
+
+ return EXIT_SUCCESS;
+
+error:
+ return EXIT_FAILURE;
+}
+
diff --git a/test/gen_cross.c b/test/gen_cross.c
index cf3fc35..105895d 100644
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -26,7 +26,6 @@
* worth keeping around for now.
*/
-#include <stdio.h>
#include "h5test.h"
#define H5FILE_NAME "data.h5"
@@ -79,7 +78,7 @@ int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid);
-
+
/*-------------------------------------------------------------------------
* Function: create_normal_dset
*
@@ -108,8 +107,8 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid)
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
- data[j][i] = ((float)(i + j + 1)) / 3;
+ for (i = 0; i < NY; i++)
+ data[j][i] = ((float)(i + j + 1)) / 3;
}
/*
* 1/3 2/3 3/3 4/3 5/3 6/3
@@ -143,7 +142,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid)
if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0)
TEST_ERROR
- /*
+ /*
* Close dataset
*/
if(H5Dclose(dataset) < 0)
@@ -163,7 +162,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid)
if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0)
TEST_ERROR
- /*
+ /*
* Close dataset
*/
if(H5Dclose(dataset) < 0)
@@ -186,7 +185,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dsets_float
*
@@ -277,7 +276,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dsets_double
*
@@ -307,8 +306,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid)
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
- data[j][i] = ((double)(i + j + 1))/3;
+ for (i = 0; i < NY; i++)
+ data[j][i] = ((double)(i + j + 1))/3;
}
/*
@@ -368,7 +367,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_char
*
@@ -467,7 +466,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_short
*
@@ -566,7 +565,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_int
*
@@ -596,8 +595,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid)
* Data and output buffer initialization.
*/
for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
- data[j][i] = i + j;
+ for (i = 0; i < NY; i++)
+ data[j][i] = i + j;
}
/*
* 0 1 2 3 4 5
@@ -665,7 +664,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_scale_offset_dset_long_long
*
@@ -765,7 +764,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_fletcher_dsets_float
*
@@ -856,7 +855,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_deflate_dsets_float
*
@@ -957,7 +956,7 @@ error:
}
#ifdef H5_HAVE_FILTER_SZIP
-
+
/*-------------------------------------------------------------------------
* Function: create_szip_dsets_float
*
@@ -1049,7 +1048,7 @@ error:
}
#endif /* H5_HAVE_FILTER_SZIP */
-
+
/*-------------------------------------------------------------------------
* Function: create_shuffle_dsets_float
*
@@ -1140,7 +1139,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: create_nbit_dsets_float
*
@@ -1225,7 +1224,7 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid)
TEST_ERROR
/* Now create a dataset with a big-endian type */
- if(H5Tset_order(datatype, H5T_ORDER_BE) < 0)
+ if(H5Tset_order(datatype, H5T_ORDER_BE) < 0)
TEST_ERROR
if((dataset = H5Dcreate2(fid, DATASETNAME23, datatype, fsid,
H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -1252,17 +1251,15 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* 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
*
*-------------------------------------------------------------------------
*/
@@ -1280,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
@@ -1292,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/gen_filespace.c b/test/gen_filespace.c
index 4397836..bf49b7b 100644
--- a/test/gen_filespace.c
+++ b/test/gen_filespace.c
@@ -29,7 +29,6 @@ const char *FILENAMES[] = {
#define NUM_ELMTS 100
#define FALSE 0
#define TRUE 1
-#define INC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)+1))
/*
* Compile and run this program in the trunk to generate
@@ -41,7 +40,7 @@ const char *FILENAMES[] = {
* Move these files to 1.8 branch for compatibility testing:
* test_filespace_compatible() in test/tfile.c will use these files.
*
- * Copy these files from the 1.8 branch back to the trunk for
+ * Copy these files from the 1.8 branch back to the trunk for
* compatibility testing via test_filespace_round_compatible() in test/tfile.c.
*
*/
@@ -58,7 +57,7 @@ int main(void)
unsigned fs_persist; /* Persisting free-space or not */
j = 0;
- for(fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_strategy < H5F_FSPACE_STRATEGY_NTYPES; INC_ENUM(H5F_fspace_strategy_t, fs_strategy)) {
+ for(fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_strategy < H5F_FSPACE_STRATEGY_NTYPES; fs_strategy++) {
for(fs_persist = FALSE; fs_persist <= TRUE; fs_persist++) {
if(fs_persist && fs_strategy >= H5F_FSPACE_STRATEGY_AGGR)
diff --git a/test/gen_filters.c b/test/gen_filters.c
index fa66078..9764830 100644
--- a/test/gen_filters.c
+++ b/test/gen_filters.c
@@ -29,9 +29,9 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts,
* Function: create_file_with_bogus_filter
*
* Purpose: Create a dataset with the fletcher filter.
- * This function is used to create the test file `test_filters.h5'
- * which has a dataset with the "fletcher" I/O filter. This dataset
- * will be used to verify the correct behavior of the library in
+ * This function is used to create the test file `test_filters.h5'
+ * which has a dataset with the "fletcher" I/O filter. This dataset
+ * will be used to verify the correct behavior of the library in
* the test "dsets"
*
* Return: Success: 0
@@ -168,7 +168,7 @@ create_file_with_bogus_filter(void)
/* create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- /* create chunking */
+ /* create chunking */
if(H5Pset_chunk(dcpl, rank, chunk_dims) < 0) goto error;
/* register bogus filter */
diff --git a/test/gen_new_super.c b/test/gen_new_super.c
index f6ce589..ed43a39 100644
--- a/test/gen_new_super.c
+++ b/test/gen_new_super.c
@@ -24,7 +24,7 @@
*/
#include <assert.h>
-#include "hdf5.h"
+#include "testhdf5.h"
#define TESTFILE "tsupern.h5"
#define ISTORE_IK 64
@@ -50,7 +50,7 @@ main(void)
{
hid_t file; /* File IDs for old & new files */
hid_t fcpl; /* File creation property list */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret;
/* Create a file creation property list */
fcpl = H5Pcreate(H5P_FILE_CREATE);
diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c
index 9d76deb..e4e75ac 100644
--- a/test/gen_nullspace.c
+++ b/test/gen_nullspace.c
@@ -24,8 +24,8 @@
* put into the 'test' directory in the 1.6.x branch of the library.
*/
-#include "hdf5.h"
#include <assert.h>
+#include "testhdf5.h"
#define NULLFILE "tnullspace.h5"
#define NULLDATASET "null_dataset"
@@ -39,7 +39,7 @@ main(void)
hid_t sid; /* Dataspace ID */
hid_t did; /* Dataset ID */
hid_t attr; /* Attribute ID */
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */
/* Create the file */
fid = H5Fcreate(NULLFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
diff --git a/test/gen_plist.c b/test/gen_plist.c
index 62693bd..b6f5597 100644
--- a/test/gen_plist.c
+++ b/test/gen_plist.c
@@ -37,7 +37,7 @@ main(void)
hid_t acpl1; /* attribute create prop. list */
herr_t ret = 0;
- hsize_t chunk_size = 16384; /* chunk size */
+ hsize_t chunk_size = 16384; /* chunk size */
int fill = 2; /* Fill value */
hsize_t max_size[1]; /* data space maximum size */
size_t nslots = 521 * 2;
@@ -125,23 +125,26 @@ main(void)
if((ret = H5Pset_fill_value(dcpl1, H5T_STD_I32BE, &fill)) < 0)
assert(ret > 0);
+ if((ret = H5Pset_dset_no_attrs_hint(dcpl1, FALSE)) < 0)
+ assert(ret > 0);
+
max_size[0] = 100;
- if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0,
+ if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
assert(ret > 0);
- if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0,
+ if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
assert(ret > 0);
- if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0,
+ if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
assert(ret > 0);
- if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0,
+ if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
assert(ret > 0);
if((ret = encode_plist(dcpl1, little_endian, word_length, "testfiles/plist_files/dcpl_")) < 0)
assert(ret > 0);
-
+
/* release resource */
if((ret = H5Pclose(dcpl1)) < 0)
assert(ret > 0);
@@ -153,13 +156,13 @@ main(void)
if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/def_dapl_")) < 0)
assert(ret > 0);
-
+
if((ret = H5Pset_chunk_cache(dapl1, nslots, nbytes, w0)) < 0)
assert(ret > 0);
if((ret = encode_plist(dapl1, little_endian, word_length, "testfiles/plist_files/dapl_")) < 0)
assert(ret > 0);
-
+
/* release resource */
if((ret = H5Pclose(dapl1)) < 0)
assert(ret > 0);
@@ -194,7 +197,7 @@ main(void)
if((ret = encode_plist(dxpl1, little_endian, word_length, "testfiles/plist_files/dxpl_")) < 0)
assert(ret > 0);
-
+
/* release resource */
if((ret = H5Pclose(dxpl1)) < 0)
assert(ret > 0);
@@ -225,7 +228,7 @@ main(void)
if((ret = encode_plist(gcpl1, little_endian, word_length, "testfiles/plist_files/gcpl_")) < 0)
assert(ret > 0);
-
+
/* release resource */
if((ret = H5Pclose(gcpl1)) < 0)
assert(ret > 0);
@@ -242,7 +245,7 @@ main(void)
if((ret = encode_plist(lcpl1, little_endian, word_length, "testfiles/plist_files/lcpl_")) < 0)
assert(ret > 0);
-
+
/* release resource */
if((ret = H5Pclose(lcpl1)) < 0)
assert(ret > 0);
@@ -265,7 +268,7 @@ main(void)
if((ret = encode_plist(ocpypl1, little_endian, word_length, "testfiles/plist_files/ocpypl_")) < 0)
assert(ret > 0);
-
+
/* release resource */
if((ret = H5Pclose(ocpypl1)) < 0)
assert(ret > 0);
@@ -363,9 +366,6 @@ main(void)
if((ret = H5Pset_mdc_image_config(fapl1, &my_cache_image_config)) < 0)
assert(ret > 0);
- if((ret = H5Pset_core_write_tracking(fapl1, TRUE, (size_t)(1024 * 1024))) < 0)
- assert(ret > 0);
-
if((ret = encode_plist(fapl1, little_endian, word_length, "testfiles/plist_files/fapl_")) < 0)
assert(ret > 0);
@@ -458,7 +458,7 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil
herr_t ret = 0;
void *temp_buf = NULL;
size_t temp_size = 0;
- ssize_t write_size;
+ ssize_t H5_ATTR_NDEBUG_UNUSED write_size;
char filename[1024];
/* Generate filename */
@@ -466,23 +466,23 @@ encode_plist(hid_t plist_id, int little_endian, int word_length, const char *fil
HDassert(ret > 0);
/* first call to encode returns only the size of the buffer needed */
- if((ret = H5Pencode(plist_id, NULL, &temp_size)) < 0)
+ if((ret = H5Pencode2(plist_id, NULL, &temp_size, H5P_DEFAULT)) < 0)
HDassert(ret > 0);
temp_buf = (void *)HDmalloc(temp_size);
HDassert(temp_buf);
- if((ret = H5Pencode(plist_id, temp_buf, &temp_size)) < 0)
+ if((ret = H5Pencode2(plist_id, temp_buf, &temp_size, H5P_DEFAULT)) < 0)
HDassert(ret > 0);
fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW);
- HDassert(fd > 0);
+ HDassert(fd >= 0);
write_size = HDwrite(fd, temp_buf, temp_size);
HDassert(write_size == (ssize_t)temp_size);
HDclose(fd);
-
+
HDfree(temp_buf);
return 1;
diff --git a/test/gen_specmetaread.c b/test/gen_specmetaread.c
index d06bd59..fd484d1 100644
--- a/test/gen_specmetaread.c
+++ b/test/gen_specmetaread.c
@@ -23,9 +23,10 @@
* the library on the trunk as of when this file is checked in.
*/
-#include "hdf5.h"
#include <assert.h>
+#include "testhdf5.h"
+
#define FILENAME "specmetaread.h5"
#define DIM 10
@@ -39,7 +40,7 @@ main(void)
hsize_t dim[1] = {DIM};
unsigned data[DIM];
unsigned u;
- herr_t ret; /* Generic return value */
+ herr_t H5_ATTR_NDEBUG_UNUSED ret;
/* Initialize the data */
for(u = 0; u < DIM; u++)
diff --git a/test/genall5.c b/test/genall5.c
index a48f14b..3f55930 100644
--- a/test/genall5.c
+++ b/test/genall5.c
@@ -12,11 +12,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Programmer: John Mainzer
- * 9/23/15
+ * 9/23/15
*
- * This file contains a heavily edited and functionaly reduce
- * version of the test code first written by Quincey in a file
- * of the same name.
+ * This file contains a heavily edited and functionaly reduce
+ * version of the test code first written by Quincey in a file
+ * of the same name.
*/
#include "cache_common.h"
@@ -32,7 +32,7 @@
* Function: ns_grp_0
*
* Purpose: Create an empty "new style" group at the specified location
- * in the specified file.
+ * in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -48,70 +48,59 @@
*/
void
-ns_grp_0(hid_t fid, const char *group_name)
-{
+ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pcreate() failed";
- }
- assert(gcpl > 0);
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pcreate() failed";
+ }
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pset_link_creation_order() failed";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gcreate2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gcreate2() failed";
}
- assert(gid > 0);
+ HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Pclose(gcpl) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_0: H5Gclose(gid) failed";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
@@ -138,97 +127,81 @@ ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void vrfy_ns_grp_0(hid_t fid, const char *group_name)
-{
+void vrfy_ns_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Gget_create_plist() failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ns_grp_0: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_0: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_0: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( 0 != grp_info.nlinks ) {
-
+ else if (0 != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.nlinks";
}
- else if ( 0 != grp_info.max_corder ) {
-
+ else if (0 != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: 0 != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: FALSE != grp_info.mounted";
}
@@ -240,12 +213,10 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_0: H5Gclose() failed";
}
@@ -253,15 +224,14 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
}
return;
-
} /* vrfy_ns_grp_0() */
/*-------------------------------------------------------------------------
* Function: ns_grp_c
*
- * Purpose: Create a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Create a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -276,68 +246,57 @@ void vrfy_ns_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
-ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+void
+ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pcreate(H5P_GROUP_CREATE) failed";
}
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pset_link_creation_order() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gcreate2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pget_link_phase_change() failed";
}
- else if ( nlinks <= 0 ) {
-
+ else if (nlinks <= 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks <= 0";
}
- else if ( nlinks >= max_compact ) {
-
+ else if (nlinks >= max_compact) {
pass = FALSE;
failure_mssg = "ns_grp_c: nlinks >= max_compact";
}
@@ -348,72 +307,59 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
+ HDsprintf(linkname, "%u", u);
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_soft() failed";
}
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_hard() failed";
}
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Lcreate_external() failed";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Pclose(gcpl) failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "ns_grp_c: H5Gclose(gid) failed";
}
@@ -428,8 +374,8 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_c
*
- * Purpose: Verify a compact "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a compact "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -445,8 +391,7 @@ ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -454,89 +399,73 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
+ if (gid <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gopen2() failed";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
+ if (gcpl <= 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_create_plist(gid) failed";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pget_link_creation_order() failed";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
+ else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ failure_mssg = "vrfy_ns_grp_c: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Pclose() failed";
}
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gget_info() failed";
}
- else if ( H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type ) {
-
+ else if (H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
+ failure_mssg =
+ "vrfy_ns_grp_c: H5G_STORAGE_TYPE_COMPACT != grp_info.storage_type";
}
- else if ( nlinks != grp_info.nlinks ) {
-
+ else if (nlinks != grp_info.nlinks) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.nlinks";
}
- else if ( nlinks != grp_info.max_corder ) {
-
+ else if (nlinks != grp_info.max_corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: nlinks != grp_info.max_corder";
}
- else if ( FALSE != grp_info.mounted ) {
-
+ else if ( FALSE != grp_info.mounted) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: FALSE != grp_info.mounted";
}
@@ -549,42 +478,36 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
- H5L_info_t lnk_info;
+ while ((pass) && (u < nlinks)) {
+ H5L_info2_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
+ if (link_exists < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
- ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
+ ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_info() failed";
}
- else if ( TRUE != lnk_info.corder_valid ) {
-
+ else if ( TRUE != lnk_info.corder_valid) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: TRUE != lnk_info.corder_valid";
}
- else if ( u != lnk_info.corder ) {
-
+ else if (u != lnk_info.corder) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: u != lnk_info.corder";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5T_CSET_ASCII != lnk_info.cset";
}
@@ -593,78 +516,73 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if ( 0 == (u % 3) ) {
-
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
+ if (H5L_TYPE_SOFT != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ failure_mssg = "vrfy_ns_grp_c: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
+ if (!slinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of slinkval failed";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
+ else if (0 != HDstrcmp(slinkval, group_name)) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(slinkval, group_name)";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
-
- H5O_info_t root_oinfo;
-
- if ( H5L_TYPE_HARD != lnk_info.type ) {
+ else if (1 == (u % 3)) {
+ H5O_info2_t root_oinfo;
+ int token_cmp = 0;
+ if (H5L_TYPE_HARD != lnk_info.type) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
- ret = H5Oget_info(fid, &root_oinfo);
-
- if ( ret < 0 ) {
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
+ ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: root_oinfo.addr != lnk_info.u.address";
+ else {
+ if(H5Otoken_cmp(fid, &root_oinfo.token, &lnk_info.u.token, &token_cmp) < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_c: H5Otoken_cmp() failed.";
+ }
+
+ if (token_cmp) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_c: root_oinfo.token != lnk_info.u.token";
+ }
}
HDassert(ret >= 0);
- HDassert(root_oinfo.addr == lnk_info.u.address);
+ HDassert(!token_cmp);
} /* end else-if */
else {
void *elinkval;
@@ -673,83 +591,70 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
+ failure_mssg = "vrfy_ns_grp_c: H5L_TYPE_EXTERNAL != lnk_info.type";
}
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
-
- if ( ! elinkval ) {
+ elinkval = HDmalloc(lnk_info.u.val_size);
+ if (!elinkval) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: malloc of elinkval failed.";
+ failure_mssg = "vrfy_ns_grp_c: HDmalloc of elinkval failed.";
}
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lget_val() failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size,
- NULL, &file, &path);
- if ( ret < 0 ) {
-
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Lunpack_elink_val() failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
+ else if (0 != HDstrcmp(file, "external.h5")) {
pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_c: 0 != strcmp(file, \"external.h5\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(file, \"external.h5\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
+ else if (0 != HDstrcmp(path, "/ext")) {
pass = FALSE;
- failure_mssg = "vrfy_ns_grp_c: 0 != strcmp(path, \"/ext\")";
+ failure_mssg = "vrfy_ns_grp_c: 0 != HDstrcmp(path, \"/ext\")";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
- free(elinkval);
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
+ if (ret < 0) {
pass = FALSE;
failure_mssg = "vrfy_ns_grp_c: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
return;
-
} /* vrfy_ns_grp_c() */
/*-------------------------------------------------------------------------
* Function: ns_grp_d
*
- * Purpose: Create a dense "new style" group, with 'nlinks'
- * (soft/hard/external) links in it in the specified file.
+ * Purpose: Create a dense "new style" group, with 'nlinks'
+ * (soft/hard/external) links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -765,153 +670,130 @@ vrfy_ns_grp_c(hid_t fid, const char *group_name, unsigned nlinks)
*/
void
-ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
unsigned max_compact;
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Pcreate(H5P_GROUP_CREATE);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pcreate() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pcreate() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_link_creation_order(gcpl, H5P_CRT_ORDER_TRACKED);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pset_link_creation_order() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, gcpl, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gcreate2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
max_compact = 0;
ret = H5Pget_link_phase_change(gcpl, &max_compact, NULL);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
- }
- else if ( nlinks <= max_compact ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: nlinks <= max_compact";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pget_link_phase_change() failed.";
+ }
+ else if (nlinks <= max_compact) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: nlinks <= max_compact";
+ }
HDassert(ret >= 0);
HDassert(nlinks > max_compact);
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
+ while ((pass) && (u < nlinks)) {
char linkname[16];
- sprintf(linkname, "%u", u);
-
- if(0 == (u % 3)) {
+ HDsprintf(linkname, "%u", u);
- ret = H5Lcreate_soft(group_name, gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ if (0 == (u % 3)) {
+ ret = H5Lcreate_soft(group_name, gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_soft() failed.";
+ }
HDassert(ret >= 0);
} /* end if */
- else if(1 == (u % 3)) {
-
- ret = H5Lcreate_hard(fid, "/", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ else if (1 == (u % 3)) {
+ ret = H5Lcreate_hard(fid, "/", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_hard() failed.";
+ }
HDassert(ret >= 0);
} /* end else-if */
else {
-
HDassert(2 == (u % 3));
- ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
- H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Lcreate_external("external.h5", "/ext", gid, linkname,
+ H5P_DEFAULT, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Lcreate_external() failed.";
+ }
HDassert(ret >= 0);
} /* end else */
u++;
-
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ns_grp_d() */
/*-------------------------------------------------------------------------
* Function: vrfy_ns_grp_d
*
- * Purpose: Verify a dense "new style" group, with 'nlinks'
- * soft/hard/external links in it in the specified file.
+ * Purpose: Verify a dense "new style" group, with 'nlinks'
+ * soft/hard/external links in it in the specified file.
*
* If pass is false on entry, do nothing.
*
@@ -928,8 +810,7 @@ ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
void
-vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
-{
+vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -937,93 +818,75 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gopen2() failed.";
}
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_create_plist() failed.";
}
- assert(gcpl > 0);
+ HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pget_link_creation_order() failed.";
}
- else if ( H5P_CRT_ORDER_TRACKED != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
+ else if (H5P_CRT_ORDER_TRACKED != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5P_CRT_ORDER_TRACKED != crt_order_flags";
}
HDassert(ret >= 0);
HDassert(H5P_CRT_ORDER_TRACKED == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_DENSE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
- }
- else if ( nlinks != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_DENSE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5G_STORAGE_TYPE_DENSE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.nlinks";
+ }
+ else if (nlinks != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: nlinks != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_DENSE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1032,118 +895,110 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
- H5L_info_t lnk_info;
+ while ((pass) && (u < nlinks)) {
+ H5L_info2_t lnk_info;
char linkname[16];
htri_t link_exists;
- sprintf(linkname, "%u", u);
+ HDsprintf(linkname, "%u", u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
- }
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lexists() failed.";
+ }
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
- ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
+ ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
- }
- else if ( TRUE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
- }
- else if ( u != lnk_info.corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
- }
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_info() failed.";
+ }
+ else if (TRUE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: TRUE != lnk_info.corder_valid";
+ }
+ else if (u != lnk_info.corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: u != lnk_info.corder";
+ }
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5T_CSET_ASCII != lnk_info.cset";
+ }
HDassert(ret >= 0);
HDassert(true == lnk_info.corder_valid);
HDassert(u == lnk_info.corder);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 3)) {
+ if (0 == (u % 3)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
- }
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_SOFT != lnk_info.type";
+ }
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of slinkval failed";
- }
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of slinkval failed";
+ }
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
- }
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(slinkval, group_name)";
- }
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Lget_val() failed";
+ }
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(slinkval, group_name)";
+ }
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
- else if(1 == (u % 3)) {
- H5O_info_t root_oinfo;
-
- if ( H5L_TYPE_HARD != lnk_info.type ) {
+ else if (1 == (u % 3)) {
+ H5O_info2_t root_oinfo;
+ int token_cmp = 0;
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
- }
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_HARD != lnk_info.type";
+ }
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
- ret = H5Oget_info(fid, &root_oinfo);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
- }
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: root_oinfo.addr != lnk_info.u.address";
- }
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
+ ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Oget_info() failed.";
+ }
+ else {
+ if(H5Otoken_cmp(fid, &root_oinfo.token, &lnk_info.u.token, &token_cmp) < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Otoken_cmp() failed.";
+ }
+
+ if (token_cmp) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: root_oinfo.token != lnk_info.u.token";
+ }
+ }
HDassert(ret >= 0);
- HDassert(root_oinfo.addr == lnk_info.u.address);
+ HDassert(!token_cmp);
} /* end else-if */
else {
void *elinkval;
@@ -1152,72 +1007,58 @@ vrfy_ns_grp_d(hid_t fid, const char *group_name, unsigned nlinks)
HDassert(2 == (u % 3));
- if ( H5L_TYPE_EXTERNAL != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
- }
+ if (H5L_TYPE_EXTERNAL != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5L_TYPE_EXTERNAL != lnk_info.type";
+ }
HDassert(H5L_TYPE_EXTERNAL == lnk_info.type);
- elinkval = malloc(lnk_info.u.val_size);
+ elinkval = HDmalloc(lnk_info.u.val_size);
- if ( ! elinkval ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: malloc of elinkval failed.";
- }
+ if (!elinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: HDmalloc of elinkval failed.";
+ }
HDassert(elinkval);
- ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lget_val(gid, linkname, elinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lget_val failed.";
}
HDassert(ret >= 0);
- ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL,
- &file, &path);
- if ( ret < 0 ) {
-
- pass = FALSE;
+ ret = H5Lunpack_elink_val(elinkval, lnk_info.u.val_size, NULL, &file, &path);
+ if (ret < 0) {
+ pass = FALSE;
failure_mssg = "vrfy_ns_grp_d: H5Lunpack_elink_val failed.";
}
- else if ( 0 != strcmp(file, "external.h5") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(file, \"external.h5\").";
+ else if (0 != HDstrcmp(file, "external.h5")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(file, \"external.h5\").";
+ }
+ else if (0 != HDstrcmp(path, "/ext")) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: 0 != HDstrcmp(path, \"/ext\")";
}
- else if ( 0 != strcmp(path, "/ext") ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ns_grp_d: 0 != strcmp(path, \"/ext\")";
- }
HDassert(ret >= 0);
- HDassert(0 == strcmp(file, "external.h5"));
- HDassert(0 == strcmp(path, "/ext"));
-
- free(elinkval);
+ HDassert(0 == HDstrcmp(file, "external.h5"));
+ HDassert(0 == HDstrcmp(path, "/ext"));
+ HDfree(elinkval);
} /* end else */
- u++;
-
+ u++;
} /* end while() */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ns_grp_d: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -1248,58 +1089,71 @@ void
os_grp_0(hid_t fid, const char *group_name)
{
hid_t gid = -1;
- herr_t ret;
+ hid_t fapl = -1;
+ H5F_libver_t low, high;
- if ( pass ) { /* turn file format latest off */
-
- ret = H5Fset_latest_format(fid, FALSE);
+ herr_t ret;
- if ( ret < 0 ) {
+ if ( pass ) { /* get the file's file access property list */
+ fapl = H5Fget_access_plist(fid);
+ if ( fapl <= 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fget_access_plist() failed.";
+ }
+ HDassert(fapl > 0);
+ }
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Fset_latest_format() failed(1).";
- }
+ if ( pass ) { /* get low and high bounds from fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
+ if ( pass ) { /* turn file format latest off */
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
+ }
+ HDassert(ret >= 0);
+ }
+ }
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ if ( pass ) {
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Gcreate2() failed.";
- }
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Gcreate2() failed.";
+ }
HDassert(gid > 0);
}
if ( pass ) {
-
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Gclose() failed.";
- }
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) { /* turn file format latest on */
-
- ret = H5Fset_latest_format(fid, TRUE);
-
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_0: H5Fset_latest_format() failed(2).";
- }
- HDassert(ret >= 0);
+ if ( pass ) { /* restore low and high bounds */
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, low, high);
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
+ }
+ HDassert(ret >= 0);
+ }
}
return;
-
} /* os_grp_0() */
@@ -1322,98 +1176,83 @@ os_grp_0(hid_t fid, const char *group_name)
*/
void
-vrfy_os_grp_0(hid_t fid, const char *group_name)
-{
+vrfy_os_grp_0(hid_t fid, const char *group_name) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
unsigned crt_order_flags = 0;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gopen2() failed.";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_create_plist() failed.";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pget_link_creation_order() failed";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( 0 != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gget_info() failed.";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (0 != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(0 == grp_info.nlinks);
@@ -1421,28 +1260,25 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
HDassert(false == grp_info.mounted);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_0: H5Gclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_0() */
/*-------------------------------------------------------------------------
* Function: os_grp_n
*
- * Purpose: Create an "old style" group, with 'nlinks' soft/hard
- * links in it.
+ * Purpose: Create an "old style" group, with 'nlinks' soft/hard
+ * links in it.
*
* If pass is false on entry, do nothing.
*
@@ -1457,33 +1293,49 @@ vrfy_os_grp_0(hid_t fid, const char *group_name)
*-------------------------------------------------------------------------
*/
-void
+void
os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
{
hid_t gid = -1;
unsigned u;
+ hid_t fapl = -1;
+ H5F_libver_t low, high;
herr_t ret;
- if ( pass ) { /* turn file format latest off */
-
- ret = H5Fset_latest_format(fid, FALSE);
-
- if ( ret < 0 ) {
+ if ( pass ) { /* get the file's file access property list */
+ fapl = H5Fget_access_plist(fid);
+ if ( fapl <= 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Fget_access_plist() failed.";
+ }
+ HDassert(fapl > 0);
+ }
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Fset_latest_format() failed(1).";
- }
+ if ( pass ) { /* get low and high bounds from fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Pget_libver_bounds() failed(1).";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
+ if ( pass ) { /* turn file format latest off */
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, H5F_LIBVER_EARLIEST, high);
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_0: H5Fset_libver_bounds() failed(1).";
+ }
+ HDassert(ret >= 0);
+ }
+ }
- gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT,
- H5P_DEFAULT);
+ if ( pass ) {
+ gid = H5Gcreate2(fid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Gcreate2() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Gcreate2() failed.";
}
HDassert(gid > 0);
}
@@ -1492,62 +1344,51 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
u = 0;
while ( ( pass ) && ( u < nlinks ) ) {
-
char linkname[32];
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
if(0 == (u % 2)) {
-
- ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_soft(group_name, gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_soft() failed.";
}
HDassert(ret >= 0);
} /* end if */
else {
-
HDassert(1 == (u % 2));
- ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT,
- H5P_DEFAULT);
+ ret = H5Lcreate_hard(fid, "/", gid, linkname, H5P_DEFAULT, H5P_DEFAULT);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Lcreate_hard() failed.";
}
HDassert(ret >= 0);
} /* end else */
- u++;
-
+ u++;
} /* end while */
if ( pass ) {
-
ret = H5Gclose(gid);
if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Gclose() failed.";
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Gclose() failed.";
}
- assert(ret >= 0);
+ HDassert(ret >= 0);
}
- if ( pass ) { /* turn file format latest on */
-
- ret = H5Fset_latest_format(fid, TRUE);
-
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "os_grp_n: H5Fset_latest_format() failed(2).";
- }
- HDassert(ret >= 0);
+ if ( pass ) { /* restore low and high bounds */
+ if(low >= H5F_LIBVER_V18) {
+ ret = H5Fset_libver_bounds(fid, low, high);
+ if ( ret < 0 ) {
+ pass = FALSE;
+ failure_mssg = "os_grp_n: H5Fset_libver_bounds() failed(2).";
+ }
+ HDassert(ret >= 0);
+ }
}
return;
@@ -1573,8 +1414,8 @@ os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*-------------------------------------------------------------------------
*/
void
-vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
-{
+vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
+ unsigned nlinks) {
hid_t gid = -1;
hid_t gcpl = -1;
H5G_info_t grp_info;
@@ -1582,92 +1423,76 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
gid = H5Gopen2(fid, group_name, H5P_DEFAULT);
- if ( gid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
- }
+ if (gid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gopen2() failed";
+ }
HDassert(gid > 0);
}
- if ( pass ) {
-
+ if (pass) {
gcpl = H5Gget_create_plist(gid);
- if ( gcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
- }
+ if (gcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_create_plist() failed";
+ }
HDassert(gcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_link_creation_order(gcpl, &crt_order_flags);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
- }
- else if ( 0 != crt_order_flags ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pget_link_creation_order";
+ }
+ else if (0 != crt_order_flags) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != crt_order_flags";
+ }
HDassert(ret >= 0);
HDassert(0 == crt_order_flags);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(gcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Pclose() failed";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- memset(&grp_info, 0, sizeof(grp_info));
+ if (pass) {
+ HDmemset(&grp_info, 0, sizeof(grp_info));
ret = H5Gget_info(gid, &grp_info);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
- }
- else if ( H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
- }
- else if ( nlinks != grp_info.nlinks ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
- }
- else if ( 0 != grp_info.max_corder ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
- }
- else if ( FALSE != grp_info.mounted ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gget_info() failed";
+ }
+ else if (H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5G_STORAGE_TYPE_SYMBOL_TABLE != grp_info.storage_type";
+ }
+ else if (nlinks != grp_info.nlinks) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: nlinks != grp_info.nlinks";
+ }
+ else if (0 != grp_info.max_corder) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != grp_info.max_corder";
+ }
+ else if ( FALSE != grp_info.mounted) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != grp_info.mounted";
+ }
HDassert(ret >= 0);
HDassert(H5G_STORAGE_TYPE_SYMBOL_TABLE == grp_info.storage_type);
HDassert(nlinks == grp_info.nlinks);
@@ -1676,137 +1501,125 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
}
u = 0;
- while ( ( pass ) && ( u < nlinks ) ) {
-
- H5L_info_t lnk_info;
+ while ((pass) && (u < nlinks)) {
+ H5L_info2_t lnk_info;
char linkname[32];
htri_t link_exists;
- sprintf(linkname, "ln%d_%u", proc_num, u);
+ HDsprintf(linkname, "ln%d_%u", proc_num, u);
link_exists = H5Lexists(gid, linkname, H5P_DEFAULT);
- if ( link_exists < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
+ if (link_exists < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lexists() failed";
}
HDassert(link_exists >= 0);
- memset(&lnk_info, 0, sizeof(grp_info));
- ret = H5Lget_info(gid, linkname, &lnk_info, H5P_DEFAULT);
+ HDmemset(&lnk_info, 0, sizeof(grp_info));
+ ret = H5Lget_info2(gid, linkname, &lnk_info, H5P_DEFAULT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_info() failed";
}
- else if ( FALSE != lnk_info.corder_valid ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
+ else if ( FALSE != lnk_info.corder_valid) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: FALSE != lnk_info.corder_valid";
}
- else if ( H5T_CSET_ASCII != lnk_info.cset ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
+ else if (H5T_CSET_ASCII != lnk_info.cset) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5T_CSET_ASCII != lnk_info.cset";
}
HDassert(ret >= 0);
HDassert(false == lnk_info.corder_valid);
HDassert(H5T_CSET_ASCII == lnk_info.cset);
- if(0 == (u % 2)) {
+ if (0 == (u % 2)) {
char *slinkval;
- if ( H5L_TYPE_SOFT != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
+ if (H5L_TYPE_SOFT != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_SOFT != lnk_info.type";
}
- else if ( (strlen(group_name) + 1) != lnk_info.u.val_size ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: (strlen(group_name) + 1) != lnk_info.u.val_size";
+ else if ((HDstrlen(group_name) + 1) != lnk_info.u.val_size) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: (HDstrlen(group_name) + 1) != lnk_info.u.val_size";
}
HDassert(H5L_TYPE_SOFT == lnk_info.type);
- HDassert((strlen(group_name) + 1) == lnk_info.u.val_size);
-
- slinkval = (char *)malloc(lnk_info.u.val_size);
+ HDassert((HDstrlen(group_name) + 1) == lnk_info.u.val_size);
- if ( ! slinkval ) {
+ slinkval = (char *) HDmalloc(lnk_info.u.val_size);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: malloc of slinkval failed";
+ if (!slinkval) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: HDmalloc of slinkval failed";
}
HDassert(slinkval);
- ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
- H5P_DEFAULT);
-
- if ( ret < 0 ) {
+ ret = H5Lget_val(gid, linkname, slinkval, lnk_info.u.val_size,
+ H5P_DEFAULT);
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Lget_val() failed";
}
- else if ( 0 != strcmp(slinkval, group_name) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: 0 != strcmp(slinkval, group_name)";
+ else if (0 != HDstrcmp(slinkval, group_name)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: 0 != HDstrcmp(slinkval, group_name)";
}
HDassert(ret >= 0);
- HDassert(0 == strcmp(slinkval, group_name));
+ HDassert(0 == HDstrcmp(slinkval, group_name));
- free(slinkval);
+ HDfree(slinkval);
} /* end if */
else {
- H5O_info_t root_oinfo;
+ H5O_info2_t root_oinfo;
+ int token_cmp = 0;
HDassert(1 == (u % 2));
- if ( H5L_TYPE_HARD != lnk_info.type ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
+ if (H5L_TYPE_HARD != lnk_info.type) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5L_TYPE_HARD != lnk_info.type";
}
HDassert(H5L_TYPE_HARD == lnk_info.type);
- memset(&root_oinfo, 0, sizeof(root_oinfo));
- ret = H5Oget_info(fid, &root_oinfo);
+ HDmemset(&root_oinfo, 0, sizeof(root_oinfo));
+ ret = H5Oget_info3(fid, &root_oinfo, H5O_INFO_BASIC);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Oget_info() failed.";
}
- else if ( root_oinfo.addr != lnk_info.u.address ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_os_grp_n: root_oinfo.addr != lnk_info.u.address";
+ else {
+ if(H5Otoken_cmp(fid, &root_oinfo.token, &lnk_info.u.token, &token_cmp) < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Otoken_cmp() failed.";
+ }
+
+ if (token_cmp) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: root_oinfo.token != lnk_info.u.token";
+ }
}
HDassert(ret >= 0);
- HDassert(root_oinfo.addr == lnk_info.u.address);
+ HDassert(!token_cmp);
} /* end else */
- u++;
-
+ u++;
} /* end while */
- if ( pass ) {
-
+ if (pass) {
ret = H5Gclose(gid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_os_grp_n: H5Gclose() failed.";
}
HDassert(ret >= 0);
}
return;
-
} /* vrfy_os_grp_n() */
@@ -1814,8 +1627,8 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
* Function: ds_ctg_i
*
* Purpose: Create a contiguous dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1829,106 +1642,91 @@ vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Screate_simple() failed";
}
HDassert(sid > 0);
}
- if ( pass ) {
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
-
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dcreate2() failed";
}
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Sclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Sclose() failed";
}
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: malloc of wdata failed.";
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: HDmalloc of wdata failed.";
}
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
-
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dwrite() failed.";
}
HDassert(ret >= 0);
- free(wdata);
- }
-
- if ( pass ) {
+ HDfree(wdata);
+ }
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_i: H5Dclose() failed";
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_i: H5Dclose() failed";
}
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_i
*
- * Purpose: Validate a contiguous datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -1942,9 +1740,8 @@ ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -1958,225 +1755,187 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: type not H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
- }
- assert(ret >= 0);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Tclose() failed.";
+ }
+ HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
- break;
- }
- HDassert((int)u == rdata[u]);
- }
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: u != rdata[u].";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
+ }
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_i: H5Dclose() failed";
+ }
HDassert(ret >= 0);
}
@@ -2189,8 +1948,8 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_chk_i
*
* Purpose: Create a chunked dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2204,142 +1963,121 @@ vrfy_ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_DIMS};
- hsize_t chunk_dims[1] = {DSET_CHUNK_DIMS};
+ hsize_t dims[1] = { DSET_DIMS };
+ hsize_t chunk_dims[1] = { DSET_CHUNK_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pset_chunk() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dcreate2() failed";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dcreate2() failed";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++)
- wdata[u] = (int)u;
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++)
+ wdata[u] = (int) u;
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dwrite() failed.";
- }
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
-
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_chk_i */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_chk_i
*
- * Purpose: Validate a chunked datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a chunked datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2353,9 +2091,8 @@ ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2369,249 +2106,204 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
- }
- else if ( DSET_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != dims[0]";
+ }
+ else if ( DSET_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: DSET_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_DIMS == dims[0]);
HDassert(DSET_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: tid != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
- }
- else if ( write_data && ( allocation != H5D_SPACE_STATUS_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_space_status() failed.";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CHUNKED != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
- }
+ if (H5D_CHUNKED != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5D_CHUNKED != layout";
+ }
HDassert(H5D_CHUNKED == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pget_chunk(dcpl, 1, chunk_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
- }
- else if ( DSET_CHUNK_DIMS != chunk_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: ";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pget_chunk";
+ }
+ else if ( DSET_CHUNK_DIMS != chunk_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: ";
+ }
HDassert(ret >= 0);
HDassert(DSET_CHUNK_DIMS == chunk_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_DIMS);
- if ( ! rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
-
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_chk_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_chk_i() */
@@ -2619,8 +2311,8 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
* Function: ds_cpt_i
*
* Purpose: Create a compact dataset w/int datatype. Write data
- * to the data set or not as indicated by the write_data
- * parameter.
+ * to the data set or not as indicated by the write_data
+ * parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2634,129 +2326,110 @@ vrfy_ds_chk_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *wdata = NULL;
unsigned u;
hid_t dsid = -1;
hid_t dcpl = -1;
hid_t sid = -1;
- hsize_t dims[1] = {DSET_COMPACT_DIMS};
+ hsize_t dims[1] = { DSET_COMPACT_DIMS };
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Screate_simple() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pcreate() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pset_layout(dcpl, H5D_COMPACT);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pset_layout() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
- H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ if ((pass) && (write_data)) {
+ wdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- if ( ! wdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++)
- wdata[u] = (int)u;
-
- ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wdata);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++)
+ wdata[u] = (int) u;
- if ( ret < 0 ) {
+ ret = H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, wdata);
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
@@ -2768,8 +2441,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
/*-------------------------------------------------------------------------
* Function: vrfy_ds_cpt_i
*
- * Purpose: Validate a compact datasets w/int datatypes. Validate
- * data if indicated via the write_data parameter.
+ * Purpose: Validate a compact datasets w/int datatypes. Validate
+ * data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -2783,9 +2456,8 @@ ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data) {
int *rdata = NULL;
unsigned u;
hid_t dsid = -1;
@@ -2799,232 +2471,195 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
htri_t type_equal;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space() failed.";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
- }
- else if ( DSET_COMPACT_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
- }
- else if ( DSET_COMPACT_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sget_simple_extent_dims() failed";
+ }
+ else if ( DSET_COMPACT_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != dims[0]";
+ }
+ else if ( DSET_COMPACT_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: DSET_COMPACT_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_COMPACT_DIMS == dims[0]);
HDassert(DSET_COMPACT_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, H5T_NATIVE_INT);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: type != H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
- }
- else if ( H5D_SPACE_STATUS_ALLOCATED != allocation ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_space_status() failed.";
+ }
+ else if (H5D_SPACE_STATUS_ALLOCATED != allocation) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_cpt_i: H5D_SPACE_STATUS_ALLOCATED != allocation";
+ }
HDassert(ret >= 0);
HDassert(H5D_SPACE_STATUS_ALLOCATED == allocation);
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_COMPACT != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
- }
+ if (H5D_COMPACT != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5D_COMPACT != layout";
+ }
HDassert(H5D_COMPACT == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
- }
-
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (int *)malloc(sizeof(int) * DSET_COMPACT_DIMS);
+ }
- if ( ! rdata ) {
+ if ((pass) && (write_data)) {
+ rdata = (int *) HDmalloc(sizeof(int) * DSET_COMPACT_DIMS);
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
- }
+ if ((pass) && (write_data)) {
+ ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rdata);
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_COMPACT_DIMS; u++) {
-
- if ( (int)u != rdata[u] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
- break;
- }
- HDassert((int)u == rdata[u]);
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_COMPACT_DIMS; u++) {
+ if ((int) u != rdata[u]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: (int)u != rdata[u]";
+ break;
+ }
+ HDassert((int )u == rdata[u]);
}
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_cpt_i: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_cpt_i() */
/*-------------------------------------------------------------------------
* Function: ds_ctg_v
*
- * Purpose: Create a contiguous dataset w/variable-length datatype.
- * Write data to the data set or not as indicated by the
- * write_data parameter.
+ * Purpose: Create a contiguous dataset w/variable-length datatype.
+ * Write data to the data set or not as indicated by the
+ * write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3038,166 +2673,142 @@ vrfy_ds_cpt_i(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
- hsize_t dims[1] = {DSET_SMALL_DIMS};
+ hsize_t dims[1] = { DSET_SMALL_DIMS };
herr_t ret;
hvl_t *wdata = NULL;
unsigned u;
- if ( pass ) {
-
+ if (pass) {
sid = H5Screate_simple(1, dims, NULL);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Screate_simple";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Screate_simple";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
- dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
-
- if ( dsid <= 0 ) {
+ if (pass) {
+ dsid = H5Dcreate2(fid, dset_name, tid, sid, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dcreate2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- wdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
-
- if ( ! wdata ) {
+ if ((pass) && (write_data)) {
+ wdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of wdata failed.";
- }
+ if (!wdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of wdata failed.";
+ }
HDassert(wdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
-
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
int *tdata;
unsigned len;
unsigned v;
len = (u % 10) + 1;
- tdata = (int *)malloc(sizeof(int) * len);
+ tdata = (int *) HDmalloc(sizeof(int) * len);
- if ( !tdata ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: malloc of tdata failed.";
- break;
- }
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: HDmalloc of tdata failed.";
+ break;
+ }
HDassert(tdata);
- for(v = 0; v < len; v++)
- tdata[v] = (int)(u + v);
+ for (v = 0; v < len; v++)
+ tdata[v] = (int) (u + v);
- wdata[u].len = len;
- wdata[u].p = tdata;
+ wdata[u].len = len;
+ wdata[u].p = tdata;
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dwrite() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, wdata);
-
- if ( ret < 0 ) {
+ if ((pass) && (write_data)) {
+ ret = H5Treclaim(tid, sid, H5P_DEFAULT, wdata);
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Treclaim() failed.";
+ }
HDassert(ret >= 0);
- free(wdata);
-
+ HDfree(wdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( sid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Sclose() failed.";
- }
+ if (sid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( tid < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Tclose() failed.";
- }
+ if (tid < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* ds_ctg_v() */
/*-------------------------------------------------------------------------
* Function: vrfy_ds_ctg_v
*
- * Purpose: Validate a contiguous datasets w/variable-length datatypes.
- * Validate data if indicated via the write_data parameter.
+ * Purpose: Validate a contiguous datasets w/variable-length datatypes.
+ * Validate data if indicated via the write_data parameter.
*
* If pass is false on entry, do nothing.
*
@@ -3211,9 +2822,8 @@ ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
*
*-------------------------------------------------------------------------
*/
-void
-vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
-{
+void
+vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data) {
hid_t dsid = -1;
hid_t sid = -1;
hid_t tid = -1;
@@ -3228,283 +2838,240 @@ vrfy_ds_ctg_v(hid_t fid, const char *dset_name, hbool_t write_data)
unsigned u;
herr_t ret;
- if ( pass ) {
-
+ if (pass) {
dsid = H5Dopen2(fid, dset_name, H5P_DEFAULT);
- if ( dsid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
- }
+ if (dsid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dopen2() failed.";
+ }
HDassert(dsid > 0);
}
- if ( pass ) {
-
+ if (pass) {
sid = H5Dget_space(dsid);
- if ( sid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
- }
+ if (sid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space() failed";
+ }
HDassert(sid > 0);
}
- if ( pass ) {
-
+ if (pass) {
ndims = H5Sget_simple_extent_ndims(sid);
- if ( 1 != ndims ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
- }
+ if (1 != ndims) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: 1 != ndims";
+ }
HDassert(1 == ndims);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Sget_simple_extent_dims(sid, dims, max_dims);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
- }
- else if ( DSET_SMALL_DIMS != dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
- }
- else if ( DSET_SMALL_DIMS != max_dims[0] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sget_simple_extent_dims() failed.";
+ }
+ else if ( DSET_SMALL_DIMS != dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != dims[0]";
+ }
+ else if ( DSET_SMALL_DIMS != max_dims[0]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: DSET_SMALL_DIMS != max_dims[0]";
+ }
HDassert(ret >= 0);
HDassert(DSET_SMALL_DIMS == dims[0]);
HDassert(DSET_SMALL_DIMS == max_dims[0]);
}
- if ( pass ) {
-
+ if (pass) {
tid = H5Dget_type(dsid);
- if ( tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
- }
+ if (tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_type() failed.";
+ }
HDassert(tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
tmp_tid = H5Tvlen_create(H5T_NATIVE_INT);
- if ( tmp_tid <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
- }
+ if (tmp_tid <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tvlen_create() failed.";
+ }
HDassert(tmp_tid > 0);
}
- if ( pass ) {
-
+ if (pass) {
type_equal = H5Tequal(tid, tmp_tid);
- if ( 1 != type_equal ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
- }
+ if (1 != type_equal) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: type != vlen H5T_NATIVE_INT";
+ }
HDassert(1 == type_equal);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tmp_tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dget_space_status(dsid, &allocation);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
- }
- else if ( write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED) ) {
-
- pass = FALSE;
- failure_mssg =
- "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
- }
- else if ( !write_data &&
- ( allocation != H5D_SPACE_STATUS_NOT_ALLOCATED ) ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_space_status() failed";
+ }
+ else if (write_data && (allocation != H5D_SPACE_STATUS_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: write_data && allocation != H5D_SPACE_STATUS_ALLOCATED";
+ }
+ else if (!write_data
+ && (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED)) {
+ pass = FALSE;
+ failure_mssg =
+ "vrfy_ds_ctg_v: !write_data && allocation != H5D_SPACE_STATUS_NOT_ALLOCATED";
+ }
HDassert(ret >= 0);
- HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED) ||
- (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
+ HDassert((write_data && allocation == H5D_SPACE_STATUS_ALLOCATED)
+ || (!write_data && allocation == H5D_SPACE_STATUS_NOT_ALLOCATED));
}
- if ( pass ) {
-
+ if (pass) {
dcpl = H5Dget_create_plist(dsid);
- if ( dcpl <= 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
- }
+ if (dcpl <= 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dget_create_plist() failed.";
+ }
HDassert(dcpl > 0);
}
- if ( pass ) {
-
+ if (pass) {
layout = H5Pget_layout(dcpl);
- if ( H5D_CONTIGUOUS != layout ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
- }
+ if (H5D_CONTIGUOUS != layout) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5D_CONTIGUOUS != layout";
+ }
HDassert(H5D_CONTIGUOUS == layout);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Pclose(dcpl);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Pclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- rdata = (hvl_t *)malloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
+ if ((pass) && (write_data)) {
+ rdata = (hvl_t *) HDmalloc(sizeof(hvl_t) * DSET_SMALL_DIMS);
- if ( !rdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: malloc of rdata failed.";
- }
+ if (!rdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: HDmalloc of rdata failed.";
+ }
HDassert(rdata);
}
- if ( ( pass ) && ( write_data ) ) {
-
+ if ((pass) && (write_data)) {
ret = H5Dread(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dread() failed.";
+ }
HDassert(ret >= 0);
}
- if ( ( pass ) && ( write_data ) ) {
-
- for(u = 0; u < DSET_SMALL_DIMS; u++) {
+ if ((pass) && (write_data)) {
+ for (u = 0; u < DSET_SMALL_DIMS; u++) {
unsigned len;
unsigned v;
- len = (unsigned)rdata[u].len;
- for(v = 0; v < len; v++) {
- int *tdata = (int *)rdata[u].p;
-
- if ( !tdata ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: !tdata";
- break;
- }
- else if ( (int)(u + v) != tdata[v] ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
- break;
- }
+ len = (unsigned) rdata[u].len;
+ for (v = 0; v < len; v++) {
+ int *tdata = (int *) rdata[u].p;
+
+ if (!tdata) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: !tdata";
+ break;
+ }
+ else if ((int) (u + v) != tdata[v]) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: (int)(u + v) != tdata[v]";
+ break;
+ }
HDassert(tdata);
- HDassert((int)(u + v) == tdata[v]);
+ HDassert((int )(u + v) == tdata[v]);
} /* end for */
} /* end for */
}
- if ( ( pass ) && ( write_data ) ) {
+ if ((pass) && (write_data)) {
+ ret = H5Treclaim(tid, sid, H5P_DEFAULT, rdata);
- ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rdata);
-
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dvlen_reclaim() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Treclaim() failed.";
+ }
HDassert(ret >= 0);
- free(rdata);
+ HDfree(rdata);
} /* end if */
- if ( pass ) {
-
+ if (pass) {
ret = H5Sclose(sid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Sclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Tclose(tid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Tclose() failed.";
+ }
HDassert(ret >= 0);
}
- if ( pass ) {
-
+ if (pass) {
ret = H5Dclose(dsid);
- if ( ret < 0 ) {
-
- pass = FALSE;
- failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
- }
+ if (ret < 0) {
+ pass = FALSE;
+ failure_mssg = "vrfy_ds_ctg_v: H5Dclose() failed.";
+ }
HDassert(ret >= 0);
}
return;
-
} /* vrfy_ds_ctg_v() */
-
+
/*-------------------------------------------------------------------------
* Function: create_zoo
*
@@ -3543,203 +3110,202 @@ create_zoo(hid_t fid, const char *base_path, int proc_num)
/* Add & verify an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* Add & verify a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_c(fid, full_path, 3);
}
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
+ /* Add & verify a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ns_grp_d(fid, full_path, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* Add & verify an empty "old style" group to file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_0(fid, full_path);
}
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
- * local heap) to file
+ /* Add & verify an "old style" group (w/300 links, in v1 B-tree &
+ * local heap) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
os_grp_n(fid, full_path, proc_num, 300);
}
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* Add & verify a contiguous dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/integer datatype (with data)
- * to file
+ /* Add & verify a contiguous dataset w/integer datatype (with data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* Add & verify a chunked dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* Add & verify a chunked dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a chunked dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_chk_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Add & verify a compact dataset w/integer datatype (but no data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (but no data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* Add & verify a compact dataset w/integer datatype (and data)
- * to file
+ /* Add & verify a compact dataset w/integer datatype (and data)
+ * to file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_cpt_i(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, FALSE);
}
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* Add & verify a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* Add & verify a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
ds_ctg_v(fid, full_path, TRUE);
}
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* create_zoo() */
-
+
/*-------------------------------------------------------------------------
* Function: validate_zoo
*
- * Purpose: Given the path to a group in which a "zoo" has been
- * constructed, validate the objects in the "zoo".
+ * Purpose: Given the path to a group in which a "zoo" has been
+ * constructed, validate the objects in the "zoo".
*
* If pass is false on entry, do nothing.
*
@@ -3771,116 +3337,115 @@ validate_zoo(hid_t fid, const char *base_path, int proc_num)
/* validate an empty "new style" group */
if ( pass ) {
- sprintf(full_path, "%s/A", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/A", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_0(fid, full_path);
}
/* validate a compact "new style" group (3 link messages) */
if ( pass ) {
- sprintf(full_path, "%s/B", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/B", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_c(fid, full_path, 3);
}
- /* validate a dense "new style" group (w/300 links, in v2 B-tree &
+ /* validate a dense "new style" group (w/300 links, in v2 B-tree &
* fractal heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/C", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/C", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ns_grp_d(fid, full_path, 300);
}
/* validate an empty "old style" group in file */
if ( pass ) {
- sprintf(full_path, "%s/D", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/D", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_0(fid, full_path);
}
- /* validate an "old style" group (w/300 links, in v1 B-tree &
+ /* validate an "old style" group (w/300 links, in v1 B-tree &
* local heap)
*/
if ( pass ) {
- sprintf(full_path, "%s/E", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/E", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_os_grp_n(fid, full_path, proc_num, 300);
}
- /* validate a contiguous dataset w/integer datatype (but no data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (but no data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/F", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/F", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/integer datatype (with data)
- * in file.
+ /* validate a contiguous dataset w/integer datatype (with data)
+ * in file.
*/
if ( pass ) {
- sprintf(full_path, "%s/G", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/G", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_i(fid, full_path, TRUE);
}
- /* validate a chunked dataset w/integer datatype (but no data)
- * in file
+ /* validate a chunked dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/H", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/H", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, FALSE);
}
- /* validate a chunked dataset w/integer datatype (and data)
- * in file
+ /* validate a chunked dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/I", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/I", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_chk_i(fid, full_path, TRUE);
}
- /* Validate a compact dataset w/integer datatype (but no data)
- * in file
+ /* Validate a compact dataset w/integer datatype (but no data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/J", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/J", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, FALSE);
}
- /* validate a compact dataset w/integer datatype (and data)
- * in file
+ /* validate a compact dataset w/integer datatype (and data)
+ * in file
*/
if ( pass ) {
- sprintf(full_path, "%s/K", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/K", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_cpt_i(fid, full_path, TRUE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (but no data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (but no data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/L", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/L", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, FALSE);
}
- /* validate a contiguous dataset w/variable-length datatype
- * (and data) to file
+ /* validate a contiguous dataset w/variable-length datatype
+ * (and data) to file
*/
if ( pass ) {
- sprintf(full_path, "%s/M", base_path);
- HDassert(strlen(full_path) < 1024);
+ HDsprintf(full_path, "%s/M", base_path);
+ HDassert(HDstrlen(full_path) < 1024);
vrfy_ds_ctg_v(fid, full_path, TRUE);
}
return;
-
} /* validate_zoo() */
diff --git a/test/genall5.h b/test/genall5.h
index 1dce195..20141de 100644
--- a/test/genall5.h
+++ b/test/genall5.h
@@ -34,7 +34,7 @@ void os_grp_0(hid_t fid, const char *group_name);
void vrfy_os_grp_0(hid_t fid, const char *group_name);
void os_grp_n(hid_t fid, const char *group_name, int proc_num, unsigned nlinks);
-void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
+void vrfy_os_grp_n(hid_t fid, const char *group_name, int proc_num,
unsigned nlinks);
void ds_ctg_i(hid_t fid, const char *dset_name, hbool_t write_data);
diff --git a/test/getname.c b/test/getname.c
index c3f3c54..a6f2f5a 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -101,8 +101,8 @@ test_main(hid_t file_id, hid_t fapl)
hid_t space_id;
hid_t type_id, type2_id;
hsize_t dims[1] = { 5 };
- size_t name_len; /* Name length */
- H5O_info_t oinfo; /* Object info structs */
+ size_t name_len; /* Name length */
+ H5O_info2_t oinfo; /* Object info structs */
hid_t dtype; /* Object identifier for testing */
hid_t dtype_anon; /* Object identifier for testing anonymous */
ssize_t size; /* Size returned by H5Iget_name */
@@ -2375,12 +2375,12 @@ test_main(hid_t file_id, hid_t fapl)
} H5E_END_TRY;
if(H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR
-
+
/* Test H5Iget_name with anonymously created datatype, should pass because committed */
if((size = H5Iget_name(dtype, NULL, 0)) != 0) TEST_ERROR
/* Create a link to the object */
- if( H5Olink(dtype, file2_id, "datatype", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Olink(dtype, file2_id, "datatype", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Commit a second datatype with no links to it and commit it */
if((dtype_anon = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
@@ -2390,7 +2390,7 @@ test_main(hid_t file_id, hid_t fapl)
if((size = H5Iget_name(dtype_anon, NULL,0)) != 0) TEST_ERROR
/* Store the address of the datatype for later use */
- if(H5Oget_info(dtype_anon, &oinfo) < 0) TEST_ERROR
+ if(H5Oget_info3(dtype_anon, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
/* Update the reference count to dtype_anon to preserve the datatype */
if(H5Oincr_refcount(dtype_anon) < 0) TEST_ERROR
@@ -2400,22 +2400,22 @@ test_main(hid_t file_id, hid_t fapl)
if(H5Fclose(file2_id) < 0) TEST_ERROR
/* Re-open the file and check that the anonymous datatypes persist */
- if( (file2_id = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+ if((file2_id = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
/* Check the H5Iget_name does not return an error for anon committed datatypes */
- if((dtype_anon = H5Oopen_by_addr(file2_id, oinfo.addr)) < 0) TEST_ERROR
+ if((dtype_anon = H5Oopen_by_token(file2_id, oinfo.token)) < 0) TEST_ERROR
- if((size = H5Iget_name(dtype_anon,NULL,0)) != 0) TEST_ERROR
+ if((size = H5Iget_name(dtype_anon, NULL, 0)) != 0) TEST_ERROR
if(H5Tclose(dtype_anon) < 0) TEST_ERROR
if(H5Fclose(file2_id) < 0) TEST_ERROR
PASSED();
- return(0);
+ return 0;
error:
- return(1);
+ return 1;
}
static int
@@ -2585,10 +2585,10 @@ test_obj_ref(hid_t fapl)
/* Make sure size parameter is ignored */
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], NULL, 200);
if(namelen != 9) TEST_ERROR
-
+
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(namelen == 9))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset in /Group1");
@@ -2600,7 +2600,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(namelen == 16))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to /Group1");
@@ -2612,7 +2612,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Group1") == 0) &&(namelen == 7))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to datatype in /Group1");
@@ -2624,7 +2624,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(namelen == 17))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset in nested group");
@@ -2636,7 +2636,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(namelen == 23))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to nested group");
@@ -2648,7 +2648,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(namelen == 14))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset created via hard link");
@@ -2660,7 +2660,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(namelen == 16))) TEST_ERROR
- PASSED()
+ PASSED();
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to root group");
@@ -2672,7 +2672,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7], (char*)buf, sizeof(buf));
if(!((HDstrcmp(buf, "/") == 0) &&(namelen == 1))) TEST_ERROR
- PASSED()
+ PASSED();
/* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */
if(H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0)
@@ -2687,7 +2687,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf));
if(namelen != 0) TEST_ERROR
- PASSED()
+ PASSED();
/* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */
if((dataset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &wbuf[1])) < 0)
@@ -2703,7 +2703,7 @@ test_obj_ref(hid_t fapl)
*buf = '\0';
namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf));
if(namelen != 0) TEST_ERROR
- PASSED()
+ PASSED();
/* Close disk dataspace */
if(H5Sclose(sid1) < 0)
@@ -2830,7 +2830,7 @@ test_reg_ref(hid_t fapl)
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE );
if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
- PASSED()
+ PASSED();
TESTING("H5Iget_name to get name from region reference(hyperslab)");
@@ -2844,14 +2844,14 @@ test_reg_ref(hid_t fapl)
if(H5Dclose(dsetv_id) < 0) TEST_ERROR
- PASSED()
+ PASSED();
/* Get name of the dataset the second region reference points to using H5Rget_name */
TESTING("H5Rget_name to get name from region reference(pnt selec)");
*buf1 = '\0';
name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1], (char*)buf1, NAME_BUF_SIZE);
if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
- PASSED()
+ PASSED();
TESTING("H5Iget_name to get name from region reference(pnt selec)");
@@ -2865,7 +2865,7 @@ test_reg_ref(hid_t fapl)
if(H5Dclose(dsetv_id) < 0) TEST_ERROR
- PASSED()
+ PASSED();
if(H5Dclose(dsetr_id) < 0)
TEST_ERROR
@@ -2937,7 +2937,7 @@ test_elinks(hid_t fapl)
/* Query the external link object's name */
*name = '\0';
name_cached = FALSE;
- namelen = H5I_get_name_test(group, (char*)name, sizeof(name), &name_cached);
+ namelen = H5I__get_name_test(group, (char*)name, sizeof(name), &name_cached);
if(!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
TEST_ERROR
@@ -2952,7 +2952,7 @@ test_elinks(hid_t fapl)
/* Query the external link to external link object's name */
*name = '\0';
name_cached = FALSE;
- namelen = H5I_get_name_test(group, (char*)name, sizeof(name), &name_cached);
+ namelen = H5I__get_name_test(group, (char*)name, sizeof(name), &name_cached);
if(!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
TEST_ERROR
diff --git a/test/gheap.c b/test/gheap.c
index 7564afa..09ba1cf 100644
--- a/test/gheap.c
+++ b/test/gheap.c
@@ -15,19 +15,20 @@
* Programmer: Robb Matzke <matzke@llnl.gov>
* Tuesday, March 31, 1998
*
- * Purpose: Tests the global heap. The global heap is the set of all
- * collections but the collections are not related to one
- * another by anything that appears in the file format.
+ * Purpose: Tests the global heap. The global heap is the set of all
+ * collections but the collections are not related to one
+ * another by anything that appears in the file format.
*/
#include "h5test.h"
-#include "H5private.h"
#include "H5ACprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Eprivate.h"
#include "H5Fprivate.h"
#include "H5Gprivate.h"
#include "H5HGprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
+#include "H5VLprivate.h"
/* Macros for printing error messages in loops. These print up to
* GHEAP_REPEATED_ERR_LIM errors, and suppress the rest */
@@ -56,37 +57,35 @@ const char *FILENAME[] = {
NULL
};
-
+
/*-------------------------------------------------------------------------
- * Function: test_1
+ * Function: test_1
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is larger than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is larger than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_1 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically increasing lengths");
@@ -97,11 +96,11 @@ test_1 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
/*
@@ -110,88 +109,90 @@ test_1 (hid_t fapl)
* be monotonically increasing.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = u + 1;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u);
- if(status < 0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
- H5_FAILED();
- puts(" Collection addresses are not monotonically increasing");
- nerrors++;
- }
+ size = u + 1;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_insert(f, size, out, obj + u);
+ if(status < 0) {
+ H5_FAILED();
+ HDputs(" Unable to insert object into global heap");
+ nerrors++;
+ }
+ else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) {
+ H5_FAILED();
+ HDputs(" Collection addresses are not monotonically increasing");
+ nerrors++;
+ }
}
/*
* Now try to read each object back.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = u + 1;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
- H5_FAILED();
- puts(" Unable to read object");
- nerrors++;
- } else if(HDmemcmp(in, out, size)) {
- H5_FAILED();
- puts(" Value read doesn't match value written");
- nerrors++;
- }
+ size = u + 1;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ if(NULL == H5HG_read(f, obj + u, in, NULL)) {
+ H5_FAILED();
+ HDputs(" Unable to read object");
+ nerrors++;
+ }
+ else if(HDmemcmp(in, out, size)) {
+ H5_FAILED();
+ HDputs(" Value read doesn't match value written");
+ nerrors++;
+ }
}
/* Release buffer */
HDfree(obj);
obj = NULL;
- if(H5Fclose(file) < 0) goto error;
- if(nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_2
+ * Function: test_2
*
- * Purpose: Writes a sequence of objects to the global heap where each
- * object is smaller than the one before.
+ * Purpose: Writes a sequence of objects to the global heap where each
+ * object is smaller than the one before.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_2 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- uint8_t in[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ uint8_t in[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ int nerrors = 0;
+ char filename[1024];
TESTING("monotonically decreasing lengths");
@@ -202,94 +203,95 @@ test_2 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
/*
* Write the objects, monotonically decreasing in length.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = GHEAP_TEST_NOBJS - u;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- }
+ size = GHEAP_TEST_NOBJS - u;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ if(H5HG_insert(f, size, out, obj + u) < 0) {
+ H5_FAILED();
+ HDputs(" Unable to insert object into global heap");
+ nerrors++;
+ }
}
/*
* Now try to read each object back.
*/
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = GHEAP_TEST_NOBJS - u;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) {
- H5_FAILED();
- puts(" Unable to read object");
- nerrors++;
- } else if (memcmp (in, out, size)) {
- H5_FAILED();
- puts(" Value read doesn't match value written");
- nerrors++;
- }
+ size = GHEAP_TEST_NOBJS - u;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ if(NULL == H5HG_read(f, obj + u, in, NULL)) {
+ H5_FAILED();
+ HDputs(" Unable to read object");
+ nerrors++;
+ }
+ else if (memcmp (in, out, size)) {
+ H5_FAILED();
+ HDputs(" Value read doesn't match value written");
+ nerrors++;
+ }
}
/* Release buffer */
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_3
+ * Function: test_3
*
- * Purpose: Creates a few global heap objects and then removes them all.
- * The collection should also be removed.
+ * Purpose: Creates a few global heap objects and then removes them all.
+ * The collection should also be removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_3 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("complete object removal");
@@ -300,86 +302,86 @@ test_3 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
/* Create some stuff */
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- size = u % 30 + 100;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- }
+ size = u % 30 + 100;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_insert(f, size, out, obj + u);
+ if (status<0) {
+ H5_FAILED();
+ HDputs(" Unable to insert object into global heap");
+ nerrors++;
+ }
}
/* Remove everything */
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to remove object");
- nerrors++;
- }
+ status = H5HG_remove(f, obj + u);
+ if (status<0) {
+ H5_FAILED();
+ HDputs(" Unable to remove object");
+ nerrors++;
+ }
}
/* Release buffer */
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_4
+ * Function: test_4
*
- * Purpose: Tests the H5HG_remove() feature by writing lots of objects
- * and occassionally removing some. When we're done they're all
- * removed.
+ * Purpose: Tests the H5HG_remove() feature by writing lots of objects
+ * and occassionally removing some. When we're done they're all
+ * removed.
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, March 31, 1998
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_4 (hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- H5HG_t *obj = NULL;
- uint8_t out[GHEAP_TEST_NOBJS];
- size_t u;
- size_t size;
- herr_t status;
- int nerrors = 0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ H5HG_t *obj = NULL;
+ uint8_t out[GHEAP_TEST_NOBJS];
+ size_t u;
+ size_t size;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("partial object removal");
@@ -390,91 +392,90 @@ test_4 (hid_t fapl)
/* Open a clean file */
h5_fixname(FILENAME[3], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
- H5_FAILED();
- puts(" Unable to create file");
- goto error;
+ goto error;
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
+ H5_FAILED();
+ HDputs(" Unable to create file");
+ goto error;
}
for(u = 0; u < GHEAP_TEST_NOBJS; u++) {
- /* Insert */
- size = u % 30 + 100;
- HDmemset(out, (int)('A' + u % 26), size);
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to insert object into global heap");
- nerrors++;
- }
-
- /*
- * Remove every third one beginning with the second, but after the
- * next one has already been inserted. That is, insert A, B, C;
- * remove B, insert D, E, F; remove E; etc.
- */
- if(1 == (u % 3)) {
- H5Eclear2(H5E_DEFAULT);
- status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1);
- if (status<0) {
- H5_FAILED();
- puts(" Unable to remove object");
- nerrors++;
- }
- HDmemset(obj + u - 1, 0, sizeof *obj);
- }
+ /* Insert */
+ size = u % 30 + 100;
+ HDmemset(out, (int)('A' + u % 26), size);
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_insert(f, size, out, obj + u);
+ if (status<0) {
+ H5_FAILED();
+ HDputs(" Unable to insert object into global heap");
+ nerrors++;
+ }
+
+ /* Remove every third one beginning with the second, but after the
+ * next one has already been inserted. That is, insert A, B, C;
+ * remove B, insert D, E, F; remove E; etc.
+ */
+ if(1 == (u % 3)) {
+ H5Eclear2(H5E_DEFAULT);
+ status = H5HG_remove(f, obj + u - 1);
+ if (status<0) {
+ H5_FAILED();
+ HDputs(" Unable to remove object");
+ nerrors++;
+ }
+ HDmemset(obj + u - 1, 0, sizeof *obj);
+ }
}
/* Release buffer */
HDfree(obj);
obj = NULL;
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_ooo_indices
+ * Function: test_ooo_indices
*
- * Purpose: Tests that indices can be stored out of order. This can
+ * Purpose: Tests that indices can be stored out of order. This can
* happen when the indices "wrap around" due to many
* insertions and deletions (for example, from rewriting a
* VL dataset).
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: number of errors
+ * Failure: number of errors
*
- * Programmer: Neil Fortner
+ * Programmer: Neil Fortner
* Monday, October 26, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_ooo_indices(hid_t fapl)
{
- hid_t file = -1;
- H5F_t *f = NULL;
- unsigned i, j;
- H5HG_t *obj = NULL;
- herr_t status;
- int nerrors=0;
- char filename[1024];
+ hid_t file = H5I_INVALID_HID;
+ H5F_t *f = NULL;
+ unsigned i, j;
+ H5HG_t *obj = NULL;
+ herr_t status;
+ int nerrors = 0;
+ char filename[1024];
TESTING("out of order indices");
@@ -485,122 +486,140 @@ test_ooo_indices(hid_t fapl)
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
- puts(" Unable to create file");
+ HDputs(" Unable to create file");
goto error;
- } /* end if */
+ }
/* Alternately insert 1000 entries and remove the previous group of 1000
- * entries, until the indices wrap around */
- for(i=0; i<66; i++) {
+ * entries, until the indices wrap around.
+ */
+ for(i = 0; i < 66; i++) {
/* Insert 1000 entries. The index into the obj array will alternate up
* and down by 1000 so the previous set of insertions is preserved and
- * can be deleted. */
+ * can be deleted.
+ */
for(j=1000*((~i&1)); j<1000*((~i&1)+1); j++) {
H5Eclear2(H5E_DEFAULT);
- status = H5HG_insert(f, H5AC_ind_read_dxpl_id, sizeof(j), &j, &obj[j]);
+ status = H5HG_insert(f, sizeof(j), &j, &obj[j]);
if (status<0)
GHEAP_REPEATED_ERR(" Unable to insert object into global heap")
/* Check that the index is as expected */
if(obj[j].idx != ((1000 * i) + j - (1000 * ((~i & 1)))) % ((1u << 16) - 1) + 1)
GHEAP_REPEATED_ERR(" Unexpected global heap index");
- } /* end for */
+ }
/* Remove the previous 1000 entries */
if(i>0)
for(j=1000*(i&1); j<1000*((i&1)+1); j++) {
H5Eclear2(H5E_DEFAULT);
- status = H5HG_remove(f, H5AC_ind_read_dxpl_id, &obj[j]);
+ status = H5HG_remove(f, &obj[j]);
if (status<0)
GHEAP_REPEATED_ERR(" Unable to remove object from global heap");
- } /* end for */
- } /* end for */
+ }
+ }
/* The indices should have "wrapped around" on the last iteration */
HDassert(obj[534].idx == 65535);
HDassert(obj[535].idx == 1);
/* Reopen the file */
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file) < 0)
+ goto error;
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
- puts(" Unable to open file");
+ HDputs(" Unable to open file");
goto error;
} /* end if */
/* Read the objects to make sure the heap is still readable */
for(i=0; i<1000; i++) {
- if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, &obj[i], &j, NULL))
+ if(NULL == H5HG_read(f, &obj[i], &j, NULL))
goto error;
if(i != j) {
H5_FAILED();
- puts(" Incorrect read value");
+ HDputs(" Incorrect read value");
goto error;
- } /* end if */
- } /* end for */
+ }
+ }
- if (H5Fclose(file)<0) goto error;
- if (nerrors) goto error;
+ if(H5Fclose(file) < 0)
+ goto error;
+ if(nerrors)
+ goto error;
HDfree(obj);
obj = NULL;
+
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
if(obj)
HDfree(obj);
return MAX(1, nerrors);
} /* end test_ooo_indices */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: Tests global heap.
+ * Purpose: Tests global heap.
*
- * Return: Success: zero
- *
- * Failure: non-zero
- *
- * Programmer: Robb Matzke
- * Tuesday, March 31, 1998
- *
- * Modifications:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
*-------------------------------------------------------------------------
*/
int
main (void)
{
- int nerrors=0;
- hid_t fapl;
+ int nerrors = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
- fapl = h5_fileaccess();
+ if ((fapl_id = h5_fileaccess()) < 0)
+ goto error;
+
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
- nerrors += test_1(fapl);
- nerrors += test_2(fapl);
- nerrors += test_3(fapl);
- nerrors += test_4(fapl);
- nerrors += test_ooo_indices(fapl);
+ nerrors += test_1(fapl_id);
+ nerrors += test_2(fapl_id);
+ nerrors += test_3(fapl_id);
+ nerrors += test_4(fapl_id);
+ nerrors += test_ooo_indices(fapl_id);
/* Verify symbol table messages are cached */
- nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0);
- if (nerrors) goto error;
+ if (nerrors)
+ goto error;
- puts("All global heap tests passed.");
- h5_cleanup(FILENAME, fapl);
- return 0;
+ HDputs("All global heap tests passed.");
+
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
+ h5_cleanup(FILENAME, fapl_id);
+ HDexit(EXIT_SUCCESS);
error:
- puts("*** TESTS FAILED ***");
- return 1;
-}
+ H5E_BEGIN_TRY {
+ H5Pclose(fapl_id);
+ } H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
+ HDputs("*** TESTS FAILED ***");
+ HDexit(EXIT_FAILURE);
+} /* end main() */
+
diff --git a/test/h5test.c b/test/h5test.c
index af45589..9cca100 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -23,9 +23,10 @@
#include "h5test.h"
#include "H5srcdir.h"
+#include "H5srcdir_str.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"
@@ -42,7 +43,10 @@
* use for HDF5 file access. The first word in the
* value is the name of the driver and subsequent data
* is interpreted according to the driver. See
- * h5_fileaccess() for details.
+ * h5_get_vfd_fapl() for details.
+ *
+ * HDF5_LIBVER_BOUNDS: This string describes what library version bounds to
+ * use for HDF5 file access. See h5_get_libver_fapl() for details.
*
* HDF5_PREFIX: A string to add to the beginning of all serial test
* file names. This can be used to run tests in a
@@ -97,76 +101,31 @@ static const char *multi_letters = "msbrglo";
/* The # of seconds to wait for the message file--used by h5_wait_message() */
#define MESSAGE_TIMEOUT 300 /* Timeout in seconds */
+/* Buffer to construct path in and return pointer to */
+static char srcdir_path[1024] = "";
+
+/* Buffer to construct file in and return pointer to */
+static char srcdir_testpath[1024] = "";
+
+/* The strings that correspond to library version bounds H5F_libver_t in H5Fpublic.h */
+/* This is used by h5_get_version_string() */
+const char *LIBVER_NAMES[] = {
+ "earliest", /* H5F_LIBVER_EARLIEST = 0 */
+ "v18", /* H5F_LIBVER_V18 = 1 */
+ "v110", /* H5F_LIBVER_V110 = 2 */
+ "v112", /* H5F_LIBVER_V112 = 3 */
+ "latest", /* H5F_LIBVER_V114 = 4 */
+ 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,
- char *fullname, size_t size, hbool_t nest_printf);
-
-
-
-/* A non-usable VFD class and its functions.
- *
- * Usable for testing things like ID handling where we shouldn't mess with the real VFDs.
- */
-static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
-static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; }
-
-static herr_t dummy_vfd_close(H5FD_t *_file);
-static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; }
-
-static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type);
-static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
-
-static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
-static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; }
-
-static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type);
-static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
+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);
-static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf);
-static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; }
-
-static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf);
-static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; }
-static H5FD_class_t dummy_vfd_class_g = {
- "fake", /* name */
- 1, /* maxaddr */
- H5F_CLOSE_WEAK, /* fc_degree */
- NULL, /* terminate */
- NULL, /* sb_size */
- NULL, /* sb_encode */
- NULL, /* sb_decode */
- 0, /* fapl_size */
- NULL, /* fapl_get */
- NULL, /* fapl_copy */
- NULL, /* fapl_free */
- 0, /* dxpl_size */
- NULL, /* dxpl_copy */
- NULL, /* dxpl_free */
- dummy_vfd_open, /* open */
- dummy_vfd_close, /* close */
- NULL, /* cmp */
- NULL, /* query */
- NULL, /* get_type_map */
- NULL, /* alloc */
- NULL, /* free */
- dummy_vfd_get_eoa, /* get_eoa */
- dummy_vfd_set_eoa, /* set_eoa */
- dummy_vfd_get_eof, /* get_eof */
- NULL, /* get_handle */
- dummy_vfd_read, /* read */
- dummy_vfd_write, /* write */
- NULL, /* flush */
- NULL, /* truncate */
- NULL, /* lock */
- NULL, /* unlock */
- H5FD_FLMAP_DEFAULT /* fl_map */
-};
-
-
/*-------------------------------------------------------------------------
* Function: h5_errors
*
@@ -191,7 +150,7 @@ h5_errors(hid_t estack, void H5_ATTR_UNUSED *client_data)
return 0;
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_clean_files
*
@@ -211,47 +170,8 @@ h5_clean_files(const char *base_name[], hid_t fapl)
int i;
for(i = 0; base_name[i]; i++) {
- char filename[1024];
- char temp[2048];
- hid_t driver;
-
- if(NULL == h5_fixname(base_name[i], fapl, filename, sizeof(filename)))
- continue;
-
- driver = H5Pget_driver(fapl);
-
- if(driver == H5FD_FAMILY) {
- int j;
-
- for(j = 0; /*void*/; j++) {
- HDsnprintf(temp, sizeof temp, filename, j);
-
- if(HDaccess(temp, F_OK) < 0)
- break;
-
- HDremove(temp);
- } /* end for */
- } else if(driver == H5FD_CORE) {
- hbool_t backing; /* Whether the core file has backing store */
-
- H5Pget_fapl_core(fapl, NULL, &backing);
-
- /* If the file was stored to disk with bacing store, remove it */
- if(backing)
- HDremove(filename);
- } else if (driver == H5FD_MULTI) {
- H5FD_mem_t mt;
-
- HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
-
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
- HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]);
- HDremove(temp); /*don't care if it fails*/
- } /* end for */
- } else {
- HDremove(filename);
- }
- } /* end for */
+ h5_delete_test_file(base_name[i], fapl);
+ }
/* Close the FAPL used to access the file */
H5Pclose(fapl);
@@ -259,7 +179,7 @@ h5_clean_files(const char *base_name[], hid_t fapl)
return;
} /* end h5_clean_files() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_delete_test_file
*
@@ -277,6 +197,13 @@ h5_clean_files(const char *base_name[], hid_t fapl)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * sub_filename in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
void
h5_delete_test_file(const char *base_name, hid_t fapl)
{
@@ -316,18 +243,19 @@ h5_delete_test_file(const char *base_name, hid_t fapl)
HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
HDsnprintf(sub_filename, sizeof(sub_filename), "%s-%c.h5", filename, multi_letters[mt]);
HDremove(sub_filename);
- } /* end for */
+ }
} else {
HDremove(filename);
- } /* end if */
+ } /* end driver selection tree */
return;
} /* end h5_delete_test_file() */
+H5_GCC_DIAG_ON(format-nonliteral)
+
-
/*-------------------------------------------------------------------------
* Function: h5_delete_all_test_files
*
@@ -360,7 +288,7 @@ h5_delete_all_test_files(const char *base_name[], hid_t fapl)
return;
} /* end h5_delete_all_test_files() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_cleanup
*
@@ -393,7 +321,7 @@ h5_cleanup(const char *base_name[], hid_t fapl)
return retval;
} /* end h5_cleanup() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_test_shutdown
*
@@ -422,7 +350,7 @@ h5_test_shutdown(void)
return;
} /* end h5_test_shutdown() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_restore_err
*
@@ -444,7 +372,7 @@ h5_restore_err(void)
err_func = NULL;
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_reset
*
@@ -486,7 +414,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);
@@ -499,7 +427,7 @@ h5_reset(void)
#endif /* OLD_WAY */
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_test_init
*
@@ -532,7 +460,7 @@ h5_test_init(void)
return;
} /* end h5_test_init() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname
*
@@ -558,10 +486,36 @@ h5_test_init(void)
char *
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));
+ return (h5_fixname_real(base_name, fapl, ".h5", fullname, size, FALSE, FALSE));
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: h5_fixname_superblock
+ *
+ * Purpose: Like h5_fixname() but returns the name of the file you'd
+ * open to find the superblock. Useful for when you have to
+ * open a file with open(2) but the h5_fixname() string
+ * contains stuff like format strings.
+ *
+ * Return: Success: The FULLNAME pointer.
+ *
+ * Failure: NULL if BASENAME or FULLNAME is the null
+ * pointer or if FULLNAME isn't large enough for
+ * the result.
+ *
+ * Programmer: Dana Robinson
+ * Spring 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+char *
+h5_fixname_superblock(const char *base_name, hid_t fapl_id, char *fullname, size_t size)
+{
+ return (h5_fixname_real(base_name, fapl_id, ".h5", fullname, size, FALSE, TRUE));
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname_no_suffix
*
@@ -578,10 +532,10 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
char *
h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size)
{
- return (h5_fixname_real(base_name, fapl, NULL, fullname, size, FALSE));
+ return (h5_fixname_real(base_name, fapl, NULL, fullname, size, FALSE, FALSE));
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname_printf
*
@@ -604,10 +558,10 @@ h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t s
char *
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));
+ return (h5_fixname_real(base_name, fapl, ".h5", fullname, size, TRUE, FALSE));
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fixname_real
*
@@ -631,10 +585,11 @@ 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,
- char *fullname, size_t size, hbool_t nest_printf)
+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;
+ const char *env = NULL; /* HDF5_DRIVER environment variable */
char *ptr, last = '\0';
const char *suffix = _suffix;
size_t i, j;
@@ -652,17 +607,46 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
return NULL;
if(suffix) {
- if(H5FD_FAMILY == driver)
- suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
- else if (H5FD_MULTI == driver)
- suffix = NULL;
+ if(H5FD_FAMILY == driver) {
+ if(subst_for_superblock)
+ suffix = "00000.h5";
+ else
+ suffix = nest_printf ? "%%05d.h5" : "%05d.h5";
+ }
+ else if (H5FD_MULTI == driver) {
+
+ /* Get the environment variable, if it exists, in case
+ * we are using the split driver since both of those
+ * use the multi VFD under the hood.
+ */
+ env = HDgetenv("HDF5_DRIVER");
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_DRIVER;
+#endif
+ if(env && !HDstrcmp(env, "split")) {
+ /* split VFD */
+ if(subst_for_superblock)
+ suffix = "-m.h5";
+ else
+ suffix = NULL;
+ }
+ else {
+ /* multi VFD */
+ if(subst_for_superblock)
+ suffix = "-s.h5";
+ else
+ suffix = NULL;
+ }
+ }
}
}
/* Must first check fapl is not H5P_DEFAULT (-1) because H5FD_XXX
* could be of value -1 if it is not defined.
*/
- isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO==driver);
+ isppdriver = H5P_DEFAULT != fapl && (H5FD_MPIO == driver);
/* Check HDF5_NOCLEANUP environment setting.
* (The #ifdef is needed to prevent compile failure in case MPI is not
@@ -702,10 +686,10 @@ 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"
+ "different directory or to add file type prefix. e.g.,\n"
" HDF5_PARAPREFIX=pfs:/PFS/user/me\n"
" export HDF5_PARAPREFIX\n"
"*** End of Hint ***\n");
@@ -818,7 +802,7 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
return fullname;
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_rmprefix
*
@@ -849,16 +833,16 @@ h5_rmprefix(const char *filename)
return(ret_ptr);
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_fileaccess
*
* Purpose: Returns a file access template which is the default template
- * but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER
+ * but with a file driver, VOL connector, or libver bound set
+ * according to a constant or environment variable
*
- * Return: Success: A file access property list
- * Failure: -1
+ * Return: Success: A file access property list
+ * Failure: H5I_INVALID_HID
*
* Programmer: Robb Matzke
* Thursday, November 19, 1998
@@ -868,135 +852,75 @@ h5_rmprefix(const char *filename)
hid_t
h5_fileaccess(void)
{
- const char *val = NULL;
- const char *name;
- char s[1024];
- hid_t fapl = -1;
+ hid_t fapl_id = H5I_INVALID_HID;
- /* First use the environment variable, then the constant */
- val = HDgetenv("HDF5_DRIVER");
-#ifdef HDF5_DRIVER
- if(!val)
- val = HDF5_DRIVER;
-#endif
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
- if(!val || !*val)
- return fapl; /* use default */
-
- HDstrncpy(s, val, sizeof s);
- s[sizeof(s)-1] = '\0';
- if(NULL == (name = HDstrtok(s, " \t\n\r")))
- return fapl;
-
- if(!HDstrcmp(name, "sec2")) {
- /* Unix read() and write() system calls */
- if (H5Pset_fapl_sec2(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "stdio")) {
- /* Standard C fread() and fwrite() system calls */
- if (H5Pset_fapl_stdio(fapl) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "core")) {
- /* In-memory driver settings (backing store on, 1 MB increment) */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "core_paged")) {
- /* In-memory driver with write tracking and paging on */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
- if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "split")) {
- /* Split meta data and raw data each using default driver */
- if(H5Pset_fapl_split(fapl,
- "-m.h5", H5P_DEFAULT,
- "-r.h5", H5P_DEFAULT) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "multi")) {
- /* Multi-file driver, general case of the split driver */
- H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
- hid_t memb_fapl[H5FD_MEM_NTYPES];
- const char *memb_name[H5FD_MEM_NTYPES];
- char *sv[H5FD_MEM_NTYPES];
- haddr_t memb_addr[H5FD_MEM_NTYPES];
- H5FD_mem_t mt;
+ /* Attempt to set up a file driver first */
+ if(h5_get_vfd_fapl(fapl_id) < 0)
+ goto error;
- HDmemset(memb_map, 0, sizeof memb_map);
- HDmemset(memb_fapl, 0, sizeof memb_fapl);
- HDmemset(memb_name, 0, sizeof memb_name);
- HDmemset(memb_addr, 0, sizeof memb_addr);
+ /* Finally, check for libver bounds */
+ if(h5_get_libver_fapl(fapl_id) < 0)
+ goto error;
- HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
- memb_fapl[mt] = H5P_DEFAULT;
- if(NULL == (sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN)))
- return -1;
- HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
- memb_name[mt] = sv[mt];
- memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
- } /* end for */
+ return fapl_id;
- if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
+error:
+ if(fapl_id != H5I_INVALID_HID)
+ H5Pclose(fapl_id);
+ return H5I_INVALID_HID;
+} /* end h5_fileaccess() */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
- HDfree(sv[mt]);
- }
- else if(!HDstrcmp(name, "family")) {
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
- /* Family of files, each 1MB and using the default driver */
- if((val = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024);
- if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0)
- return -1;
- }
- else if(!HDstrcmp(name, "log")) {
- unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
+/*-------------------------------------------------------------------------
+ * Function: h5_fileaccess_flags
+ *
+ * Purpose: Returns a file access template which is the default template
+ * but with a file driver, VOL connector, or libver bound set
+ * according to a constant or environment variable
+ *
+ * Return: Success: A file access property list
+ * Failure: H5I_INVALID_HID
+ *
+ * Programmer: Robb Matzke
+ * Thursday, November 19, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+h5_fileaccess_flags(unsigned flags)
+{
+ hid_t fapl_id = H5I_INVALID_HID;
- /* Log file access */
- if((val = HDstrtok(NULL, " \t\n\r")))
- log_flags = (unsigned)HDstrtol(val, NULL, 0);
- if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
- }
- else if(!HDstrcmp(name, "direct")) {
-#ifdef H5_HAVE_DIRECT
- /* Linux direct read() and write() system calls. Set memory boundary, file block size,
- * and copy buffer size to the default values. */
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
- return -1;
-#endif
- }
- else if(!HDstrcmp(name, "latest")) {
- /* use the latest format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- }
- else {
- /* Unknown driver */
- return -1;
- }
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+
+ /* Attempt to set up a file driver first */
+ if((flags & H5_FILEACCESS_VFD) && h5_get_vfd_fapl(fapl_id) < 0)
+ goto error;
+
+ /* Finally, check for libver bounds */
+ if((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0)
+ goto error;
+
+ return fapl_id;
+
+error:
+ if(fapl_id != H5I_INVALID_HID)
+ H5Pclose(fapl_id);
+ return H5I_INVALID_HID;
+} /* end h5_fileaccess_flags() */
- return fapl;
-}
-
/*-------------------------------------------------------------------------
* Function: h5_get_vfd_fapl
*
- * Purpose: Returns a file access property list which is the default
- * fapl but with a file driver set according to the constant or
- * environment variable HDF5_DRIVER.
+ * Purpose: Sets the file driver for a FAPL according to the value specified
+ * in the constant or environment variable "HDF5_DRIVER".
*
- * Return: Success: A file access property list ID
+ * Return: Success: 0
* Failure: -1
*
* Programmer: Dana Robinson
@@ -1004,60 +928,59 @@ h5_fileaccess(void)
*
*-------------------------------------------------------------------------
*/
-hid_t
-h5_get_vfd_fapl(void)
+herr_t
+h5_get_vfd_fapl(hid_t fapl)
{
const char *env = NULL; /* HDF5_DRIVER environment variable */
const char *tok = NULL; /* strtok pointer */
+ char *lasts = NULL; /* Context pointer for strtok_r() call */
char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
- hid_t fapl = -1; /* fapl to be returned */
/* Get the environment variable, if it exists */
env = HDgetenv("HDF5_DRIVER");
-
- /* Create a default fapl */
- if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- return -1;
+#ifdef HDF5_DRIVER
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_DRIVER;
+#endif
/* If the environment variable was not set, just return
- * the default fapl.
+ * without modifying the FAPL.
*/
if(!env || !*env)
- return fapl;
+ goto done;
/* Get the first 'word' of the environment variable.
* If it's nothing (environment variable was whitespace)
* just return the default fapl.
*/
HDstrncpy(buf, env, sizeof(buf));
- HDmemset(buf, 0, sizeof(buf));
- if(NULL == (tok = HDstrtok(buf, " \t\n\r")))
- return fapl;
+ buf[sizeof(buf) - 1] = '\0';
+ if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts)))
+ goto done;
if(!HDstrcmp(tok, "sec2")) {
/* POSIX (section 2) read() and write() system calls */
if(H5Pset_fapl_sec2(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "stdio")) {
/* Standard C fread() and fwrite() system calls */
if(H5Pset_fapl_stdio(fapl) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "core")) {
/* In-memory driver settings (backing store on, 1 MB increment) */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
+ if(H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0)
+ goto error;
} else if(!HDstrcmp(tok, "core_paged")) {
/* In-memory driver with write tracking and paging on */
- if(H5Pset_fapl_core(fapl, (size_t)1, TRUE) < 0)
- return -1;
+ if(H5Pset_fapl_core(fapl, (size_t)H5_MB, TRUE) < 0)
+ goto error;
if(H5Pset_core_write_tracking(fapl, TRUE, (size_t)4096) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "split")) {
/* Split meta data and raw data each using default driver */
- if(H5Pset_fapl_split(fapl,
- "-m.h5", H5P_DEFAULT,
- "-r.h5", H5P_DEFAULT) < 0)
- return -1;
+ if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT) < 0)
+ goto error;
} else if(!HDstrcmp(tok, "multi")) {
/* Multi-file driver, general case of the split driver */
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
@@ -1073,7 +996,7 @@ h5_get_vfd_fapl(void)
HDmemset(memb_addr, 0, sizeof(memb_addr));
HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
memb_fapl[mt] = H5P_DEFAULT;
sv[mt] = (char *)HDmalloc(H5TEST_MULTI_FILENAME_LEN);
HDassert(sv[mt]);
@@ -1083,46 +1006,113 @@ h5_get_vfd_fapl(void)
} /* end for */
if(H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name, memb_addr, FALSE) < 0)
- return -1;
+ goto error;
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
HDfree(sv[mt]);
} else if(!HDstrcmp(tok, "family")) {
/* Family of files, each 1MB and using the default driver */
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
+ hsize_t fam_size = 100 * 1024 * 1024; /* 100 MB */
/* Was a family size specified in the environment variable? */
- if((tok = HDstrtok(NULL, " \t\n\r")))
- fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024*1024);
+ if((tok = HDstrtok_r(NULL, " \t\n\r", &lasts)))
+ fam_size = (hsize_t)(HDstrtod(tok, NULL) * 1024 * 1024);
if(H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT) < 0)
- return -1;
+ goto error;
} else if(!HDstrcmp(tok, "log")) {
/* Log file access */
unsigned log_flags = H5FD_LOG_LOC_IO | H5FD_LOG_ALLOC;
/* Were special log file flags specified in the environment variable? */
- if((tok = HDstrtok(NULL, " \t\n\r")))
+ if((tok = HDstrtok_r(NULL, " \t\n\r", &lasts)))
log_flags = (unsigned)HDstrtol(tok, NULL, 0);
if(H5Pset_fapl_log(fapl, NULL, log_flags, (size_t)0) < 0)
- return -1;
+ goto error;
#ifdef H5_HAVE_DIRECT
} else if(!HDstrcmp(tok, "direct")) {
/* Linux direct read() and write() system calls. Set memory boundary,
* file block size, and copy buffer size to the default values.
*/
- if(H5Pset_fapl_direct(fapl, 1024, 4096, 8*4096)<0)
- return -1;
+ if(H5Pset_fapl_direct(fapl, 1024, 4096, 8 * 4096) < 0)
+ goto error;
#endif
} else {
/* Unknown driver */
- return -1;
+ goto error;
} /* end if */
- return fapl;
+done:
+ return 0;
+
+error:
+ return -1;
} /* end h5_get_vfd_fapl() */
-
+
+/*-------------------------------------------------------------------------
+ * Function: h5_get_libver_fapl
+ *
+ * Purpose: Sets the library version bounds for a FAPL according to the
+ * value in the constant or environment variable "HDF5_LIBVER_BOUNDS".
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Quincey Koziol
+ * November 2018
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+h5_get_libver_fapl(hid_t fapl)
+{
+ const char *env = NULL; /* HDF5_DRIVER environment variable */
+ const char *tok = NULL; /* strtok pointer */
+ char *lasts = NULL; /* Context pointer for strtok_r() call */
+ char buf[1024]; /* buffer for tokenizing HDF5_DRIVER */
+
+ /* Get the environment variable, if it exists */
+ env = HDgetenv("HDF5_LIBVER_BOUNDS");
+#ifdef HDF5_LIBVER_BOUNDS
+ /* Use the environment variable, then the compile-time constant */
+ if(!env)
+ env = HDF5_LIBVER_BOUNDS;
+#endif
+
+ /* If the environment variable was not set, just return
+ * without modifying the FAPL.
+ */
+ if(!env || !*env)
+ goto done;
+
+ /* Get the first 'word' of the environment variable.
+ * If it's nothing (environment variable was whitespace)
+ * just return the default fapl.
+ */
+ HDstrncpy(buf, env, sizeof(buf));
+ buf[sizeof(buf) - 1] = '\0';
+ if(NULL == (tok = HDstrtok_r(buf, " \t\n\r", &lasts)))
+ goto done;
+
+ if(!HDstrcmp(tok, "latest")) {
+ /* use the latest format */
+ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
+ } /* end if */
+ else {
+ /* Unknown setting */
+ goto error;
+ } /* end else */
+
+done:
+ return 0;
+
+error:
+ return -1;
+} /* end h5_get_libver_fapl() */
+
+
/*-------------------------------------------------------------------------
* Function: h5_no_hwconv
*
@@ -1143,7 +1133,7 @@ h5_no_hwconv(void)
H5Tunregister(H5T_PERS_HARD, NULL, (hid_t)-1, (hid_t)-1, NULL);
}
-
+
/*-------------------------------------------------------------------------
* Function: h5_show_hostname
*
@@ -1177,15 +1167,13 @@ 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());
#else
- printf("thread 0.");
+ HDprintf("thread %" PRIu64 ".", H5TS_thread_id());
#endif
#ifdef H5_HAVE_WIN32_API
@@ -1210,19 +1198,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
@@ -1244,7 +1232,7 @@ h5_set_info_object(void)
int ret_value=0;
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
+ if ((envp = HDgetenv("HDF5_MPI_INFO")) != NULL){
char *next, *valp;
valp = envp = next = HDstrdup(envp);
@@ -1306,7 +1294,7 @@ h5_set_info_object(void)
/* actually set the darned thing */
if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
+ HDprintf("MPI_Info_set failed\n");
ret_value = -1;
}
}
@@ -1321,7 +1309,7 @@ h5_set_info_object(void)
return ret_value;
}
-
+
/*
* Function: h5_dump_info_object
* Purpose: Display content of an MPI Info object
@@ -1337,25 +1325,24 @@ 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,
- MPI_MAX_INFO_VAL);
+ HDprintf("Dumping MPI Info Object (up to %d bytes per item):\n", 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
*
@@ -1369,6 +1356,13 @@ h5_dump_info_object(MPI_Info info)
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * temp in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
h5_stat_size_t
h5_get_file_size(const char *filename, hid_t fapl)
{
@@ -1406,7 +1400,7 @@ h5_get_file_size(const char *filename, hid_t fapl)
h5_stat_size_t tot_size = 0;
HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
/* Create the filename to query */
HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]);
@@ -1470,27 +1464,29 @@ h5_get_file_size(const char *filename, hid_t fapl)
return(-1);
} /* end get_file_size() */
+H5_GCC_DIAG_ON(format-nonliteral)
/*
* This routine is designed to provide equivalent functionality to 'printf'
* and allow easy replacement for environments which don't have stdin/stdout
* available. (i.e. Windows & the Mac)
*/
+H5_ATTR_FORMAT(printf, 1, 2)
int
print_func(const char *format, ...)
{
va_list arglist;
int ret_value;
- 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 ret_value;
}
#ifdef H5_HAVE_FILTER_SZIP
-
+
/*-------------------------------------------------------------------------
* Function: h5_szip_can_encode
*
@@ -1569,7 +1565,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
int len;
static char* env = NULL;
- assert(name);
+ HDassert(name);
MPI_Initialized(&mpi_initialized);
MPI_Finalized(&mpi_finalized);
@@ -1577,7 +1573,7 @@ getenv_all(MPI_Comm comm, int root, const char* name)
if(mpi_initialized && !mpi_finalized) {
MPI_Comm_rank(comm, &mpi_rank);
MPI_Comm_size(comm, &mpi_size);
- assert(root < mpi_size);
+ HDassert(root < mpi_size);
/* The root task does the getenv call
* and sends the result to the other tasks */
@@ -1667,7 +1663,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;
@@ -1689,34 +1685,30 @@ error:
return -1;
} /* end h5_make_local_copy() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_verify_cached_stabs_cb
*
* Purpose: Callback function for h5_verify_cached_stabs.
*
- * Return: Success: 0
- *
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Neil Fortner
* Tuesday, April 12, 2011
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
h5_verify_cached_stabs_cb(hid_t oid, const char H5_ATTR_UNUSED *name,
- const H5O_info_t *oinfo, void H5_ATTR_UNUSED *udata)
+ const H5O_info2_t *oinfo, void H5_ATTR_UNUSED *udata)
{
if(oinfo->type == H5O_TYPE_GROUP)
- return(H5G__verify_cached_stabs_test(oid));
+ return H5G__verify_cached_stabs_test(oid);
else
- return(0);
+ return SUCCEED;
} /* end h5_verify_cached_stabs_cb() */
-
+
/*-------------------------------------------------------------------------
* Function: h5_verify_cached_stabs
*
@@ -1756,8 +1748,8 @@ h5_verify_cached_stabs(const char *base_name[], hid_t fapl)
continue;
} /* end if */
- if(H5Ovisit(file, H5_INDEX_NAME, H5_ITER_NATIVE,
- h5_verify_cached_stabs_cb, NULL) < 0)
+ if(H5Ovisit3(file, H5_INDEX_NAME, H5_ITER_NATIVE,
+ h5_verify_cached_stabs_cb, NULL, H5O_INFO_BASIC) < 0)
goto error;
if(H5Fclose(file) < 0)
@@ -1779,16 +1771,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
@@ -1798,7 +1790,7 @@ error:
*
* Programmer: Mike McGreevy
* August 18, 2010
- *
+ *
*-------------------------------------------------------------------------
*/
void
@@ -1817,7 +1809,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);
@@ -1830,38 +1822,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);
@@ -1890,6 +1882,69 @@ error:
return FAIL;
} /* h5_wait_message() */
+/* Functions for the dummy VFD class (see below).
+ *
+ * Useful for testing things like ID handling where we shouldn't mess with the
+ * real VFDs.
+ */
+static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
+static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; }
+
+static herr_t dummy_vfd_close(H5FD_t *_file);
+static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; }
+
+static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type);
+static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
+
+static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
+static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; }
+
+static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type);
+static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
+
+static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf);
+static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; }
+
+static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf);
+static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; }
+
+/* Dummy VFD with the minimum parameters to make a VFD that can be registered */
+static const H5FD_class_t H5FD_dummy_g = {
+ "dummy", /* name */
+ 1, /* maxaddr */
+ H5F_CLOSE_WEAK, /* fc_degree */
+ NULL, /* terminate */
+ NULL, /* sb_size */
+ NULL, /* sb_encode */
+ NULL, /* sb_decode */
+ 0, /* fapl_size */
+ NULL, /* fapl_get */
+ NULL, /* fapl_copy */
+ NULL, /* fapl_free */
+ 0, /* dxpl_size */
+ NULL, /* dxpl_copy */
+ NULL, /* dxpl_free */
+ dummy_vfd_open, /* open */
+ dummy_vfd_close, /* close */
+ NULL, /* cmp */
+ NULL, /* query */
+ NULL, /* get_type_map */
+ NULL, /* alloc */
+ NULL, /* free */
+ dummy_vfd_get_eoa, /* get_eoa */
+ dummy_vfd_set_eoa, /* set_eoa */
+ dummy_vfd_get_eof, /* get_eof */
+ NULL, /* get_handle */
+ dummy_vfd_read, /* read */
+ dummy_vfd_write, /* write */
+ NULL, /* flush */
+ NULL, /* truncate */
+ NULL, /* lock */
+ NULL, /* unlock */
+ H5FD_FLMAP_DICHOTOMY /* fl_map */
+};
+
+
/*-------------------------------------------------------------------------
* Function: h5_get_dummy_vfd_class()
*
@@ -1913,12 +1968,14 @@ error:
H5FD_class_t *
h5_get_dummy_vfd_class(void)
{
- H5FD_class_t *vfd_class = NULL;
+ H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */
+ /* Create the class and initialize everything to zero/NULL */
if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t))))
TEST_ERROR;
- HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t));
+ /* Copy the dummy VFD */
+ HDmemcpy(vfd_class, &H5FD_dummy_g, sizeof(H5FD_class_t));
return vfd_class;
@@ -1928,3 +1985,187 @@ error:
return NULL;
} /* h5_get_dummy_vfd_class */
+/*-------------------------------------------------------------------------
+ * Function: h5_get_dummy_vol_class()
+ *
+ * Purpose: Returns a disposable, generally non-functional,
+ * VOL class struct.
+ *
+ * In some of the test code, we need a disposable VOL connector
+ * but we don't want to mess with the real VFDs and we also
+ * don't have access to the internals of the real VOL connectors
+ * (which use static globals and functions) to easily duplicate
+ * them (e.g.: for testing VOL connector ID handling).
+ *
+ * This API call will return a pointer to a VOL class that
+ * can be used to construct a test VOL using H5VLregister_connector().
+ *
+ * Return: Success: A pointer to a VOL class struct
+ * Failure: NULL
+ *
+ *-------------------------------------------------------------------------
+ */
+H5VL_class_t *
+h5_get_dummy_vol_class(void)
+{
+ H5VL_class_t *vol_class = NULL; /* Dummy VOL class that will be returned */
+
+ /* Create the class and initialize everything to zero/NULL */
+ if(NULL == (vol_class = (H5VL_class_t *)HDcalloc((size_t)1, sizeof(H5VL_class_t))))
+ TEST_ERROR;
+
+ /* Fill in the minimum parameters to make a VOL connector class that
+ * can be registered.
+ */
+ vol_class->name = "dummy";
+
+ return vol_class;
+
+error:
+ if(vol_class)
+ HDfree(vol_class);
+ return NULL;
+} /* h5_get_dummy_vol_class */
+
+/*-------------------------------------------------------------------------
+ * Function: h5_get_version_string
+ *
+ * Purpose: Get the string that corresponds to the libvery version bound.
+ *
+ * Return: The string
+ *
+ *-------------------------------------------------------------------------
+ */
+H5_ATTR_PURE const char *
+h5_get_version_string(H5F_libver_t libver)
+{
+ return(LIBVER_NAMES[libver]);
+} /* end of h5_get_version_string */
+
+/*-------------------------------------------------------------------------
+ * Function: h5_compare_file_bytes()
+ *
+ * Purpose: Helper function to compare two files byte-for-byte.
+ *
+ * Return: Success: 0, if files are identical
+ * Failure: -1, if files differ
+ *
+ * Programmer: Binh-Minh Ribler
+ * October, 2018
+ *-------------------------------------------------------------------------
+ */
+int
+h5_compare_file_bytes(char *f1name, char *f2name)
+{
+ FILE *f1ptr = NULL; /* two file pointers */
+ FILE *f2ptr = NULL;
+ hsize_t f1size = 0; /* size of the files */
+ hsize_t f2size = 0;
+ char f1char = 0; /* one char from each file */
+ char f2char = 0;
+ hsize_t ii = 0;
+ int ret_value = 0; /* for error handling */
+
+ /* Open files for reading */
+ f1ptr = fopen(f1name, "r");
+ if (f1ptr == NULL) {
+ HDfprintf(stderr, "Unable to fopen() %s\n", f1name);
+ ret_value = -1;
+ goto done;
+ }
+ f2ptr = fopen(f2name, "r");
+ if (f2ptr == NULL) {
+ HDfprintf(stderr, "Unable to fopen() %s\n", f2name);
+ ret_value = -1;
+ goto done;
+ }
+
+ /* Get the file sizes and verify that they equal */
+ fseek(f1ptr , 0 , SEEK_END);
+ f1size = ftell(f1ptr);
+
+ fseek(f2ptr , 0 , SEEK_END);
+ f2size = ftell(f2ptr);
+
+ if (f1size != f2size) {
+ HDfprintf(stderr, "Files differ in size, %llu vs. %llu\n", f1size, f2size);
+ ret_value = -1;
+ goto done;
+ }
+
+ /* Compare each byte and fail if a difference is found */
+ rewind(f1ptr);
+ rewind(f2ptr);
+ for (ii = 0; ii < f1size; ii++) {
+ fread(&f1char, 1, 1, f1ptr);
+ fread(&f2char, 1, 1, f2ptr);
+ if (f1char != f2char) {
+ HDfprintf(stderr, "Mismatch @ 0x%llX: 0x%X != 0x%X\n", ii, f1char, f2char);
+ ret_value = -1;
+ goto done;
+ }
+ }
+
+done:
+ if (f1ptr) {
+ fclose(f1ptr);
+ }
+ if (f2ptr) {
+ fclose(f2ptr);
+ }
+ return(ret_value);
+} /* end h5_compare_file_bytes() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5_get_srcdir_filename
+ *
+ * Purpose: Append the test file name to the srcdir path and return the whole string
+ *
+ * Return: The string
+ *
+ *-------------------------------------------------------------------------
+ */
+const char *H5_get_srcdir_filename(const char *filename)
+{
+ const char *srcdir = H5_get_srcdir();
+
+ /* Check for error */
+ if(NULL == srcdir)
+ return(NULL);
+ else {
+ /* Build path to test file */
+ if((HDstrlen(srcdir) + HDstrlen(filename) + 1) < sizeof(srcdir_testpath)) {
+ HDsnprintf(srcdir_testpath, sizeof(srcdir_testpath), "%s%s", srcdir, filename);
+ return(srcdir_testpath);
+ } /* end if */
+ else
+ return(NULL);
+ } /* end else */
+} /* end H5_get_srcdir_filename() */
+
+/*-------------------------------------------------------------------------
+ * Function: H5_get_srcdir
+ *
+ * Purpose: Just return the srcdir path
+ *
+ * Return: The string
+ *
+ *-------------------------------------------------------------------------
+ */
+const char *H5_get_srcdir(void)
+{
+ const char *srcdir = HDgetenv("srcdir");
+
+ /* Check for using the srcdir from configure time */
+ if(NULL == srcdir)
+ srcdir = config_srcdir;
+
+ /* Build path to all test files */
+ if((HDstrlen(srcdir) + 2) < sizeof(srcdir_path)) {
+ HDsnprintf(srcdir_path, sizeof(srcdir_path), "%s/", srcdir);
+ return(srcdir_path);
+ } /* end if */
+ else
+ return(NULL);
+} /* end H5_get_srcdir() */
+
diff --git a/test/h5test.h b/test/h5test.h
index ce5c64d..b1ddc58 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -20,8 +20,13 @@
#ifndef _H5TEST_H
#define _H5TEST_H
+/*
+ * Include required headers. This file tests internal library functions,
+ * so we include the private headers here.
+ */
#include "hdf5.h"
#include "H5private.h"
+#include "H5Eprivate.h"
/*
* Predefined test verbosity levels.
@@ -73,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;
@@ -84,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);
/*
@@ -96,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 %-62s",WHAT); fflush(stdout);}
-#define PASSED() {puts(" PASSED");fflush(stdout);}
-#define H5_FAILED() {puts("*FAILED*");fflush(stdout);}
-#define H5_WARNING() {puts("*WARNING*");fflush(stdout);}
-#define SKIPPED() {puts(" -SKIP-");fflush(stdout);}
-#define PUTS_ERROR(s) {puts(s); AT(); goto error;}
+#define TESTING(WHAT) {HDprintf("Testing %-62s",WHAT); HDfflush(stdout);}
+#define TESTING_2(WHAT) {HDprintf(" Testing %-60s",WHAT); HDfflush(stdout);}
+#define PASSED() do {HDputs(" PASSED");HDfflush(stdout);} while (0)
+#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.
@@ -116,6 +121,69 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#define ALARM_ON TestAlarmOn()
#define ALARM_OFF HDalarm(0)
+/* Flags for h5_fileaccess_flags() */
+#define H5_FILEACCESS_VFD 0x01
+#define H5_FILEACCESS_LIBVER 0x02
+
+/* Macros to create and fill 2D arrays with a single heap allocation.
+ * These can be used to replace large stack and global arrays which raise
+ * warnings.
+ *
+ * The macros make a single heap allocation large enough to hold all the
+ * pointers and the data elements. The first part of the allocation holds
+ * the pointers, and the second part holds the data as a contiguous block
+ * in row-major order.
+ *
+ * To pass the data block to calls like H5Dread(), pass a pointer to the
+ * first array element as the data pointer (e.g., array[0] in a 2D array).
+ *
+ * The fill macro just fills the array with an increasing count value.
+ *
+ * Usage:
+ *
+ * int **array;
+ *
+ * H5TEST_ALLOCATE_2D_ARRAY(array, int, 5, 10);
+ *
+ * H5TEST_FILL_2D_ARRAY(array, int, 5, 10);
+ *
+ * (do stuff)
+ *
+ * HDfree(array);
+ */
+#define H5TEST_ALLOCATE_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \
+do { \
+ /* Prefix with h5taa to avoid shadow warnings */ \
+ size_t h5taa_pointers_size = 0; \
+ size_t h5taa_data_size = 0; \
+ int h5taa_i; \
+ \
+ h5taa_pointers_size = (DIMS_I) * sizeof(TYPE *); \
+ h5taa_data_size = (DIMS_I) * (DIMS_J) * sizeof(TYPE); \
+ \
+ ARR = (TYPE **)HDmalloc(h5taa_pointers_size + h5taa_data_size); \
+ \
+ ARR[0] = (TYPE *)(ARR + (DIMS_I)); \
+ \
+ for (h5taa_i = 1; h5taa_i < (DIMS_I); h5taa_i++) \
+ ARR[h5taa_i] = ARR[h5taa_i-1] + (DIMS_J); \
+} while(0)
+
+#define H5TEST_FILL_2D_ARRAY(ARR, TYPE, DIMS_I, DIMS_J) \
+do { \
+ /* Prefix with h5tfa to avoid shadow warnings */ \
+ int h5tfa_i = 0; \
+ int h5tfa_j = 0; \
+ TYPE h5tfa_count = 0; \
+ \
+ for (h5tfa_i = 0; h5tfa_i < (DIMS_I); h5tfa_i++) \
+ for (h5tfa_j = 0; h5tfa_j < (DIMS_J); h5tfa_j++) { \
+ ARR[h5tfa_i][h5tfa_j] = h5tfa_count; \
+ h5tfa_count++; \
+ } \
+} while(0)
+
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -124,9 +192,11 @@ extern "C" {
H5TEST_DLL void h5_clean_files(const char *base_name[], hid_t fapl);
H5TEST_DLL int h5_cleanup(const char *base_name[], hid_t fapl);
H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size);
+H5TEST_DLL char *h5_fixname_superblock(const char *base_name, hid_t fapl, char *fullname, size_t size);
H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size);
H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size);
H5TEST_DLL hid_t h5_fileaccess(void);
+H5TEST_DLL hid_t h5_fileaccess_flags(unsigned flags);
H5TEST_DLL void h5_no_hwconv(void);
H5TEST_DLL const char *h5_rmprefix(const char *filename);
H5TEST_DLL void h5_reset(void);
@@ -137,13 +207,13 @@ H5TEST_DLL int print_func(const char *format, ...);
H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name);
H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
+H5TEST_DLL H5VL_class_t *h5_get_dummy_vol_class(void);
+H5TEST_DLL const char *h5_get_version_string(H5F_libver_t libver);
+H5TEST_DLL int h5_compare_file_bytes(char *fname1, char *fname2);
-/* Functions that will replace VFD-dependent functions that violate
- * the single responsibility principle. Unlike their predecessors,
- * these new functions do not have hidden side effects.
- */
-/* h5_fileaccess() replacement */
-H5TEST_DLL hid_t h5_get_vfd_fapl(void);
+/* Functions that will replace components of a FAPL */
+H5TEST_DLL herr_t h5_get_vfd_fapl(hid_t fapl_id);
+H5TEST_DLL herr_t h5_get_libver_fapl(hid_t fapl_id);
/* h5_clean_files() replacements */
H5TEST_DLL void h5_delete_test_file(const char *base_name, hid_t fapl);
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 c28d872..e702023 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -11,110 +11,108 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Friday, October 10, 1997
+/* Programmer: Robb Matzke <matzke@llnl.gov>
+ * Friday, October 10, 1997
*
- * Purpose: Hyperslab operations are rather complex, so this file
- * attempts to test them extensively so we can be relatively
- * sure they really work. We only test 1d, 2d, and 3d cases
- * because testing general dimensionalities would require us to
- * rewrite much of the hyperslab stuff.
+ * Purpose: Hyperslab operations are rather complex, so this file
+ * attempts to test them extensively so we can be relatively
+ * sure they really work. We only test 1d, 2d, and 3d cases
+ * because testing general dimensionalities would require us to
+ * rewrite much of the hyperslab stuff.
*/
#include "h5test.h"
-#include "H5private.h"
-#include "H5Eprivate.h"
#include "H5VMprivate.h"
-#define TEST_SMALL 0x0001
-#define TEST_MEDIUM 0x0002
+#define TEST_SMALL 0x0001
+#define TEST_MEDIUM 0x0002
-#define VARIABLE_SRC 0
-#define VARIABLE_DST 1
-#define VARIABLE_BOTH 2
+#define VARIABLE_SRC 0
+#define VARIABLE_DST 1
+#define VARIABLE_BOTH 2
#define ARRAY_FILL_SIZE 4
#define ARRAY_OFFSET_NDIMS 3
-
+
/*-------------------------------------------------------------------------
- * Function: init_full
+ * Function: init_full
*
- * Purpose: Initialize full array.
+ * Purpose: Initialize full array.
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
static unsigned
init_full(uint8_t *array, size_t nx, size_t ny, size_t nz)
{
- uint8_t acc = 128;
- unsigned total = 0;
- size_t i, j, k;
+ uint8_t acc = 128;
+ unsigned total = 0;
+ size_t i, j, k;
for(i = 0; i < nx; i++)
- for(j = 0; j < ny; j++)
- for(k = 0; k < nz; k++) {
- total += acc;
- *array = acc;
- acc++;
- array++;
- } /* end for */
+ for(j = 0; j < ny; j++)
+ for(k = 0; k < nz; k++) {
+ total += acc;
+ *array = acc;
+ acc++;
+ array++;
+ } /* end for */
return total;
} /* end init_full() */
-
+
/*-------------------------------------------------------------------------
- * Function: print_array
+ * Function: print_array
*
- * Purpose: Prints the values in an array
+ * Purpose: Prints the values in an array
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
static void
print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
{
- size_t i, j, k;
+ size_t i, j, k;
for(i = 0; i < nx; i++) {
- if(nz > 1)
- printf("i=%lu:\n", (unsigned long)i);
- else
- printf("%03lu:", (unsigned long)i);
-
- for(j = 0; j < ny; j++) {
- if(nz > 1)
- printf("%03lu:", (unsigned long)j);
- for(k = 0; k < nz; k++)
- printf(" %3d", *array++);
- if(nz > 1)
- printf("\n");
- } /* end for */
- printf("\n");
+ if(nz > 1)
+ HDprintf("i=%lu:\n", (unsigned long)i);
+ else
+ HDprintf("%03lu:", (unsigned long)i);
+
+ for(j = 0; j < ny; j++) {
+ if(nz > 1)
+ HDprintf("%03lu:", (unsigned long)j);
+ for(k = 0; k < nz; k++)
+ HDprintf(" %3d", *array++);
+ if(nz > 1)
+ HDprintf("\n");
+ } /* end for */
+ HDprintf("\n");
} /* end for */
} /* end print_array() */
-
+
/*-------------------------------------------------------------------------
- * Function: print_ref
+ * Function: print_ref
*
- * Purpose: Prints the reference value
+ * Purpose: Prints the reference value
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure:
+ * Failure:
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
@@ -124,44 +122,44 @@ 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);
} /* end if */
} /* end print_ref() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_fill
+ * Function: test_fill
*
- * Purpose: Tests the H5VM_hyper_fill() function.
+ * Purpose: Tests the H5VM_hyper_fill() function.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_fill(size_t nx, size_t ny, size_t nz,
- size_t di, size_t dj, size_t dk,
- size_t ddx, size_t ddy, size_t ddz)
+ size_t di, size_t dj, size_t dk,
+ size_t ddx, size_t ddy, size_t ddz)
{
- uint8_t *dst = NULL; /*destination array */
- hsize_t hs_size[3]; /*hyperslab size */
- hsize_t dst_size[3]; /*destination total size */
+ uint8_t *dst = NULL; /*destination array */
+ hsize_t hs_size[3]; /*hyperslab size */
+ hsize_t dst_size[3]; /*destination total size */
hsize_t dst_offset[3]; /*offset of hyperslab in dest */
- unsigned ref_value; /*reference value */
- unsigned acc; /*accumulator */
- size_t i, j, k, dx, dy, dz; /*counters */
+ unsigned ref_value; /*reference value */
+ unsigned acc; /*accumulator */
+ size_t i, j, k, dx, dy, dz; /*counters */
size_t u, v, w;
- unsigned ndims; /*hyperslab dimensionality */
- char dim[64], s[256]; /*temp string */
- unsigned fill_value; /*fill value */
+ unsigned ndims; /*hyperslab dimensionality */
+ char dim[64], s[256]; /*temp string */
+ unsigned fill_value; /*fill value */
/*
* Dimensionality.
@@ -170,27 +168,27 @@ 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 */
if(NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz)))
TEST_ERROR
-
+
init_full(dst, nx, ny, nz);
for(i = 0; i < nx; i += di) {
@@ -244,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,
@@ -254,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;
@@ -267,7 +265,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
} /* end for */
} /* end for */
- PASSED()
+ PASSED();
HDfree(dst);
@@ -279,52 +277,52 @@ error:
return FAIL;
} /* end test_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_copy
+ * Function: test_copy
*
- * Purpose: Tests H5VM_hyper_copy().
+ * Purpose: Tests H5VM_hyper_copy().
*
- * The NX, NY, and NZ arguments are the size for the source and
- * destination arrays. You may pass zero for NZ or for NY and
- * NZ to test the 2-d and 1-d cases respectively.
+ * The NX, NY, and NZ arguments are the size for the source and
+ * destination arrays. You may pass zero for NZ or for NY and
+ * NZ to test the 2-d and 1-d cases respectively.
*
- * A hyperslab is copied from/to (depending on MODE) various
- * places in SRC and DST beginning at 0,0,0 and increasing
- * location by DI,DJ,DK in the x, y, and z directions.
+ * A hyperslab is copied from/to (depending on MODE) various
+ * places in SRC and DST beginning at 0,0,0 and increasing
+ * location by DI,DJ,DK in the x, y, and z directions.
*
- * For each hyperslab location, various sizes of hyperslabs are
- * tried beginning with 1x1x1 and increasing the size in each
- * dimension by DDX,DDY,DDZ.
+ * For each hyperslab location, various sizes of hyperslabs are
+ * tried beginning with 1x1x1 and increasing the size in each
+ * dimension by DDX,DDY,DDZ.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_copy(int mode,
- size_t nx, size_t ny, size_t nz,
- size_t di, size_t dj, size_t dk,
- size_t ddx, size_t ddy, size_t ddz)
+ size_t nx, size_t ny, size_t nz,
+ size_t di, size_t dj, size_t dk,
+ size_t ddx, size_t ddy, size_t ddz)
{
- uint8_t *src = NULL; /*source array */
- uint8_t *dst = NULL; /*destination array */
- hsize_t hs_size[3]; /*hyperslab size */
- hsize_t dst_size[3]; /*destination total size */
- hsize_t src_size[3]; /*source total size */
- hsize_t dst_offset[3]; /*offset of hyperslab in dest */
+ uint8_t *src = NULL; /*source array */
+ uint8_t *dst = NULL; /*destination array */
+ hsize_t hs_size[3]; /*hyperslab size */
+ hsize_t dst_size[3]; /*destination total size */
+ hsize_t src_size[3]; /*source total size */
+ hsize_t dst_offset[3]; /*offset of hyperslab in dest */
hsize_t src_offset[3]; /*offset of hyperslab in source */
- unsigned ref_value; /*reference value */
- unsigned acc; /*accumulator */
- hsize_t i, j, k, dx, dy, dz; /*counters */
+ unsigned ref_value; /*reference value */
+ unsigned acc; /*accumulator */
+ hsize_t i, j, k, dx, dy, dz; /*counters */
hsize_t u, v, w;
- unsigned ndims; /*hyperslab dimensionality */
- char dim[64], s[256]; /*temp string */
+ unsigned ndims; /*hyperslab dimensionality */
+ char dim[64], s[256]; /*temp string */
const char *sub;
/*
@@ -334,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 */
@@ -378,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);
/*
@@ -483,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,
@@ -493,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;
@@ -524,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,
@@ -535,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;
@@ -547,7 +545,7 @@ test_copy(int mode,
} /* end for */
} /* end for */
- PASSED()
+ PASSED();
HDfree(src);
HDfree(dst);
@@ -563,40 +561,40 @@ error:
return FAIL;
} /* end test_copy() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_multifill
+ * Function: test_multifill
*
- * Purpose: Tests the H5VM_stride_copy() function by using it to fill a
- * hyperslab by replicating a multi-byte sequence. This might
- * be useful to initialize an array of structs with a default
- * struct value, or to initialize an array of floating-point
- * values with a default bit-pattern.
+ * Purpose: Tests the H5VM_stride_copy() function by using it to fill a
+ * hyperslab by replicating a multi-byte sequence. This might
+ * be useful to initialize an array of structs with a default
+ * struct value, or to initialize an array of floating-point
+ * values with a default bit-pattern.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_multifill(size_t nx)
{
- hsize_t size;
- hsize_t src_stride;
- hsize_t dst_stride;
- char s[64];
+ hsize_t size;
+ hsize_t src_stride;
+ hsize_t dst_stride;
+ char s[64];
struct a_struct {
int left;
double mid;
int right;
} fill, *src = NULL, *dst = NULL;
- hsize_t i, j;
+ 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 */
@@ -615,7 +613,7 @@ test_multifill(size_t nx)
} /* end for */
/*
- * Describe the fill value. The zero stride says to read the same thing
+ * Describe the fill value. The zero stride says to read the same thing
* over and over again.
*/
fill.left = 55555555;
@@ -641,34 +639,34 @@ 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 */
} /* end for */
- PASSED()
+ PASSED();
HDfree(src);
HDfree(dst);
@@ -684,34 +682,34 @@ error:
return FAIL;
} /* end test_multifill() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_endian
+ * Function: test_endian
*
- * Purpose: Tests the H5VM_stride_copy() function by using it to copy an
- * array of integers and swap the byte ordering from little
- * endian to big endian or vice versa depending on the hardware.
+ * Purpose: Tests the H5VM_stride_copy() function by using it to copy an
+ * array of integers and swap the byte ordering from little
+ * endian to big endian or vice versa depending on the hardware.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_endian(size_t nx)
{
- uint8_t *src = NULL; /*source array */
- uint8_t *dst = NULL; /*destination array */
- hssize_t src_stride[2]; /*source strides */
- hssize_t dst_stride[2]; /*destination strides */
- hsize_t size[2]; /*size vector */
- hsize_t i, j;
-
- printf("%-70s", "Testing endian conversion by stride");
+ uint8_t *src = NULL; /*source array */
+ uint8_t *dst = NULL; /*destination array */
+ hssize_t src_stride[2]; /*source strides */
+ hssize_t dst_stride[2]; /*destination strides */
+ hsize_t size[2]; /*size vector */
+ hsize_t i, j;
+
+ HDprintf("%-70s", "Testing endian conversion by stride");
fflush(stdout);
/* Initialize arrays */
@@ -744,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;
@@ -755,7 +753,7 @@ test_endian(size_t nx)
} /* end for */
} /* end for */
- PASSED()
+ PASSED();
HDfree(src);
HDfree(dst);
@@ -771,35 +769,35 @@ error:
return FAIL;
} /* end test_endian() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_transpose
+ * Function: test_transpose
*
- * Purpose: Copy a 2d array from here to there and transpose the elements
- * as it's copied.
+ * Purpose: Copy a 2d array from here to there and transpose the elements
+ * as it's copied.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Saturday, October 11, 1997
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_transpose(size_t nx, size_t ny)
{
- int *src = NULL;
- int *dst = NULL;
- hsize_t src_stride[2], dst_stride[2];
- hsize_t size[2];
- char s[256];
- hsize_t i, j;
-
- sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx,
+ int *src = NULL;
+ int *dst = NULL;
+ hsize_t src_stride[2], dst_stride[2];
+ hsize_t size[2];
+ char s[256];
+ hsize_t i, j;
+
+ HDsprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx,
(unsigned long)ny);
- printf("%-70s", s);
+ HDprintf("%-70s", s);
fflush(stdout);
/* Initialize */
@@ -821,12 +819,8 @@ test_transpose(size_t nx, size_t ny)
dst_stride[1] = (hsize_t)(nx * sizeof(*src));
/* Copy and transpose */
- if(nx == ny)
- H5VM_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst,
- src_stride, src);
- else
- H5VM_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst,
- src_stride, src);
+ H5VM_stride_copy(2, (hsize_t)sizeof(*src), size, dst_stride, dst,
+ src_stride, src);
/* Check */
for(i = 0; i < nx; i++) {
@@ -835,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;
@@ -856,7 +850,7 @@ test_transpose(size_t nx, size_t ny)
} /* end for */
} /* end for */
- PASSED()
+ PASSED();
HDfree(src);
HDfree(dst);
@@ -872,40 +866,40 @@ error:
return FAIL;
} /* end test_transpose() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_sub_super
+ * Function: test_sub_super
*
- * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image
- * by copying half the pixels in the X and Y directions. Then
- * we use the small image and duplicate every pixel to result in
- * a 2x2 square.
+ * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image
+ * by copying half the pixels in the X and Y directions. Then
+ * we use the small image and duplicate every pixel to result in
+ * a 2x2 square.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Monday, October 13, 1997
+ * Programmer: Robb Matzke
+ * Monday, October 13, 1997
*
*-------------------------------------------------------------------------
*/
static herr_t
test_sub_super(size_t nx, size_t ny)
{
- uint8_t *full = NULL; /*original image */
- uint8_t *half = NULL; /*image at 1/2 resolution */
- uint8_t *twice = NULL; /*2x2 pixels */
- hsize_t src_stride[4]; /*source stride info */
- hsize_t dst_stride[4]; /*destination stride info */
- hsize_t size[4]; /*number of sample points */
- hsize_t i, j;
- char s[256];
-
- sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ",
+ uint8_t *full = NULL; /*original image */
+ uint8_t *half = NULL; /*image at 1/2 resolution */
+ uint8_t *twice = NULL; /*2x2 pixels */
+ hsize_t src_stride[4]; /*source stride info */
+ hsize_t dst_stride[4]; /*destination stride info */
+ hsize_t size[4]; /*number of sample points */
+ hsize_t i, j;
+ char s[256];
+
+ 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 */
@@ -937,28 +931,28 @@ 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;
} /* end if */
} /* end for */
} /* end for */
- PASSED()
+ PASSED();
/*
* 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 */
@@ -984,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;
@@ -1013,7 +1007,7 @@ test_sub_super(size_t nx, size_t ny)
} /* end for */
} /* end for */
- PASSED()
+ PASSED();
HDfree(full);
HDfree(half);
@@ -1032,20 +1026,20 @@ error:
return FAIL;
} /* test_sub_super() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_array_fill
+ * Function: test_array_fill
*
- * Purpose: Tests H5VM_array_fill routine by copying a multibyte value
+ * Purpose: Tests H5VM_array_fill routine by copying a multibyte value
* (an array of ints, in our case) into all the elements of an
* array.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Monday, April 21, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 21, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1054,10 +1048,10 @@ test_array_fill(size_t lo, size_t hi)
{
int *dst = NULL; /* Destination */
int src[ARRAY_FILL_SIZE]; /* Source to duplicate */
- size_t u, v, w; /* Local index variables */
- char s[256];
+ 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 */
@@ -1093,20 +1087,20 @@ error:
return FAIL;
} /* end test_array_fill() */
-
+
/*-------------------------------------------------------------------------
- * Function: test_array_offset_n_calc
+ * Function: test_array_offset_n_calc
*
- * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing
+ * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing
* computed array offsets against calculated ones and then going
* back to the coordinates from the offset and checking those.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Quincey Koziol
- * Monday, April 21, 2003
+ * Programmer: Quincey Koziol
+ * Monday, April 21, 2003
*
*-------------------------------------------------------------------------
*/
@@ -1116,13 +1110,13 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z)
hsize_t *a = NULL;
hsize_t *temp_a; /* Array for stored calculated offsets */
hsize_t off; /* Offset in array */
- size_t u, v, w; /* Local index variables */
+ size_t u, v, w; /* Local index variables */
hsize_t dims[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of array to check */
hsize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */
hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */
- char s[256];
+ 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 */
@@ -1178,29 +1172,27 @@ error:
return FAIL;
} /* end test_array_offset_n_calc() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Test various hyperslab operations. Give the words
- * `small' and/or `medium' on the command line or only `small'
- * is assumed.
+ * Function: main
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Purpose: Test various hyperslab operations. Give the words
+ * 'small' and/or 'medium' on the command line or only 'small'
+ * is assumed.
*
- * Failure: exit(EXIT_FAILURE)
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
*-------------------------------------------------------------------------
*/
int
main(int argc, char *argv[])
{
- herr_t status;
- int nerrors = 0;
- unsigned size_of_test;
+ herr_t status;
+ int nerrors = 0;
+ unsigned size_of_test;
/* Parse arguments or assume `small' & `medium' */
if(1 == argc)
@@ -1214,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));
@@ -1431,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 c401e87..c8fe866 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -11,24 +11,22 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* Programmer: Robb Matzke <matzke@llnl.gov>
- * Wednesday, October 15, 1997
+/* Programmer: Robb Matzke <matzke@llnl.gov>
+ * Wednesday, October 15, 1997
*
- * Purpose: Tests various aspects of indexed raw data storage.
+ * Purpose: Tests various aspects of indexed raw data storage.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#include "h5test.h"
-#include "H5private.h"
+
#include "H5Dprivate.h"
-#include "H5Eprivate.h"
#include "H5Iprivate.h"
#include "H5Pprivate.h"
#include "H5Fpkg.h"
#include "H5Gprivate.h"
#include "H5Oprivate.h"
-#include "H5Pprivate.h"
#include "H5VMprivate.h"
const char *FILENAME[] = {
@@ -37,9 +35,9 @@ const char *FILENAME[] = {
};
-#define TEST_SMALL 0x0001
-#define TEST_MEDIUM 0x0002
-#define TEST_LARGE 0x0004
+#define TEST_SMALL 0x0001
+#define TEST_MEDIUM 0x0002
+#define TEST_LARGE 0x0004
/* The datatype of the dataset operated on by this test */
#define TEST_DATATYPE H5T_NATIVE_UCHAR
@@ -50,19 +48,19 @@ const char *FILENAME[] = {
hsize_t chunk_dims[H5O_LAYOUT_NDIMS];
hsize_t zero[H5O_LAYOUT_NDIMS];
-
+
/*-------------------------------------------------------------------------
- * Function: is_sparse
+ * Function: is_sparse
*
- * Purpose: Determines if the file system of the current working
- * directory supports holes.
+ * Purpose: Determines if the file system of the current working
+ * directory supports holes.
*
- * Return: Success: Non-zero if holes are supported; zero
- * otherwise.
+ * Return: Success: Non-zero if holes are supported; zero
+ * otherwise.
*
- * Failure: zero
+ * Failure: zero
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Wednesday, July 15, 1998
*
*-------------------------------------------------------------------------
@@ -70,8 +68,8 @@ hsize_t zero[H5O_LAYOUT_NDIMS];
static int
is_sparse(void)
{
- int fd;
- h5_stat_t sb;
+ int fd;
+ h5_stat_t sb;
if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0;
if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0;
@@ -86,16 +84,16 @@ is_sparse(void)
#endif
}
-
+
/*-------------------------------------------------------------------------
- * Function: print_array
+ * Function: print_array
*
- * Purpose: Prints the values in an array
+ * Purpose: Prints the values in an array
*
- * Return: void
+ * Return: void
*
- * Programmer: Robb Matzke
- * Friday, October 10, 1997
+ * Programmer: Robb Matzke
+ * Friday, October 10, 1997
*
* Modifications:
*
@@ -104,41 +102,41 @@ is_sparse(void)
static void
print_array(uint8_t *array, size_t nx, size_t ny, size_t nz)
{
- size_t i, j, k;
+ size_t i, j, k;
for (i = 0; i < nx; i++) {
- if (nz > 1) {
- fprintf(stderr,"i=%lu:\n", (unsigned long)i);
- } else {
- fprintf(stderr,"%03lu:", (unsigned long)i);
- }
-
- for (j = 0; j < ny; j++) {
- if (nz > 1)
- fprintf(stderr,"%03lu:", (unsigned long)j);
- for (k = 0; k < nz; k++) {
- fprintf(stderr," %3d", *array++);
- }
- if (nz > 1)
- fprintf(stderr,"\n");
- }
- fprintf(stderr,"\n");
+ if (nz > 1) {
+ HDfprintf(stderr,"i=%lu:\n", (unsigned long)i);
+ } else {
+ HDfprintf(stderr,"%03lu:", (unsigned long)i);
+ }
+
+ for (j = 0; j < ny; j++) {
+ if (nz > 1)
+ HDfprintf(stderr,"%03lu:", (unsigned long)j);
+ for (k = 0; k < nz; k++) {
+ HDfprintf(stderr," %3d", *array++);
+ }
+ if (nz > 1)
+ HDfprintf(stderr,"\n");
+ }
+ HDfprintf(stderr,"\n");
}
}
-
+
/*-------------------------------------------------------------------------
- * Function: new_object
+ * Function: new_object
*
- * Purpose: Creates a new object that refers to a indexed storage of raw
- * data. No raw data is stored.
+ * Purpose: Creates a new object that refers to a indexed storage of raw
+ * data. No raw data is stored.
*
- * Return: Success: ID of dataset
+ * Return: Success: ID of dataset
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
* Converted to use datasets instead of directly messing with
@@ -182,19 +180,19 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_create
+ * Function: test_create
*
- * Purpose: Creates a named object that refers to indexed storage of raw
- * data. No raw data is stored.
+ * Purpose: Creates a named object that refers to indexed storage of raw
+ * data. No raw data is stored.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
*
@@ -217,9 +215,9 @@ test_create(hid_t f, const char *prefix)
dims[u] = my_chunk_dims[u] = 2;
/* Create chunked dataset of this dimensionality */
- HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
- if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
- return FAIL;
+ HDsnprintf(name, sizeof name, "%s_%02u", prefix, u);
+ if((dataset = new_object(f, name, (int)u, dims, my_chunk_dims)) < 0)
+ return FAIL;
/* Close dataset created */
if(H5Dclose(dataset) < 0)
@@ -230,20 +228,20 @@ test_create(hid_t f, const char *prefix)
return SUCCEED;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_extend
+ * Function: test_extend
*
- * Purpose: Creates an empty object and then writes to it in such a way
- * as to always extend the object's domain without creating
- * holes and without causing the object to become concave.
+ * Purpose: Creates an empty object and then writes to it in such a way
+ * as to always extend the object's domain without creating
+ * holes and without causing the object to become concave.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Wednesday, October 15, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
* Modifications:
*
@@ -251,38 +249,38 @@ test_create(hid_t f, const char *prefix)
*/
static herr_t
test_extend(hid_t f, const char *prefix,
- size_t nx, size_t ny, size_t nz)
+ size_t nx, size_t ny, size_t nz)
{
hid_t dataset; /* Dataset ID */
hid_t fspace; /* Dataset's file dataspace */
hid_t mspace; /* Dataset's memory dataspace */
- size_t i, j, k, ctr;
- int ndims;
- uint8_t *buf = NULL, *check = NULL, *whole = NULL;
- char dims[64], s[256], name[256];
- hsize_t offset[3];
- hsize_t max_corner[3];
- hsize_t size[3];
- hsize_t whole_size[3];
- hsize_t nelmts;
+ size_t i, j, k, ctr;
+ int ndims;
+ uint8_t *buf = NULL, *check = NULL, *whole = NULL;
+ char dims[64], s[256], name[256];
+ hsize_t offset[3];
+ hsize_t max_corner[3];
+ hsize_t size[3];
+ hsize_t whole_size[3];
+ hsize_t nelmts;
if (!nz) {
- if (!ny) {
- ndims = 1;
- ny = nz = 1;
- sprintf(dims, "%lu", (unsigned long) nx);
- } else {
- ndims = 2;
- nz = 1;
- sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
- }
+ if (!ny) {
+ ndims = 1;
+ ny = nz = 1;
+ HDsprintf(dims, "%lu", (unsigned long) nx);
+ } else {
+ ndims = 2;
+ nz = 1;
+ HDsprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ }
} else {
- ndims = 3;
- sprintf(dims, "%lux%lux%lu",
- (unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
+ ndims = 3;
+ 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);
@@ -296,59 +294,59 @@ 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 */
if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR;
for (ctr = 0;
- H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size);
- ctr++) {
-
- /* Size and location */
- if (0 == ctr) {
- offset[0] = offset[1] = offset[2] = 0;
- size[0] = size[1] = size[2] = 1;
- nelmts = 1;
- } else {
- for (i=0, nelmts=1; i<(size_t)ndims; i++) {
- if (ctr % (size_t)ndims == i) {
- offset[i] = max_corner[i];
- size[i] = MIN(1, whole_size[i] - offset[i]);
- } else {
- offset[i] = 0;
- size[i] = max_corner[i];
- }
- nelmts *= size[i];
- }
- }
+ H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size);
+ ctr++) {
+
+ /* Size and location */
+ if (0 == ctr) {
+ offset[0] = offset[1] = offset[2] = 0;
+ size[0] = size[1] = size[2] = 1;
+ nelmts = 1;
+ } else {
+ for (i=0, nelmts=1; i<(size_t)ndims; i++) {
+ if (ctr % (size_t)ndims == i) {
+ offset[i] = max_corner[i];
+ size[i] = MIN(1, whole_size[i] - offset[i]);
+ } else {
+ offset[i] = 0;
+ size[i] = max_corner[i];
+ }
+ nelmts *= size[i];
+ }
+ }
#if 0
- if (0 == ctr)
- fprintf(stderr,"\n");
- fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
- if (ndims > 1)
- fprintf(stderr,",%ld", (long)offset[1]);
- if (ndims > 2)
- fprintf(stderr,",%ld", (long)offset[2]);
- fprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
- if (ndims > 1)
- fprintf(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");
- if (0 == nelmts)
- fprintf(stderr," *SKIPPED*");
- fprintf(stderr,"\n");
+ if (0 == ctr)
+ HDfprintf(stderr,"\n");
+ HDfprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]);
+ if (ndims > 1)
+ HDfprintf(stderr,",%ld", (long)offset[1]);
+ if (ndims > 2)
+ HDfprintf(stderr,",%ld", (long)offset[2]);
+ HDfprintf(stderr,"), size=(%lu", (unsigned long)size[0]);
+ if (ndims > 1)
+ HDfprintf(stderr,",%lu", (unsigned long)size[1]);
+ if (ndims > 2)
+ HDfprintf(stderr,",%lu", (unsigned long)size[2]);
+ HDfprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s");
+ if (0 == nelmts)
+ HDfprintf(stderr," *SKIPPED*");
+ HDfprintf(stderr,"\n");
#endif
- /* Fill the source array */
- if (0 == nelmts) continue;
- HDmemset(buf, (signed)(128+ctr), (size_t)nelmts);
+ /* Fill the source array */
+ if (0 == nelmts) continue;
+ HDmemset(buf, (signed)(128+ctr), (size_t)nelmts);
/* Create dataspace for selection in memory */
if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR;
@@ -356,72 +354,72 @@ test_extend(hid_t f, const char *prefix,
/* Select region in file dataspace */
if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR;
- /* 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);
- goto error;
- }
-
- /* Read from disk */
- 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);
- 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");
- print_array(buf, (size_t)size[0], (size_t)size[1],
- (size_t)size[2]);
- fprintf(stderr," Read:\n");
- print_array(check, (size_t)size[0], (size_t)size[1],
- (size_t)size[2]);
- goto error;
- }
+ /* Write to disk */
+ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
+ H5_FAILED();
+ HDfprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr);
+ goto error;
+ }
+
+ /* Read from disk */
+ HDmemset(check, 0xff, (size_t)nelmts);
+ if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) {
+ H5_FAILED();
+ HDfprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr);
+ goto error;
+ }
+ if (HDmemcmp(buf, check, (size_t)nelmts)) {
+ H5_FAILED();
+ 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]);
+ HDfprintf(stderr," Read:\n");
+ print_array(check, (size_t)size[0], (size_t)size[1],
+ (size_t)size[2]);
+ goto error;
+ }
/* Close memory dataspace */
if(H5Sclose(mspace) < 0) TEST_ERROR;
- /* Write to `whole' buffer for later checking */
- H5VM_hyper_copy((unsigned)ndims, size,
- whole_size, offset, whole, /*dst*/
- size, H5VM_ZERO, buf); /*src*/
+ /* Write to `whole' buffer for later checking */
+ H5VM_hyper_copy((unsigned)ndims, size,
+ whole_size, offset, whole, /*dst*/
+ size, H5VM_ZERO, buf); /*src*/
- /* Update max corner */
- for (i=0; i<(size_t)ndims; i++)
- max_corner[i] = MAX(max_corner[i], offset[i]+size[i]);
+ /* Update max corner */
+ for (i=0; i<(size_t)ndims; i++)
+ max_corner[i] = MAX(max_corner[i], offset[i]+size[i]);
}
/* Now read the entire array back out and check it */
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");
- goto error;
+ H5_FAILED();
+ HDfprintf(stderr," Read failed for whole array.\n");
+ goto error;
}
for (i=0; i<nx; i++) {
- for (j=0; j<ny; j++) {
- 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);
- if (ndims > 1) {
- fprintf(stderr,", j=%lu", (unsigned long)j);
- }
- if (ndims > 2) {
- fprintf(stderr,", k=%lu", (unsigned long)k);
- }
- fprintf(stderr,"\n Check array is:\n");
- print_array(whole, nx, ny, nz);
- fprintf(stderr," Value read is:\n");
- print_array(buf, nx, ny, nz);
- goto error;
- }
- }
- }
+ for (j=0; j<ny; j++) {
+ for (k=0; k<nz; k++) {
+ if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) {
+ H5_FAILED();
+ HDfprintf(stderr," Check failed at i=%lu", (unsigned long)i);
+ if (ndims > 1) {
+ HDfprintf(stderr,", j=%lu", (unsigned long)j);
+ }
+ if (ndims > 2) {
+ HDfprintf(stderr,", k=%lu", (unsigned long)k);
+ }
+ HDfprintf(stderr,"\n Check array is:\n");
+ print_array(whole, nx, ny, nz);
+ HDfprintf(stderr," Value read is:\n");
+ print_array(buf, nx, ny, nz);
+ goto error;
+ }
+ }
+ }
}
/* Close dataset's dataspace */
@@ -445,19 +443,19 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_sparse
+ * Function: test_sparse
*
- * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed
- * blocks each of size NX,NY,NZ.
+ * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed
+ * blocks each of size NX,NY,NZ.
*
- * Return: Success: SUCCEED
+ * Return: Success: SUCCEED
*
- * Failure: FAIL
+ * Failure: FAIL
*
- * Programmer: Robb Matzke
- * Wednesday, October 22, 1997
+ * Programmer: Robb Matzke
+ * Wednesday, October 22, 1997
*
* Modifications:
*
@@ -465,37 +463,37 @@ error:
*/
static herr_t
test_sparse(hid_t f, const char *prefix, size_t nblocks,
- size_t nx, size_t ny, size_t nz, int skip_test)
+ size_t nx, size_t ny, size_t nz, int skip_test)
{
hid_t dataset; /* Dataset ID */
hid_t fspace; /* Dataset's file dataspace */
hid_t mspace; /* Dataset's memory dataspace */
- int ndims;
- hsize_t ctr;
- char dims[64], s[256], name[256];
- hsize_t offset[3];
- hsize_t size[3], total = 0;
- uint8_t *buf = NULL;
- hsize_t whole_size[3]; /* Size of dataset's dataspace */
+ int ndims;
+ hsize_t ctr;
+ char dims[64], s[256], name[256];
+ hsize_t offset[3];
+ hsize_t size[3], total = 0;
+ uint8_t *buf = NULL;
+ hsize_t whole_size[3]; /* Size of dataset's dataspace */
size_t u; /* Local index variable */
if (!nz) {
- if (!ny) {
- ndims = 1;
- ny = nz = 1;
- sprintf(dims, "%lu", (unsigned long) nx);
- } else {
- ndims = 2;
- nz = 1;
- sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
- }
+ if (!ny) {
+ ndims = 1;
+ ny = nz = 1;
+ HDsprintf(dims, "%lu", (unsigned long) nx);
} else {
- ndims = 3;
- sprintf(dims, "%lux%lux%lu",
- (unsigned long) nx, (unsigned long) ny, (unsigned long) nz);
+ ndims = 2;
+ nz = 1;
+ HDsprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny);
+ }
+ } else {
+ ndims = 3;
+ 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()
@@ -514,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 */
@@ -534,29 +532,29 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
/* Select region in file dataspace */
if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR;
- /* 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]));
- if (ndims > 1)
- printf(",%lu", (unsigned long) (offset[1]));
- if (ndims > 2)
- printf(",%lu", (unsigned long) (offset[2]));
- printf("), size=(%lu", (unsigned long) (size[0]));
- if (ndims > 1)
- printf(",%lu", (unsigned long) (size[1]));
- if (ndims > 2)
- printf(",%lu", (unsigned long) (size[2]));
- printf(")\n");
- goto error;
- }
- total += nx * ny * nz;
+ /* write to disk */
+ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
+ H5_FAILED();
+ HDprintf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
+ HDprintf(" offset=(%lu", (unsigned long) (offset[0]));
+ if (ndims > 1)
+ HDprintf(",%lu", (unsigned long) (offset[1]));
+ if (ndims > 2)
+ HDprintf(",%lu", (unsigned long) (offset[2]));
+ HDprintf("), size=(%lu", (unsigned long) (size[0]));
+ if (ndims > 1)
+ HDprintf(",%lu", (unsigned long) (size[1]));
+ if (ndims > 2)
+ HDprintf(",%lu", (unsigned long) (size[2]));
+ HDprintf(")\n");
+ goto error;
+ }
+ total += nx * ny * nz;
#if 0
- HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total);
+ HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total);
#endif
- /* We don't test reading yet.... */
+ /* We don't test reading yet.... */
}
/* Close memory dataspace */
@@ -577,32 +575,28 @@ error:
return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests indexed storage stuff.
+ * Function: main
*
- * 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:
+ * Programmer: Robb Matzke
+ * Wednesday, October 15, 1997
*
*-------------------------------------------------------------------------
*/
int
main(int argc, char *argv[])
{
- hid_t fapl=-1, file=-1, fcpl=-1;
- herr_t status;
- int nerrors = 0;
- unsigned size_of_test;
+ hid_t fapl=-1, file=-1, fcpl=-1;
+ herr_t status;
+ int nerrors = 0;
+ unsigned size_of_test;
unsigned u; /* Local index variable */
- char filename[1024];
+ char filename[1024];
int skip_test = 0;
int has_sparse_support = 0;
@@ -610,7 +604,7 @@ main(int argc, char *argv[])
if (1 == argc) {
size_of_test = TEST_SMALL | TEST_MEDIUM | TEST_LARGE;
} else {
- int i;
+ int i;
for (i = 1, size_of_test = 0; i < argc; i++) {
if (!strcmp(argv[i], "small")) {
size_of_test |= TEST_SMALL;
@@ -619,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));
@@ -655,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 */
@@ -710,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;
}
@@ -722,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 f5b7f77..5f60dca 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -15,13 +15,15 @@
* 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"
#include "H5ACprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5HLprivate.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
const char *FILENAME[] = {
"lheap",
@@ -32,7 +34,7 @@ const char *FILENAME[] = {
#define NOBJS 40
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -40,9 +42,7 @@ const char *FILENAME[] = {
* heap, close the file, open the file, read data out of the
* local heap, close the file.
*
- * Return: Success: zero
- *
- * Failure: non-zero
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
* Programmer: Robb Matzke
* Tuesday, November 24, 1998
@@ -62,11 +62,15 @@ main(void)
int i, j; /* miscellaneous counters */
char buf[1024]; /* the value to store */
const char *s; /* value to read */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
/*
* Test writing to the heap...
@@ -75,7 +79,7 @@ main(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if(FAIL == (file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)))
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -85,24 +89,24 @@ main(void)
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
}
- if(FAIL == H5HL_create(f, H5AC_ind_read_dxpl_id, (size_t)0, &heap_addr/*out*/)) {
+ if(FAIL == H5HL_create(f, (size_t)0, &heap_addr/*out*/)) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
}
- if (NULL == (heap = H5HL_protect(f, H5AC_ind_read_dxpl_id, heap_addr, H5AC__NO_FLAGS_SET))) {
+ if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__NO_FLAGS_SET))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
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)
buf[j] = '\0';
- if(UFAIL == (obj[i] = H5HL_insert(f, H5AC_ind_read_dxpl_id, heap, strlen(buf) + 1, buf))) {
+ if(UFAIL == (obj[i] = H5HL_insert(f, heap, strlen(buf) + 1, buf))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -125,7 +129,7 @@ main(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if(FAIL == (file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)))
goto error;
- if(NULL == (f = (H5F_t *)H5I_object(file))) {
+ if(NULL == (f = (H5F_t *)H5VL_object(file))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -136,13 +140,13 @@ 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)
buf[j] = '\0';
- if (NULL == (heap = H5HL_protect(f, H5AC_ind_read_dxpl_id, heap_addr, H5AC__READ_ONLY_FLAG))) {
+ if(NULL == (heap = H5HL_protect(f, heap_addr, H5AC__READ_ONLY_FLAG))) {
H5_FAILED();
H5Eprint2(H5E_DEFAULT, stdout);
goto error;
@@ -199,16 +203,23 @@ main(void)
/* Verify symbol table messages are cached */
if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
HDputs("All local heap tests passed.");
h5_cleanup(FILENAME, fapl);
- return 0;
+ return EXIT_SUCCESS;
error:
HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Fclose(file);
} H5E_END_TRY;
- return 1;
+
+ if(api_ctx_pushed) H5CX_pop();
+
+ return EXIT_FAILURE;
}
diff --git a/test/links.c b/test/links.c
index 7b3e37d..60d3152 100644
--- a/test/links.c
+++ b/test/links.c
@@ -12,38 +12,36 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * 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 "H5Gpkg.h" /* Groups */
+#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */
+#include "H5VLnative_private.h" /* Native VOL connector */
/* 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 +60,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
@@ -315,8 +313,122 @@ typedef struct {
const obj_visit_t *info; /* Pointer to the object visit structure to use */
} ovisit_ud_t;
+static hid_t dcpl_g; /* for [un]minimized dataset object headers */
+
+static herr_t
+UD_hard_create(const char *link_name, hid_t loc_group, const void *udata,
+ size_t udata_size, hid_t lcpl_id);
+static hid_t
+UD_hard_traverse(const char *link_name, hid_t cur_group,
+ const void *udata, size_t udata_size, hid_t lapl_id,
+ hid_t dxpl_id);
+static herr_t
+UD_hard_delete(const char *link_name, hid_t file, const void *udata,
+ size_t udata_size);
+
+/* User-defined link class */
+const H5L_class_t UD_hard_class[1] = {{
+ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
+ (H5L_type_t)UD_HARD_TYPE, /* Link type id number */
+ "UD_hard_link", /* Link class name for debugging */
+ UD_hard_create, /* Creation callback */
+ NULL, /* Move/rename callback */
+ NULL, /* Copy callback */
+ UD_hard_traverse, /* The actual traversal function */
+ UD_hard_delete, /* Deletion callback */
+ NULL /* Query callback */
+}};
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+static herr_t
+UD_hard_create_deprec(const char *link_name, hid_t loc_group, const void *udata,
+ size_t udata_size, hid_t lcpl_id);
+static hid_t
+UD_hard_traverse_deprec(const char *link_name, hid_t cur_group,
+ const void *udata, size_t udata_size, hid_t lapl_id,
+ hid_t dxpl_id);
+static herr_t
+UD_hard_delete_deprec(const char *link_name, hid_t file, const void *udata,
+ size_t udata_size);
+
+/* User-defined link class */
+const H5L_class_t UD_hard_class_deprec[1] = {{
+ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
+ (H5L_type_t)UD_HARD_TYPE, /* Link type id number */
+ "UD_hard_link_deprec", /* Link class name for debugging */
+ UD_hard_create_deprec, /* Creation callback */
+ NULL, /* Move/rename callback */
+ NULL, /* Copy callback */
+ UD_hard_traverse_deprec, /* The actual traversal function */
+ UD_hard_delete_deprec, /* Deletion callback */
+ NULL /* Query callback */
+}};
+#endif
+
+static hid_t
+UD_rereg_traverse(const char *link_name, hid_t cur_group,
+ const void *udata, size_t udata_size, hid_t lapl_id,
+ hid_t dxpl_id);
+
+/* This link class has the same ID number as the UD hard links but
+ * has a very different traversal function */
+const H5L_class_t UD_rereg_class[1] = {{
+ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
+ (H5L_type_t)UD_HARD_TYPE, /* Link type id number */
+ "UD_reregistered_type", /* Link class name for debugging */
+ NULL, /* Creation callback */
+ NULL, /* Move/rename callback */
+ NULL, /* Copy callback */
+ UD_rereg_traverse, /* The actual traversal function */
+ NULL, /* Deletion callback */
+ NULL /* Query callback */
+}};
+
+static herr_t
+UD_cb_create(const char * link_name, hid_t loc_group, const void *udata,
+ size_t udata_size, hid_t lcpl_id);
+static herr_t
+UD_cb_move(const char *new_name, hid_t new_loc, const void *udata,
+ size_t udata_size);
+static hid_t
+UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata,
+ size_t udata_size, hid_t lapl_id, hid_t dxpl_id);
+static herr_t
+UD_cb_delete(const char *link_name, hid_t file, const void *udata,
+ size_t udata_size);
+static ssize_t
+UD_cb_query(const char * link_name, const void *udata, size_t udata_size,
+ void *buf, size_t buf_size);
+
+const H5L_class_t UD_cb_class[1] = {{
+ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
+ (H5L_type_t)UD_CB_TYPE, /* Link type id number */
+ NULL, /* NULL name (to make sure this doesn't break anything */
+ UD_cb_create, /* Creation callback */
+ UD_cb_move, /* Move/rename callback */
+ UD_cb_move, /* Copy callback */
+ UD_cb_traverse, /* The actual traversal function */
+ UD_cb_delete, /* Deletion callback */
+ UD_cb_query /* Query callback */
+}};
+
+static hid_t
+UD_plist_traverse(const char *link_name, hid_t cur_group,
+ const void *udata, size_t udata_size, hid_t lapl_id,
+ hid_t dxpl_id);
+
+const H5L_class_t UD_plist_class[1] = {{
+ H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
+ (H5L_type_t)UD_PLIST_TYPE, /* Link type id number */
+ "UD_plist_link", /* Link class name for debugging */
+ NULL, /* Creation callback */
+ NULL, /* Move/rename callback */
+ NULL, /* Copy callback */
+ UD_plist_traverse, /* The actual traversal function */
+ NULL, /* Deletion callback */
+ NULL /* Query callback */
+}};
-
/*-------------------------------------------------------------------------
* Function: fix_ext_filename
*
@@ -324,43 +436,32 @@ typedef struct {
* 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)")
@@ -377,7 +478,7 @@ mklinks(hid_t fapl, hbool_t new_format)
if(H5Gclose(grp) < 0) TEST_ERROR
/* Create a dataset */
- if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(d1) < 0) TEST_ERROR
/* Create a hard link */
@@ -397,38 +498,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)")
@@ -451,8 +545,8 @@ new_links(hid_t fapl, hbool_t new_format)
if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create datasets */
- if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create links within a file. Both of source and destination use
* H5L_SAME_LOC. Both hard and soft links should fail. */
@@ -486,50 +580,44 @@ 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);
+ 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;
+ return FAIL;
}
-
+
/*-------------------------------------------------------------------------
- * Function: cklinks
- *
- * Purpose: Open the file created in the first step and check that the
- * links look correct.
+ * Function: cklinks
*
- * Return: Success: 0
- *
- * 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_info2_t oinfo1, oinfo2;
+ H5L_info2_t linfo;
+ char linkval[LINK_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
+ int token_cmp;
+ herr_t status;
if(new_format)
TESTING("link queries (w/new group format)")
@@ -541,18 +629,19 @@ cklinks(hid_t fapl, hbool_t new_format)
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
/* Hard link */
- if(H5Oget_info_by_name(file, "d1", &oinfo1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file, "grp1/hard", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file, "d1", &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file, "grp1/hard", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_DATASET != oinfo2.type) {
- H5_FAILED();
- printf(" %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
+ if(H5Otoken_cmp(file, &oinfo1.token, &oinfo2.token, &token_cmp) < 0) FAIL_STACK_ERROR
+ if(token_cmp) {
+ 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
@@ -563,91 +652,92 @@ 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_name(file, "grp1/soft", &oinfo2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file, "grp1/soft", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5O_TYPE_DATASET != oinfo2.type) {
- H5_FAILED();
- printf(" %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
+ if(H5Otoken_cmp(file, &oinfo1.token, &oinfo2.token, &token_cmp) < 0) FAIL_STACK_ERROR
+ if(token_cmp) {
+ 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_name(file, "grp1/dangle", &oinfo2, H5P_DEFAULT);
+ status = H5Oget_info_by_name3(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();
- printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
- TEST_ERROR
+ if(H5Lget_info2(file, "grp1/dangle", &linfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5L_TYPE_SOFT != linfo.type) {
+ 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();
- printf(" %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_name(file, "grp1/recursive", &oinfo2, H5P_DEFAULT);
+ status = H5Oget_info_by_name3(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();
- printf(" %d: Unexpected object type should have been a symbolic link\n", __LINE__);
- TEST_ERROR
+ if(H5Lget_info2(file, "grp1/recursive", &linfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5L_TYPE_SOFT != linfo.type) {
+ 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();
- printf(" %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 */
@@ -657,13 +747,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;
+} /* end cklinks() */
+
-
/*-------------------------------------------------------------------------
* Function: ck_new_links
*
@@ -671,20 +761,16 @@ 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_info2_t oi_dset, oi_hard1, oi_hard2;
+ char filename[NAME_BUF_SIZE];
+ int token_cmp1, token_cmp2;
if(new_format)
TESTING("new link queries (w/new group format)")
@@ -696,24 +782,24 @@ 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_name(file, "/grp1/dataset2", &oi_dset, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Oget_info_by_name(file, "/grp1/hard1", &oi_hard1, H5P_DEFAULT) < 0)
- TEST_ERROR
- if(H5Oget_info_by_name(file, "/grp2/hard2", &oi_hard2, H5P_DEFAULT) < 0)
- TEST_ERROR
+ if(H5Oget_info_by_name3(file, "/grp1/dataset2", &oi_dset, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file, "/grp1/hard1", &oi_hard1, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(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();
- printf(" %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
+
+ if(H5Otoken_cmp(file, &oi_dset.token, &oi_hard1.token, &token_cmp1) < 0) TEST_ERROR
+ if(H5Otoken_cmp(file, &oi_dset.token, &oi_hard2.token, &token_cmp2) < 0) TEST_ERROR
+ if(token_cmp1 || token_cmp2) {
+ H5_FAILED();
+ HDputs(" Hard link test failed. Link seems not to point to the ");
+ HDputs(" expected file location.");
+ TEST_ERROR
}
/* Cleanup */
@@ -724,34 +810,27 @@ ck_new_links(hid_t fapl, hbool_t new_format)
error:
return -1;
-}
+} /* end ck_new_links() */
+
-
/*-------------------------------------------------------------------------
* 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)")
@@ -790,42 +869,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)")
@@ -915,9 +987,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 */
@@ -938,18 +1010,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
*
@@ -957,26 +1029,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_info2_t linfo;
+ char filename[1024];
+ hsize_t dims[2];
if(new_format)
TESTING("link creation property lists (w/new group format)")
@@ -996,7 +1062,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(H5Gclose(group_id) < 0) TEST_ERROR
/* Check that its character encoding is the default */
- if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5F_DEFAULT_CSET) TEST_ERROR
/* Create and commit a datatype with the default LCPL */
@@ -1005,7 +1071,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(H5Tclose(type_id) < 0) TEST_ERROR
/* Check that its character encoding is the default */
- if(H5Lget_info(file_id, "type", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "type", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5F_DEFAULT_CSET) TEST_ERROR
/* Create a dataspace */
@@ -1014,11 +1080,11 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if((space_id=H5Screate_simple(2 ,dims, NULL)) < 0) TEST_ERROR
/* Create a dataset using the default LCPL */
- if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Check that its character encoding is the default */
- if(H5Lget_info(file_id, "dataset", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "dataset", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5F_DEFAULT_CSET) TEST_ERROR
/* Create a link creation property list with the UTF-8 character encoding */
@@ -1030,7 +1096,7 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(H5Gclose(group_id) < 0) TEST_ERROR
/* Check that its character encoding is UTF-8 */
- if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* Create and commit a datatype with the new LCPL */
@@ -1039,15 +1105,15 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(H5Tclose(type_id) < 0) TEST_ERROR
/* Check that its character encoding is UTF-8 */
- if(H5Lget_info(file_id, "type2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "type2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* Create a dataset using the new LCPL */
- if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Check that its character encoding is UTF-8 */
- if(H5Lget_info(file_id, "dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* Create a new link to the dataset with a different character encoding. */
@@ -1058,35 +1124,35 @@ test_lcpl(hid_t fapl, hbool_t new_format)
if(H5Lcreate_hard(file_id, "/dataset2", file_id, "/dataset2_link", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
/* Check that its character encoding is ASCII */
- if(H5Lget_info(file_id, "/dataset2_link", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "/dataset2_link", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR
/* Check that the first link's encoding hasn't changed */
- if(H5Lget_info(file_id, "/dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "/dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* Make sure that LCPLs work properly for other API calls: */
/* H5Lcreate_soft */
if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR
if(H5Lcreate_soft("dataset2", file_id, "slink_to_dset2", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(file_id, "slink_to_dset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "slink_to_dset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* H5Lmove */
if(H5Pset_char_encoding(lcpl_id, H5T_CSET_ASCII) < 0) TEST_ERROR
if(H5Lmove(file_id, "slink_to_dset2", file_id, "moved_slink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(file_id, "moved_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "moved_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR
/* H5Lcopy */
if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR
if(H5Lcopy(file_id, "moved_slink", file_id, "copied_slink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(file_id, "copied_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "copied_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* H5Lcreate_external */
if(H5Lcreate_external("filename", "path", file_id, "extlink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(file_id, "extlink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "extlink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
/* Close open IDs */
@@ -1095,7 +1161,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 {
@@ -1109,29 +1175,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)")
@@ -1140,11 +1199,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
@@ -1152,99 +1209,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);
@@ -1254,44 +1287,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)")
@@ -1300,11 +1326,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
@@ -1312,111 +1336,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);
@@ -1425,22 +1414,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
*
@@ -1449,12 +1438,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
@@ -1465,8 +1448,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
hid_t fcpl_id=-1; /* Group creation property list ID */
hid_t lcpl_id=-1;
hid_t lcpl2_id=-1;
- H5O_info_t oinfo;
- H5L_info_t linfo;
+ H5O_info2_t oinfo;
+ H5L_info2_t linfo;
H5T_cset_t old_cset;
int64_t old_corder; /* Creation order value of link */
time_t old_modification_time;
@@ -1503,8 +1486,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
if(H5Gclose(group_id) < 0) TEST_ERROR
/* Get the group's link's information */
- if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
old_cset = linfo.cset;
if(old_cset != H5T_CSET_UTF8) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1522,8 +1505,8 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR
/* Get the link's character set & modification time . They should be unchanged */
- if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
if(old_cset != linfo.cset) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -1531,9 +1514,9 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Create a new link to the group. It should have a different creation order value but the same modification time */
if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group2", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
- if(H5Lget_info(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(old_corder == linfo.corder) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
if(linfo.corder != 1) TEST_ERROR
@@ -1544,9 +1527,9 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
* should not change.
*/
if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group_copied", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group_copied", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
- if(H5Lget_info(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
if(linfo.corder != 2) TEST_ERROR
@@ -1555,9 +1538,9 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Move the link with the default property list. */
if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group_copied2", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group_copied2", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
- if(H5Lget_info(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
if(linfo.corder != 3) TEST_ERROR
@@ -1565,9 +1548,9 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR
/* Check that the original link is unchanged */
- if(H5Oget_info_by_name(file_id, "group", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
- if(H5Lget_info(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
if(old_corder != linfo.corder) TEST_ERROR
if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
@@ -1576,9 +1559,9 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
* Its creation order value will change, but modification time should not
* change. */
if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group_moved", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group_moved", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
- if(H5Lget_info(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
if(linfo.corder != 4) TEST_ERROR
@@ -1587,9 +1570,9 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
/* Move the link again using the default property list. */
if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(file_id, "group_moved_again", &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(file_id, "group_moved_again", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
if(old_modification_time != oinfo.mtime) TEST_ERROR
- if(H5Lget_info(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder_valid != TRUE) TEST_ERROR
if(linfo.corder != 5) TEST_ERROR
@@ -1602,20 +1585,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
*
@@ -1623,12 +1606,6 @@ error:
*
* Return: Success: 0
* Failure: number of errors
- *
- * Programmer: James Laird
- * Wednesday, April 26 2006
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -1638,7 +1615,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];
@@ -1719,6 +1696,10 @@ test_deprec(hid_t fapl, hbool_t new_format)
if(H5Gget_linkval(group2_id, "soft_link_to_group1", sb_soft1.linklen, tmpstr) < 0) FAIL_STACK_ERROR
if(HDstrcmp("link_to_group1", tmpstr)) TEST_ERROR
+ /* Test non-existing links with H5Gget_objinfo */
+ H5E_BEGIN_TRY {
+ if(H5Gget_objinfo(file_id, "/group2/soft_link_no_exist", TRUE, NULL) >= 0) FAIL_STACK_ERROR
+ } H5E_END_TRY;
/* Test the dangling soft link */
if(H5Gget_objinfo(file_id, "/group2/dangle_soft_link", FALSE, &sb_soft2) < 0) FAIL_STACK_ERROR
@@ -1754,7 +1735,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 {
@@ -1764,36 +1745,3933 @@ error:
} H5E_END_TRY;
return 1;
} /* end test_deprec() */
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
-
/*-------------------------------------------------------------------------
- * Function: external_link_root
+ * Function: cklinks_deprec
+ *
+ * Purpose: Open the file created in the first step and check that the
+ * links look correct.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+cklinks_deprec(hid_t fapl, hbool_t new_format)
+{
+ hid_t file;
+ H5O_info1_t oinfo1, oinfo2;
+ H5L_info1_t linfo;
+ char linkval[LINK_BUF_SIZE];
+ char filename[NAME_BUF_SIZE];
+ herr_t status;
+
+ if(new_format)
+ TESTING("link queries using deprecated routines (w/new group format)")
+ else
+ TESTING("link queries using deprecated routines")
+
+ /* Open the file */
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
+
+ /* Hard link */
+ 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
+ } /* 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
+ } /* end if */
+ if(H5Lexists(file, "/", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
+ if(H5Lexists(file, "d1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
+ if(H5Lexists(file, "grp1/hard", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
+ if(H5Lexists(file, "/grp1", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
+ if(H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != TRUE) FAIL_STACK_ERROR
+ 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
+ } /* 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
+ } /* 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
+ } /* 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
+ } /* 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
+ } /* 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);
+ } H5E_END_TRY;
+ if(status >= 0) {
+ H5_FAILED();
+ HDputs(" H5Oget_info_by_name() should have failed for a dangling link.");
+ TEST_ERROR
+ } /* end if */
+ if(H5Lget_info1(file, "grp1/dangle", &linfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5L_TYPE_SOFT != linfo.type) {
+ 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
+ } /* end if */
+ if(HDstrcmp(linkval, "foobar")) {
+ 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);
+ } H5E_END_TRY;
+ if(status >= 0) {
+ H5_FAILED();
+ HDputs(" H5Oget_info_by_name() should have failed for a recursive link.");
+ TEST_ERROR
+ } /* end if */
+ if(H5Lget_info1(file, "grp1/recursive", &linfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5L_TYPE_SOFT != linfo.type) {
+ 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
+ } /* end if */
+ if(HDstrcmp(linkval, "/grp1/recursive")) {
+ H5_FAILED();
+ HDputs(" Recursive link test failed. Wrong link value");
+ TEST_ERROR
+ } /* end if */
+
+ /* Non-existent link */
+ if(H5Lexists(file, "foobar", H5P_DEFAULT) == TRUE) FAIL_STACK_ERROR
+
+ /* Cleanup */
+ if(H5Fclose(file) < 0) FAIL_STACK_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end chklinks_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_lcpl_deprec
+ *
+ * Purpose: Tests Link Creation Property Lists
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *-------------------------------------------------------------------------
+ */
+static int
+test_lcpl_deprec(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_info1_t linfo;
+ char filename[1024];
+ hsize_t dims[2];
+
+ if(new_format)
+ TESTING("link creation property lists using deprecated routines (w/new group format)")
+ else
+ TESTING("link creation property lists using deprecated routines")
+
+ /* Actually, intermediate group creation is tested elsewhere (tmisc).
+ * Here we only need to test the character encoding property */
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create and link a group with the default LCPL */
+ if((group_id = H5Gcreate2(file_id, "/group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Check that its character encoding is the default */
+ if(H5Lget_info1(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5F_DEFAULT_CSET) TEST_ERROR
+
+ /* Create and commit a datatype with the default LCPL */
+ if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if(H5Tcommit2(file_id, "/type", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Tclose(type_id) < 0) TEST_ERROR
+
+ /* Check that its character encoding is the default */
+ if(H5Lget_info1(file_id, "type", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5F_DEFAULT_CSET) TEST_ERROR
+
+ /* Create a dataspace */
+ dims[0] = H5L_DIM1;
+ dims[1] = H5L_DIM2;
+ if((space_id=H5Screate_simple(2 ,dims, NULL)) < 0) TEST_ERROR
+
+ /* Create a dataset using the default LCPL */
+ if((dset_id = H5Dcreate2(file_id, "/dataset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dclose(dset_id) < 0) TEST_ERROR
+
+ /* Check that its character encoding is the default */
+ if(H5Lget_info1(file_id, "dataset", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5F_DEFAULT_CSET) TEST_ERROR
+
+ /* Create a link creation property list with the UTF-8 character encoding */
+ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR
+
+ /* Create and link a group with the new LCPL */
+ if((group_id = H5Gcreate2(file_id, "/group2", lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Check that its character encoding is UTF-8 */
+ if(H5Lget_info1(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Create and commit a datatype with the new LCPL */
+ if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if(H5Tcommit2(file_id, "/type2", type_id, lcpl_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Tclose(type_id) < 0) TEST_ERROR
+
+ /* Check that its character encoding is UTF-8 */
+ if(H5Lget_info1(file_id, "type2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Create a dataset using the new LCPL */
+ if((dset_id = H5Dcreate2(file_id, "/dataset2", H5T_NATIVE_INT, space_id, lcpl_id, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dclose(dset_id) < 0) TEST_ERROR
+
+ /* Check that its character encoding is UTF-8 */
+ if(H5Lget_info1(file_id, "dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Create a new link to the dataset with a different character encoding. */
+ if(H5Pclose(lcpl_id) < 0) TEST_ERROR
+ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_ASCII) < 0) TEST_ERROR
+
+ if(H5Lcreate_hard(file_id, "/dataset2", file_id, "/dataset2_link", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check that its character encoding is ASCII */
+ if(H5Lget_info1(file_id, "/dataset2_link", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR
+
+ /* Check that the first link's encoding hasn't changed */
+ if(H5Lget_info1(file_id, "/dataset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Make sure that LCPLs work properly for other API calls: */
+ /* H5Lcreate_soft */
+ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR
+ if(H5Lcreate_soft("dataset2", file_id, "slink_to_dset2", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info1(file_id, "slink_to_dset2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* H5Lmove */
+ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_ASCII) < 0) TEST_ERROR
+ if(H5Lmove(file_id, "slink_to_dset2", file_id, "moved_slink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info1(file_id, "moved_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR
+
+ /* H5Lcopy */
+ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR
+ if(H5Lcopy(file_id, "moved_slink", file_id, "copied_slink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info1(file_id, "copied_slink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* H5Lcreate_external */
+ if(H5Lcreate_external("filename", "path", file_id, "extlink", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info1(file_id, "extlink", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Close open IDs */
+ if(H5Pclose(lcpl_id) < 0) TEST_ERROR
+ if(H5Sclose(space_id) < 0) TEST_ERROR
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(group_id);
+ H5Dclose(dset_id);
+ H5Tclose(type_id);
+ H5Pclose(lcpl_id);
+ H5Sclose(space_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return 1;
+} /* end test_lcpl_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_move_preserves_deprec
+ *
+ * Purpose: Tests that moving and renaming links preserves their
+ * properties.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *-------------------------------------------------------------------------
+ */
+static int
+test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
+{
+ hid_t file_id=-1;
+ hid_t group_id=-1;
+ hid_t fcpl_id=-1; /* Group creation property list ID */
+ hid_t lcpl_id=-1;
+ hid_t lcpl2_id=-1;
+ H5O_info1_t oinfo;
+ H5L_info1_t linfo;
+ H5T_cset_t old_cset;
+ int64_t old_corder; /* Creation order value of link */
+ time_t old_modification_time;
+ time_t curr_time;
+ unsigned crt_order_flags; /* Status of creation order info for GCPL */
+ char filename[1024];
+
+ if(new_format)
+ TESTING("moving and copying links using deprecated routines preserves their properties (w/new group format)")
+ else
+ TESTING("moving and copying links using deprecated routines preserves their properties")
+
+ /* Create a file creation property list with creation order stored for links
+ * in the root group
+ */
+ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR
+ if(H5Pget_link_creation_order(fcpl_id, &crt_order_flags) < 0) TEST_ERROR
+ if(crt_order_flags != 0) TEST_ERROR
+ if(H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED) < 0) TEST_ERROR
+ if(H5Pget_link_creation_order(fcpl_id, &crt_order_flags) < 0) TEST_ERROR
+ if(crt_order_flags != H5P_CRT_ORDER_TRACKED) TEST_ERROR
+
+ /* Create file */
+ /* (with creation order tracking for the root group) */
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id)) < 0) TEST_ERROR
+
+ /* Create a link creation property list with the UTF-8 character encoding */
+ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_char_encoding(lcpl_id, H5T_CSET_UTF8) < 0) TEST_ERROR
+
+ /* Create a group with that lcpl */
+ if((group_id = H5Gcreate2(file_id, "group", lcpl_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Get the group's link's information */
+ if(H5Lget_info1(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ old_cset = linfo.cset;
+ if(old_cset != H5T_CSET_UTF8) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ old_corder = linfo.corder;
+ if(old_corder != 0) TEST_ERROR
+ old_modification_time = oinfo.mtime;
+
+ /* If this test happens too quickly, the times will all be the same. Make sure the time changes. */
+ curr_time = HDtime(NULL);
+ while(HDtime(NULL) <= curr_time)
+ ;
+
+ /* Close the file and reopen it */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+ if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR
+
+ /* Get the link's character set & modification time . They should be unchanged */
+ if(H5Lget_info1(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(old_cset != linfo.cset) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(old_corder != linfo.corder) TEST_ERROR
+
+ /* Create a new link to the group. It should have a different creation order value but the same modification time */
+ if(H5Lcreate_hard(file_id, "group", file_id, "group2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group2", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(H5Lget_info1(file_id, "group2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_corder == linfo.corder) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != 1) TEST_ERROR
+ if(linfo.cset != H5T_CSET_ASCII) TEST_ERROR
+
+ /* Copy the first link to a UTF-8 name.
+ * Its creation order value should be different, but modification time
+ * should not change.
+ */
+ if(H5Lcopy(file_id, "group", file_id, "group_copied", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group_copied", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(H5Lget_info1(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != 2) TEST_ERROR
+
+ /* Check that its character encoding is UTF-8 */
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Move the link with the default property list. */
+ if(H5Lmove(file_id, "group_copied", file_id, "group_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group_copied2", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(H5Lget_info1(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != 3) TEST_ERROR
+
+ /* Check that its character encoding is not UTF-8 */
+ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR
+
+ /* Check that the original link is unchanged */
+ if(H5Oget_info_by_name2(file_id, "group", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(H5Lget_info1(file_id, "group", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(old_corder != linfo.corder) TEST_ERROR
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Move the first link to a UTF-8 name.
+ * Its creation order value will change, but modification time should not
+ * change. */
+ if(H5Lmove(file_id, "group", file_id, "group_moved", lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group_moved", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(H5Lget_info1(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != 4) TEST_ERROR
+
+ /* Check that its character encoding is UTF-8 */
+ if(linfo.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Move the link again using the default property list. */
+ if(H5Lmove(file_id, "group_moved", file_id, "group_moved_again", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(file_id, "group_moved_again", &oinfo, H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR
+ if(old_modification_time != oinfo.mtime) TEST_ERROR
+ if(H5Lget_info1(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != 5) TEST_ERROR
+
+ /* Check that its character encoding is not UTF-8 */
+ if(linfo.cset == H5T_CSET_UTF8) TEST_ERROR
+
+ /* Close open IDs */
+ if(H5Pclose(fcpl_id) < 0) TEST_ERROR
+ if(H5Pclose(lcpl_id) < 0) TEST_ERROR
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(fcpl_id);
+ H5Pclose(lcpl_id);
+ H5Pclose(lcpl2_id);
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return 1;
+} /* end test_move_preserves_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: external_link_root_deprec
*
* Purpose: Build a file with external link to root group in external file
*
* Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+external_link_root_deprec(hid_t fapl, hbool_t new_format)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5L_info1_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 using deprecated routines (w/new group format)")
+ else
+ TESTING("external link to root using deprecated routines")
+
+ /* Set up filenames */
+ h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1);
+ h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2);
+
+ /* Create file to point to */
+ if((fid = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Check that external links are registered with the library */
+ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR
+
+ /* Create file with link to first file */
+ if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create external link to object in first file */
+ if(H5Lcreate_external(filename1, "/", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check information for external link */
+ if(H5Lget_info1(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;
+ }
+ 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;
+ }
+ if(HDstrcmp(path, "/")) {
+ H5_FAILED();
+ HDputs(" External link path incorrect");
+ goto error;
+ }
+
+ /* Create external link to object in first file */
+ /* (add a few extra '/'s to make certain library normalizes external link object names) */
+ if(H5Lcreate_external(filename1, "///", fid, "ext_link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check information for external link */
+ if(H5Lget_info1(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;
+ }
+ 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;
+ }
+ if(HDstrcmp(path, "/")) {
+ 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
+
+ /* Check name */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/")) TEST_ERROR
+
+ /* Create object in external file */
+ if((gid2 = H5Gcreate2(gid, "new_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close group in external file */
+ if(H5Gclose(gid2) < 0) TEST_ERROR
+
+ /* Close external object (lets first file close) */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Create a new object using H5Gcreate2 through the external link
+ * directly
+ */
+ if((gid = H5Gcreate2(fid, "ext_link/newer_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close file and group */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Check that all file IDs have been closed */
+ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
+
+ /* Open first file again with read-only access and check on objects created */
+ if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+
+ /* Open objects created through external link */
+ if((gid = H5Gopen2(fid, "new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((gid2 = H5Gopen2(fid, "newer_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Check names */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/new_group")) TEST_ERROR
+ if(H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/newer_group")) TEST_ERROR
+
+ /* Close opened objects */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Gclose(gid2) < 0) TEST_ERROR
+
+ /* Close first file */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Check that all file IDs have been closed */
+ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
+
+ /* Verify that new objects can't be created through a read-only external
+ * link.
+ */
+ if((fid = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+
+ H5E_BEGIN_TRY {
+ gid = H5Gcreate2(fid, "ext_link/readonly_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ } H5E_END_TRY
+ if(gid >= 0) TEST_ERROR
+
+ /* Close second file again */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Check that all file IDs have been closed */
+ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose (gid2);
+ H5Gclose (gid);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end external_link_root_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: external_link_query_deprec
+ *
+ * Purpose: Query file & object names for external links, as well as
+ * information from H5Gget_obj_info
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+external_link_query_deprec(hid_t fapl, hbool_t new_format)
+{
+ 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_info1_t oi; /* Object information */
+ H5L_info1_t li; /* Link information */
+ 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)
+ TESTING("query aspects of external link using deprecated routines (w/new group format)")
+ else
+ TESTING("query aspects of external link using deprecated routines")
+
+ /* Set up filenames */
+ h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1);
+ 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
+
+ /* Create external link */
+ /* (add a few extra '/'s to make certain library normalizes external link object names) */
+ if(H5Lcreate_external(filename2, "///dst//", fid, "src", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Get size of buffer for external link */
+ if(H5Lget_info1(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;
+ }
+
+ /* 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
+
+ /* Create object to link to */
+ if((gid = H5Gcreate2(fid, "dst", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Open first file */
+ if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+
+ /* Get size of buffer for external link */
+ if(H5Lget_info1(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;
+ }
+
+ /* Get information for external link. It should be two strings right after each other */
+ if(H5Lget_val(fid, "src", query_buf, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Extract the file and object names from the buffer */
+ if(H5Lunpack_elink_val(query_buf, li.u.val_size, NULL, &file_name, &object_name) < 0) TEST_ERROR
+
+ /* Compare the file and object names */
+ if(HDstrcmp(file_name, filename2)) TEST_ERROR
+ if(HDstrcmp(object_name, "/dst")) TEST_ERROR
+
+ /* 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;
+ }
+
+ /* Close first file */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Make sure that passing in NULLs to H5Lunpack_elink_val works */
+ if(H5Lunpack_elink_val(query_buf, li.u.val_size, NULL, NULL, NULL) < 0) TEST_ERROR
+
+ /* 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
+ } H5E_END_TRY
+ H5E_BEGIN_TRY {
+ 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
+ } H5E_END_TRY
+ H5E_BEGIN_TRY {
+ if(H5Lunpack_elink_val(NULL, (size_t)1000, NULL, NULL, NULL) >= 0) TEST_ERROR
+ } H5E_END_TRY
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(gid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end external_link_query_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: external_link_closing_deprec
+ *
+ * Purpose: Test that files are closed correctly when traversing
+ * external links.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+external_link_closing_deprec(hid_t fapl, hbool_t new_format)
+{
+ hid_t fid1 = (-1), fid2 = (-1), fid3 = (-1), fid4=(-1);
+ 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],
+ 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 */
+ H5L_info1_t li;
+ H5O_info1_t oi;
+ hobj_ref_t obj_ref;
+
+ if(new_format)
+ TESTING("that external files are closed during traversal (w/new group format)")
+ else
+ TESTING("that external files are closed during traversal")
+
+ /* In this test, external links will go from file1 to file2 and from
+ * file2 to file3.
+ * Test that all functions that can traverse external files close
+ * the files they open.
+ * Test that providing unusual paths containing external links can't
+ * make HDF5 forget to close a file it opened.
+ */
+
+ /* Set up filenames */
+ h5_fixname(FILENAME[3], fapl, filename1, sizeof filename1);
+ h5_fixname(FILENAME[4], fapl, filename2, sizeof filename2);
+ h5_fixname(FILENAME[5], fapl, filename3, sizeof filename3);
+ h5_fixname(FILENAME[6], fapl, filename4, sizeof filename4);
+
+ /* Create four 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((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create a dataspace and a datatype so we can create/commit a dataset/datatype in the files */
+ dims[0] = 2;
+ dims[1] = 2;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
+ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if((tid2 = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+
+ /* Create external links from each file to the next */
+ if(H5Lcreate_external(filename2, "/", fid1, "elink", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename3, "/", fid2, "elink", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename4, "/", fid3, "elink", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Close all files but the first */
+ if(H5Fclose(fid4) < 0) TEST_ERROR
+ if(H5Fclose(fid3) < 0) TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+
+ /* Test creating each kind of object */
+ if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close objects */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Tclose(tid) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Test that getting info works */
+ if(H5Lget_info1(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info1(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(fid1, "elink/elink/elink/type1", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(fid1, "elink/elink/elink", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Test move */
+ if(H5Lmove(fid1, "elink/elink/elink/group1", fid1,
+ "elink/elink/elink/group1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Open file 4 so we can do some fancy things */
+ if((fid4 = H5Fopen(filename4, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
+ if(H5Lmove(fid1, "elink/elink/elink/type1", fid4,
+ "type1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lmove(fid4, "dataset1", fid1,
+ "elink/elink/elink/dataset1_moved", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Close file 4 again */
+ if(H5Fclose(fid4) < 0) FAIL_STACK_ERROR
+
+ /* Test copy (as of this test, it uses the same code as move) */
+ if(H5Lcopy(fid1, "elink/elink/elink", fid1,
+ "elink/elink/elink_copied", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcopy(fid1, "elink/elink/elink", fid1,
+ "elink/elink/elink/elink_copied2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Test H5Gset and get comment */
+ if(H5Oset_comment_by_name(fid1, "elink/elink/elink/group1_moved", "comment", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(HDstrcmp(buf, "comment")) TEST_ERROR
+
+ /* Test H5*open */
+ if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((tid = H5Topen2(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((did = H5Dopen2(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ /* Close objects */
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(tid) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
+
+ /* Test H5*open2 */
+ if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((tid = H5Topen2(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((did = H5Dopen2(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ /* Close objects */
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(tid) < 0) FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0) FAIL_STACK_ERROR
+
+ /* Test H5Oopen */
+ if((did = H5Oopen(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Test H5Fmount */
+ if((gid = H5Gcreate2(fid1, "elink/elink/elink/mnt", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ if(H5Fmount(fid1, "elink/elink/elink/mnt", fid1, H5P_DEFAULT) >= 0) TEST_ERROR
+ if(H5Funmount(fid1, "elink/elink/elink/mnt") >= 0) TEST_ERROR
+ } H5E_END_TRY
+
+ /* Test H5Rcreate */
+ if(H5Rcreate(&obj_ref, fid1, "elink/elink/elink/type1_moved", H5R_OBJECT, (hid_t)(-1)) < 0) TEST_ERROR
+
+ /* Test unlink */
+ if(H5Ldelete(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid1, "elink/elink/elink/dataset1_moved", H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid1, "elink/elink/elink_copied", H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid1, "elink/elink/elink/elink_copied2", H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* We've tested that the various functions above don't leave files open.
+ * Now test that we can't confuse HDF5 by giving unusual paths with external links
+ */
+ /* Create an external link that points to another external link */
+ if((fid2 = H5Fopen(filename2, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ if(H5Lcreate_external(filename3, "/elink", fid2, "elink2",
+ H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+
+ /* Do an external link traversal that recursively calls another external link. */
+ if((gid = H5Gcreate2(fid1, "elink/elink2/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Create two more groups so that the last three elements in the path are
+ * all within the same external file
+ */
+ if((gid = H5Gcreate2(fid1, "elink/elink2/group2/group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if((gid = H5Gcreate2(fid1, "elink/elink2/group2/group3/group4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Oget_info_by_name2(fid1, "elink/elink2/group2/group3/group4", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Add a few regular groups and a soft link in file2 using intermediate group creation */
+ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/elink2", fid1, "elink/file2group1/file2group2/slink",
+ lcpl_id, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Try to traverse this path. There are three soft traversals in a row;
+ * slink points to (file2)/elink2, which points to (file3)/elink, which
+ * points to file 4.
+ */
+ if((gid = H5Gcreate2(fid1, "elink/file2group1/file2group2/slink/group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Lget_info1(fid1, "elink/file2group1/file2group2/slink/group3", &li, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Some simpler tests */
+ if((gid = H5Gcreate2(fid1, "elink/file2group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Lget_info1(fid1, "elink/file2group3", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info1(fid1, "elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
+
+
+ /* Close file1, the only file that should still be open */
+ if(H5Fclose(fid1) < 0) TEST_ERROR
+
+ /* Re-create each file. If they are hanging open, these creates will fail */
+ 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((fid3 = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if((fid4 = H5Fcreate(filename4, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Cleanup */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+ if(H5Tclose(tid2) < 0) TEST_ERROR
+ if(H5Fclose(fid4) < 0) TEST_ERROR
+ if(H5Fclose(fid3) < 0) TEST_ERROR
+ if(H5Fclose(fid2) < 0) TEST_ERROR
+ if(H5Fclose(fid1) < 0) TEST_ERROR
+
+ PASSED();
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(gid);
+ H5Tclose(tid);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Tclose(tid2);
+ H5Fclose(fid4);
+ H5Fclose(fid3);
+ H5Fclose(fid2);
+ H5Fclose(fid1);
+ } H5E_END_TRY;
+ return FAIL;
+} /* external_link_closing_deprec() */
+
+/* Callback functions for UD hard links. */
+/* UD_hard_create increments the object's reference count */
+static herr_t
+UD_hard_create_deprec(const char H5_ATTR_UNUSED * link_name, hid_t loc_group, const void *udata,
+ size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id)
+{
+ haddr_t addr;
+ hid_t target_obj = -1;
+ herr_t ret_value = 0;
+
+ if(udata_size != sizeof(haddr_t)) {
+ ret_value = -1;
+ goto done;
+ } /* end if */
+
+ addr = *((const haddr_t *)udata);
+
+ /* Open the object this link points to */
+ target_obj= H5Oopen_by_addr(loc_group, addr);
+ if(target_obj < 0) {
+ ret_value = -1;
+ goto done;
+ } /* end if */
+
+ /* Increment the reference count of the target object */
+ if(H5Oincr_refcount(target_obj) < 0) {
+ ret_value = -1;
+ goto done;
+ } /* end if */
+
+done:
+ /* Close the target object if we opened it */
+ if(target_obj >= 0) {
+ switch(H5Iget_type(target_obj)) {
+ case H5I_GROUP:
+ if(H5Gclose(target_obj) < 0)
+ ret_value = -1;
+ break;
+
+ case H5I_DATASET:
+ if(H5Dclose(target_obj) < 0)
+ ret_value = -1;
+ break;
+
+ case H5I_DATATYPE:
+ if(H5Tclose(target_obj) < 0)
+ ret_value = -1;
+ break;
+
+ case H5I_MAP:
+ /* TODO: Not supported in native file format yet */
+
+ case H5I_UNINIT:
+ case H5I_BADID:
+ case H5I_FILE:
+ case H5I_DATASPACE:
+ case H5I_ATTR:
+ case H5I_VFL:
+ case H5I_VOL:
+ case H5I_GENPROP_CLS:
+ case H5I_GENPROP_LST:
+ case H5I_ERROR_CLASS:
+ case H5I_ERROR_MSG:
+ case H5I_ERROR_STACK:
+ case H5I_SPACE_SEL_ITER:
+ case H5I_NTYPES:
+ default:
+ return FAIL;
+ } /* end switch */
+ } /* end if */
+
+ return ret_value;
+} /* end UD_hard_create() */
+
+/* Traverse a hard link by opening the object */
+static hid_t
+UD_hard_traverse_deprec(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
+ const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id,
+ hid_t H5_ATTR_UNUSED dxpl_id)
+{
+ haddr_t addr;
+ hid_t ret_value = -1;
+
+ if(udata_size != sizeof(haddr_t))
+ return FAIL;
+
+ addr = *((const haddr_t *) udata);
+
+ ret_value = H5Oopen_by_addr(cur_group, addr); /* If this fails, our return value will be negative. */
+
+ return ret_value;
+} /* end UD_hard_traverse() */
+
+/* UD_hard_delete decrements the object's reference count */
+static herr_t
+UD_hard_delete_deprec(const char H5_ATTR_UNUSED * link_name, hid_t file, const void *udata,
+ size_t udata_size)
+{
+ haddr_t addr;
+ hid_t target_obj = -1;
+ herr_t ret_value = 0;
+
+ if(udata_size != sizeof(haddr_t)) {
+ ret_value = -1;
+ goto done;
+ } /* end if */
+
+ addr = *((const haddr_t *) udata);
+
+ /* Open the object this link points to */
+ target_obj= H5Oopen_by_addr(file, addr);
+ if(target_obj < 0) {
+ ret_value = -1;
+ goto done;
+ } /* end if */
+
+ /* Decrement the reference count of the target object */
+ if(H5Odecr_refcount(target_obj) < 0) {
+ ret_value = -1;
+ goto done;
+ } /* end if */
+
+done:
+ /* Close the target object if we opened it */
+ if(target_obj >= 0) {
+ switch(H5Iget_type(target_obj)) {
+ case H5I_GROUP:
+ if(H5Gclose(target_obj) < 0)
+ ret_value = -1;
+ break;
+
+ case H5I_DATASET:
+ if(H5Dclose(target_obj) < 0)
+ ret_value = -1;
+ break;
+
+ case H5I_DATATYPE:
+ if(H5Tclose(target_obj) < 0)
+ ret_value = -1;
+ break;
+
+ case H5I_MAP:
+ /* TODO: Not supported in native file format yet */
+
+ case H5I_UNINIT:
+ case H5I_BADID:
+ case H5I_FILE:
+ case H5I_DATASPACE:
+ case H5I_ATTR:
+ case H5I_VFL:
+ case H5I_VOL:
+ case H5I_GENPROP_CLS:
+ case H5I_GENPROP_LST:
+ case H5I_ERROR_CLASS:
+ case H5I_ERROR_MSG:
+ case H5I_ERROR_STACK:
+ case H5I_SPACE_SEL_ITER:
+ case H5I_NTYPES:
+ default:
+ return FAIL;
+ } /* end switch */
+ } /* end if */
+
+ return ret_value;
+} /* end UD_hard_delete() */
+
+static int
+ud_hard_links_deprec(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5L_info1_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];
+
+ TESTING("user-defined hard link using deprecated routines (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
+
+ /* 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((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Check that external links are registered and UD hard links are not */
+ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) TEST_ERROR
+
+ /* Register "user-defined hard links" with the library */
+ if(H5Lregister(UD_hard_class_deprec) < 0) TEST_ERROR
+
+ /* Check that UD hard links are now registered */
+ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE) TEST_ERROR
+
+ /* Create a group for the UD hard link to point to */
+ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Get address for the group to give to the hard link */
+ if(H5Lget_info1(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
+
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Create a user-defined "hard link" to the group using the address we got
+ * from H5Lget_info1 */
+ 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
+
+ /* Close and re-open file to ensure that data is written to disk */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+
+ /* Open group through UD link */
+ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Check name */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/group")) TEST_ERROR
+
+ /* Create object in group */
+ if((gid2 = H5Gcreate2(gid, "new_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close groups*/
+ if(H5Gclose(gid2) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Re-open group without using ud link to check that it was created properly */
+ if((gid = H5Gopen2(fid, "group/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Check name */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/group/new_group")) TEST_ERROR
+
+ /* Close opened object */
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ /* Check that H5Lget_objinfo works on the hard link */
+ if(H5Lget_info1(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ /* 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;
+ } /* end if */
+
+ /* Unlink the group pointed to by the UD link. It shouldn't be
+ * deleted because of the UD link. */
+ if(H5Ldelete(fid, "/group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Ensure we can open the group through the UD link */
+ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Unlink the group contained within it. */
+ if(H5Ldelete(gid, "new_group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ /* Now delete the UD link. This should cause the group to be
+ * deleted, too. */
+ if(H5Ldelete(fid, "ud_link", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+
+ /* The file should be empty again. */
+ if(empty_size != h5_get_file_size(filename, fapl)) TEST_ERROR
+
+ if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end ud_hard_links_deprec() */
+
+static int
+ud_link_reregister_deprec(hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ H5L_info1_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 using deprecated routines (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
+
+ /* 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((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Check that UD hard links are not registered */
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) TEST_ERROR
+
+ /* Register "user-defined hard links" with the library */
+ if(H5Lregister(UD_hard_class_deprec) < 0) TEST_ERROR
+
+ /* Check that UD hard links are registered */
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE) TEST_ERROR
+
+ /* Point a UD defined hard link to a group in the same way as the previous test */
+ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Lget_info1(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_HARD_TYPE, &(li.u.address),
+ sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
+
+ /* Create a group named REREG_TARGET_NAME in the same group as the ud link */
+ if((gid = H5Gcreate2(fid, REREG_TARGET_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Now unregister UD hard links */
+ if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) TEST_ERROR
+
+ /* Check that UD hard links are no longer registered */
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) TEST_ERROR
+
+ /* Verify that we can't traverse the ud link anymore */
+ H5E_BEGIN_TRY {
+ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) >= 0) TEST_ERROR
+ } H5E_END_TRY
+
+ /* 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),
+ sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT) >= 0)
+ TEST_ERROR
+ } H5E_END_TRY
+
+ /* Register a new kind of link with the same ID number */
+ if(H5Lregister(UD_rereg_class) < 0) TEST_ERROR
+
+ /* Check that UD hard links are registered again */
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE) TEST_ERROR
+
+ /* Open a group through the ud link (now a different class of link).
+ * It should be a different group
+ * than the UD hard link pointed to */
+ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Check name */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/" REREG_TARGET_NAME)) TEST_ERROR
+
+ /* Create object in group */
+ if((gid2 = H5Gcreate2(gid, "new_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close groups*/
+ if(H5Gclose(gid2) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Re-open group without using ud link to check that it was created properly */
+ if((gid = H5Gopen2(fid, "rereg_target/new_group", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Check name */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/rereg_target/new_group")) TEST_ERROR
+
+ /* Close opened object */
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ /* Unlink the group pointed to by the UD hard link. It shouldn't be
+ * deleted because the UD link incremented its reference count. */
+ if(H5Ldelete(fid, "/group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* What a mess! Re-register user-defined links to clean up the
+ * reference counts. We shouldn't actually need to unregister the
+ * other link type */
+ if(H5Lregister(UD_hard_class_deprec) < 0) FAIL_STACK_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE) FAIL_STACK_ERROR
+
+ /* Ensure we can open the group through the UD link (now that UD hard
+ * links have been registered) */
+ if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ /* Delete the UD hard link. This should cause the group to be
+ * deleted, too. */
+ if(H5Ldelete(fid, "ud_link", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Unlink the other two groups so that we can make sure the file is empty */
+ if(H5Ldelete(fid, "/rereg_target/new_group", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ldelete(fid, REREG_TARGET_NAME, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+
+ /* The file should be empty again. */
+ if(empty_size != h5_get_file_size(filename, fapl)) TEST_ERROR
+
+ if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) FAIL_STACK_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end ud_link_reregister_deprec() */
+
+static int
+ud_callbacks_deprec(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_info1_t li; /* Link information */
+ char ud_target_name[] = UD_CB_TARGET; /* Link target name */
+ char filename[NAME_BUF_SIZE];
+ char query_buf[NAME_BUF_SIZE];
+
+ if(new_format)
+ TESTING("user-defined link callbacks using deprecated routines (w/new group format)")
+ else
+ TESTING("user-defined link callbacks using deprecated routines")
+
+ /* 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
+
+ /* Check that registered link classes are, and unregistered ones aren't */
+ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE) TEST_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_CB_TYPE) != FALSE) TEST_ERROR
+
+ /* Hit two birds with one stone: register UD hard links from previous
+ * test to check that having two UD links registered at once presents
+ * no problems. */
+ if(H5Lregister(UD_hard_class_deprec) < 0) TEST_ERROR
+
+ /* 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 */
+ if(H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE) TEST_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE) TEST_ERROR
+ if(H5Lis_registered((H5L_type_t)UD_CB_TYPE) != TRUE) TEST_ERROR
+
+ /* Create a group for the UD link to point to */
+ if((gid = H5Gcreate2(fid, UD_CB_TARGET, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Create a user-defined link to the group. These UD links behave like soft links. */
+ if(H5Lcreate_ud(fid, UD_CB_LINK_NAME, (H5L_type_t)UD_CB_TYPE, ud_target_name, (size_t)UD_CB_TARGET_LEN, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Try opening group through UD link */
+ if((gid = H5Gopen2(fid, UD_CB_LINK_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Query the link to test its query callback */
+ if(H5Lget_info1(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.u.val_size != 16) TEST_ERROR
+ if (UD_CB_TYPE != li.type) {
+ H5_FAILED();
+ HDputs(" Unexpected link class - should have been a UD hard link");
+ goto error;
+ }
+
+ /* Fill the query buffer */
+ if(H5Lget_val(fid, UD_CB_LINK_NAME, query_buf, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(HDstrcmp(query_buf, "query succeeded") != 0) TEST_ERROR
+
+ /* Move the link */
+ if(H5Lmove(fid, UD_CB_LINK_NAME, H5L_SAME_LOC, NEW_UD_CB_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Re-open group to ensure that move worked */
+ if((gid = H5Gopen2(fid, NEW_UD_CB_LINK_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ /* 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
+ * encoding (to test that LAPLs work) */
+ if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0) FAIL_STACK_ERROR
+ if(H5Pset_char_encoding(lcpl, H5T_CSET_UTF8) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_ud(fid, UD_CB_LINK_NAME, (H5L_type_t)UD_CB_TYPE, ud_target_name, (size_t)UD_CB_TARGET_LEN, lcpl, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Pclose(lcpl) < 0) FAIL_STACK_ERROR
+
+ /* Check its character encoding */
+ if(H5Lget_info1(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(li.cset != H5T_CSET_UTF8) TEST_ERROR
+
+ /* Unregister the link class so the library forgets what its callbacks do */
+ if(H5Lunregister((H5L_type_t)UD_CB_TYPE) < 0) FAIL_STACK_ERROR
+
+ /* Now test that each of the callbacks fails */
+ H5E_BEGIN_TRY {
+ if(H5Lcreate_ud(fid, NEW_UD_CB_LINK_NAME, (H5L_type_t)UD_CB_TYPE, ud_target_name, (size_t)UD_CB_TARGET_LEN, H5P_DEFAULT, H5P_DEFAULT) >= 0) FAIL_STACK_ERROR
+ if(H5Lmove(fid, UD_CB_LINK_NAME, H5L_SAME_LOC, NEW_UD_CB_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) >= 0) FAIL_STACK_ERROR
+ if(H5Ldelete(fid, UD_CB_LINK_NAME, H5P_DEFAULT) >= 0) FAIL_STACK_ERROR
+ if((gid = H5Gopen2(gid, UD_CB_LINK_NAME, H5P_DEFAULT)) >= 0) FAIL_STACK_ERROR
+ if(H5Ldelete(fid, UD_CB_LINK_NAME, H5P_DEFAULT) >= 0) FAIL_STACK_ERROR
+ } H5E_END_TRY
+
+ /* The query callback should NOT fail, but should be unable to give a linklen */
+ if(H5Lget_info1(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(li.u.val_size != 0) TEST_ERROR
+ if(li.type != UD_CB_TYPE) TEST_ERROR
+
+ /* Unregister the UD hard links */
+ if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose (lcpl);
+ H5Gclose (gid);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end ud_callbacks_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: lapl_nlinks_deprec
+ *
+ * Purpose: Check that the maximum number of soft links can be adjusted
+ * by the user using the Link Access Property List.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+lapl_nlinks_deprec(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];
+
+ if(new_format)
+ TESTING("adjusting nlinks with LAPL using deprecated routines (w/new group format)")
+ else
+ TESTING("adjusting nlinks with LAPL using deprecated routines")
+
+ /* Make certain test is valid */
+ /* XXX: should probably make a "generic" test that creates the proper
+ * # of links based on this value - QAK
+ */
+ HDassert(H5L_NUM_LINKS == 16);
+
+ /* Create file */
+ h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ 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
+
+ /* Create chain of soft links to existing object (limited) */
+ if(H5Lcreate_soft("final", fid, "soft1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft1", fid, "soft2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft2", fid, "soft3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft3", fid, "soft4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft4", fid, "soft5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft5", fid, "soft6", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft6", fid, "soft7", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft7", fid, "soft8", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft8", fid, "soft9", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft9", fid, "soft10", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft10", fid, "soft11", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft11", fid, "soft12", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft12", fid, "soft13", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft13", fid, "soft14", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft14", fid, "soft15", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft15", fid, "soft16", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("soft16", fid, "soft17", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* Close objects */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ /* Open file */
+ 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 */
+ if((plist = H5Pcreate(H5P_LINK_ACCESS)) < 0) TEST_ERROR
+ nlinks = 20;
+ if(H5Pset_nlinks(plist, nlinks) < 0) TEST_ERROR
+
+ /* Ensure that nlinks was set successfully */
+ nlinks = 0;
+ if(H5Pget_nlinks(plist, &nlinks) < 0) TEST_ERROR
+ if(nlinks != 20) TEST_ERROR
+
+ /* Open object through what is normally too many soft links using
+ * new property list */
+ if((gid = H5Oopen(fid, "soft17", plist)) < 0) TEST_ERROR
+
+ /* Check name */
+ if(H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0) TEST_ERROR
+ if(HDstrcmp(objname, "/soft17")) TEST_ERROR
+
+ /* Create group using soft link */
+ if((gid2 = H5Gcreate2(gid, "new_soft", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Close groups */
+ if(H5Gclose(gid2) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Set nlinks to a smaller number */
+ nlinks = 4;
+ if(H5Pset_nlinks(plist, nlinks) < 0) TEST_ERROR
+
+ /* Ensure that nlinks was set successfully */
+ nlinks = 0;
+ if(H5Pget_nlinks(plist, &nlinks) < 0) TEST_ERROR
+ if(nlinks != 4) TEST_ERROR
+
+ /* Try opening through what is now too many soft links */
+ H5E_BEGIN_TRY {
+ gid = H5Oopen(fid, "soft5", plist);
+ } H5E_END_TRY;
+ if (gid >= 0) {
+ H5_FAILED();
+ HDputs(" Should have failed for sequence of too many nested links.");
+ goto error;
+ }
+
+ /* Open object through lesser soft link */
+ if((gid = H5Oopen(fid, "soft4", plist)) < 0) TEST_ERROR
+
+ /* Check name */
+ 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
+
+ /* Try copying and moving when both src and dst contain many soft links
+ * using a non-default LAPL
+ */
+ if(H5Lcopy(fid, "soft17", fid, "soft17/newer_soft", H5P_DEFAULT, plist) < 0) TEST_ERROR
+ if(H5Lmove(fid, "soft17/newer_soft", fid, "soft17/newest_soft", H5P_DEFAULT, plist) < 0) TEST_ERROR
+
+ /* H5Olink */
+ if(H5Olink(gid, fid, "soft17/link_to_group", H5P_DEFAULT, plist) < 0) TEST_ERROR
+
+ /* H5Lcreate_hard and H5Lcreate_soft */
+ if(H5Lcreate_hard(fid, "soft17", fid, "soft17/link2_to_group", H5P_DEFAULT, plist) < 0) TEST_ERROR
+ if(H5Lcreate_soft("/soft4", fid, "soft17/soft_link", H5P_DEFAULT, plist) < 0) TEST_ERROR
+
+ /* H5Ldelete */
+ if(H5Ldelete(fid, "soft17/soft_link", plist) < 0) TEST_ERROR
+
+ /* H5Lget_val and H5Lget_info1 */
+ if(H5Lget_val(fid, "soft17", NULL, (size_t)0, plist) < 0) TEST_ERROR
+ if(H5Lget_info1(fid, "soft17", NULL, plist) < 0) TEST_ERROR
+
+ /* H5Lcreate_external and H5Lcreate_ud */
+ if(H5Lcreate_external("filename", "path", fid, "soft17/extlink", H5P_DEFAULT, plist) < 0) TEST_ERROR
+ if(H5Lregister(UD_rereg_class) < 0) TEST_ERROR
+ if(H5Lcreate_ud(fid, "soft17/udlink", (H5L_type_t)UD_HARD_TYPE, NULL, (size_t)0, H5P_DEFAULT, plist) < 0) TEST_ERROR
+
+ /* 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
+ if(H5Tclose(tid) < 0) TEST_ERROR
+
+ dims[0] = 2;
+ dims[1] = 2;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Close group */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Try to open the objects using too many symlinks with default *APLs */
+ H5E_BEGIN_TRY {
+ if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >= 0)
+ FAIL_PUTS_ERROR(" Should have failed for too many nested links.")
+ if((tid = H5Topen2(fid, "soft17/datatype", H5P_DEFAULT)) >= 0)
+ FAIL_PUTS_ERROR(" Should have failed for too many nested links.")
+ if((did = H5Dopen2(fid, "soft17/dataset", H5P_DEFAULT)) >= 0)
+ FAIL_PUTS_ERROR(" Should have failed for too many nested links.")
+ } H5E_END_TRY
+
+ /* Create property lists with nlinks set */
+ if((gapl = H5Pcreate(H5P_GROUP_ACCESS)) < 0) TEST_ERROR
+ if((tapl = H5Pcreate(H5P_DATATYPE_ACCESS)) < 0) TEST_ERROR
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0) TEST_ERROR
+
+ nlinks = 20;
+ if(H5Pset_nlinks(gapl, nlinks) < 0) TEST_ERROR
+ if(H5Pset_nlinks(tapl, nlinks) < 0) TEST_ERROR
+ if(H5Pset_nlinks(dapl, nlinks) < 0) TEST_ERROR
+
+ /* We should now be able to use these property lists to open each kind
+ * of object.
+ */
+ if((gid = H5Gopen2(fid, "soft17", gapl)) < 0) FAIL_STACK_ERROR
+ if((tid = H5Topen2(fid, "soft17/datatype", tapl)) < 0) TEST_ERROR
+ if((did = H5Dopen2(fid, "soft17/dataset", dapl)) < 0) TEST_ERROR
+
+ /* Close objects */
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Tclose(tid) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Close plists */
+ if(H5Pclose(gapl) < 0) TEST_ERROR
+ if(H5Pclose(tapl) < 0) TEST_ERROR
+ if(H5Pclose(dapl) < 0) TEST_ERROR
+
+ /* Unregister UD hard link class */
+ if(H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0) TEST_ERROR
+
+ /* Close file */
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+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 FAIL;
+} /* end lapl_nlinks_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: linkinfo_deprec
+ *
+ * Purpose: Check that the link class is returned correctly when queried.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+linkinfo_deprec(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_info1_t li; /* Link information */
+ char filename[NAME_BUF_SIZE];
+
+ if(new_format)
+ TESTING("link type field in H5Lget_info using deprecated routines (w/new group format)")
+ else
+ TESTING("link type field in H5Lget_info using deprecated routines")
+
+ /* 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
+
+ /* Register a couple of user-defined link classes with the library */
+ if(H5Lregister(UD_plist_class) < 0) TEST_ERROR
+
+ /* Create an object of each type */
+ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if(H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Close all objects */
+ if(H5Tclose(tid) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* Make sure that link type is correct when objects are queried */
+ if(H5Lget_info1(fid, "datatype", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.type != H5L_TYPE_HARD) TEST_ERROR
+ if(H5Lget_info1(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.type != H5L_TYPE_HARD) TEST_ERROR
+ if(H5Lget_info1(fid, "dataset", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.type != H5L_TYPE_HARD) TEST_ERROR
+
+ if(H5Lget_info1(fid, "ext_link", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.type != H5L_TYPE_EXTERNAL) TEST_ERROR
+ if(H5Lget_info1(fid, "softlink", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.type != H5L_TYPE_SOFT) TEST_ERROR
+ if(H5Lget_info1(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(li.type != UD_PLIST_TYPE) TEST_ERROR
+
+ /* Ensure that passing a NULL pointer doesn't cause an error */
+ if(H5Lget_info1(fid, "group", NULL, H5P_DEFAULT) < 0) TEST_ERROR
+
+ if(H5Fclose(fid) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Tclose (tid);
+ H5Dclose (did);
+ H5Gclose (gid);
+ H5Fclose (fid);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end linkinfo_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: corder_create_compact_deprec
+ *
+ * Purpose: Create a group with creation order indices and insert links
+ * in it when in compact form
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+corder_create_compact_deprec(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 */
+ 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 */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ unsigned u; /* Local index variable */
+
+ TESTING("creating compact group with creation order indexing using deprecated routines")
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create group creation property list */
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
+
+ /* Set creation order tracking & indexing on group */
+ if(H5Pset_link_creation_order(gcpl_id, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED)) < 0) TEST_ERROR
+
+ /* Create group with creation order indexing & tracking on */
+ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check on group's initial status */
+ if(H5G__is_empty_test(group_id) != TRUE) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
+
+ /* Query the group creation properties */
+ if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
+
+ /* Create several links, but keep group in compact form */
+ for(u = 0; u < max_compact; u++) {
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_links_test(group_id, &nlinks) != TRUE) TEST_ERROR
+ if(nlinks != (u + 1)) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
+ } /* end for */
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the group creation property list */
+ if(H5Pclose(gcpl_id) < 0) TEST_ERROR
+
+ /* 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
+
+ /* Open group created */
+ if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_links_test(group_id, &nlinks) != TRUE) TEST_ERROR
+ if(nlinks != max_compact) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
+
+ /* Loop through links, checking their creation order values */
+ /* (the name index is used, but the creation order value is in the same order) */
+ for(u = 0; u < max_compact; u++) {
+ H5L_info1_t linfo; /* Link information */
+
+ /* Retrieve information for link */
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ if(H5Lget_info1(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify creation order of link */
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != u) TEST_ERROR
+ } /* end for */
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(gcpl_id);
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end corder_create_compact_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: corder_create_dense_deprec
+ *
+ * Purpose: Create a group with creation order indices and insert links
+ * in it until it's in dense form
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+corder_create_dense_deprec(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 */
+ 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 */
+ 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 */
+ char filename[NAME_BUF_SIZE];/* File name */
+ unsigned u; /* Local index variable */
+
+ TESTING("creating dense group with creation order indexing using deprecated routines")
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create group creation property list */
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
+
+ /* Set creation order tracking & indexing on group */
+ if(H5Pset_link_creation_order(gcpl_id, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED)) < 0) TEST_ERROR
+
+ /* Create group with creation order indexing & tracking on */
+ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check on group's initial status */
+ if(H5G__is_empty_test(group_id) != TRUE) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
+
+ /* Query the group creation properties */
+ if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
+
+ /* Create several links, up to limit of compact form */
+ for(u = 0; u < max_compact; u++) {
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_links_test(group_id, &nlinks) != TRUE) TEST_ERROR
+ if(nlinks != (u + 1)) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
+ } /* end for */
+
+ /* Create another link, to push group into dense form */
+ HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR
+
+ /* Retrieve & verify # of records in the name & creation order indices */
+ if(H5G__new_dense_info_test(group_id, &name_count, &corder_count) < 0) TEST_ERROR
+ if(name_count != corder_count) TEST_ERROR
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the group creation property list */
+ if(H5Pclose(gcpl_id) < 0) TEST_ERROR
+
+ /* 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
+
+ /* Open group created */
+ if((group_id = H5Gopen2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR
+ if(H5G__has_stab_test(group_id) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR
+
+ /* Loop through links, checking their creation order values */
+ /* (the name index is used, but the creation order value is in the same order) */
+ for(u = 0; u < (max_compact + 1); u++) {
+ H5L_info1_t linfo; /* Link information */
+
+ /* Retrieve information for link */
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ if(H5Lget_info1(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify creation order of link */
+ if(linfo.corder_valid != TRUE) TEST_ERROR
+ if(linfo.corder != u) TEST_ERROR
+ } /* end for */
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(gcpl_id);
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end corder_create_dense_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_info_by_idx_check_deprec
+ *
+ * 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
+ * group in alphabetical order.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n,
+ hbool_t hard_link, hbool_t use_index)
+{
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
+ H5L_info1_t linfo; /* Link info struct */
+
+ /* Make link value for increasing/native order queries */
+ HDsnprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
+
+ /* Verify the link information for first link, in increasing creation order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != 0) TEST_ERROR
+
+ /* Verify the link information for new link, in increasing creation order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != (int64_t)n) TEST_ERROR
+
+ /* Verify value for new soft link, in increasing creation order */
+ if(!hard_link) {
+ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end if */
+
+ /* Verify the name for new link, in increasing creation order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(linkname, tmpname)) TEST_ERROR
+
+ /* Don't test "native" order if there is no creation order index, since
+ * there's not a good way to easily predict the link's order in the name
+ * index.
+ */
+ if(use_index) {
+ /* Verify the link information for first link, in native creation order (which is increasing) */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != 0) TEST_ERROR
+
+ /* Verify the link information for new link, in native creation order (which is increasing) */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != (int64_t)n) TEST_ERROR
+
+ /* Verify value for new soft link, in native creation order (which is increasing) */
+ if(!hard_link) {
+ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end if */
+
+ /* Verify the name for new link, in native creation order (which is increasing) */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(linkname, tmpname)) TEST_ERROR
+ } /* end if */
+
+ /* Verify the link information for first link, in decreasing creation order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != 0) TEST_ERROR
+
+ /* Verify the link information for new link, in decreasing creation order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != (int64_t)n) TEST_ERROR
+
+ /* Verify value for new soft link, in decreasing creation order */
+ if(!hard_link) {
+ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end if */
+
+ /* Verify the name for new link, in decreasing creation order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(linkname, tmpname)) TEST_ERROR
+
+
+ /* Verify the link information for first link, in increasing link name order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != 0) TEST_ERROR
+
+ /* Verify the link information for new link, in increasing link name order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != (int64_t)n) TEST_ERROR
+
+ /* Verify value for new soft link, in increasing link name order */
+ if(!hard_link) {
+ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end if */
+
+ /* Verify the name for new link, in increasing link name order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(linkname, tmpname)) TEST_ERROR
+
+ /* Don't test "native" order queries on link name order, since there's not
+ * a good way to easily predict the order of the links in the name index.
+ */
+
+ /* Verify the link information for first link, in decreasing link name order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != 0) TEST_ERROR
+
+ /* Verify the link information for new link, in decreasing link name order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.corder != (int64_t)n) TEST_ERROR
+
+ /* Verify value for new soft link, in decreasing link name order */
+ if(!hard_link) {
+ HDmemset(tmpval, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end if */
+
+ /* Verify the name for new link, in decreasing link name order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(linkname, tmpname)) TEST_ERROR
+
+ /* Success */
+ return(0);
+
+error:
+ /* Failure */
+ return(-1);
+} /* end link_info_by_idx_check_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_info_by_idx_deprec
+ *
+ * Purpose: Create a group with creation order indices and test querying
+ * info by index.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_info_by_idx_deprec(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 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 */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5L_info1_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ ssize_t name_len; /* Length of name */
+ herr_t ret; /* Generic return value */
+
+ /* Loop over creating hard or soft links */
+ for(hard_link = FALSE; hard_link <= TRUE; hard_link++) {
+ /* Loop over using index for creation order value */
+ for(use_index = FALSE; use_index <= TRUE; use_index++) {
+ if(hard_link) {
+ if(use_index)
+ TESTING("querying info by index w/creation order index, using hard links and deprecated routines")
+ else
+ TESTING("querying info by index w/o creation order index, using hard links and deprecated routines")
+ } /* end if */
+ else {
+ if(use_index)
+ TESTING("querying info by index w/creation order index, using soft links and deprecated routines")
+ else
+ TESTING("querying info by index w/o creation order index, using soft links and deprecated routines")
+ } /* end else */
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create group creation property list */
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
+
+ /* Set creation order tracking & indexing on group */
+ if(H5Pset_link_creation_order(gcpl_id, (H5P_CRT_ORDER_TRACKED | (use_index ? H5P_CRT_ORDER_INDEXED : (unsigned)0))) < 0) TEST_ERROR
+
+ /* Create group with creation order indexing & tracking on */
+ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Query the group creation properties */
+ if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
+
+ /* Check for query on empty group */
+ H5E_BEGIN_TRY {
+ ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(name_len >= 0) TEST_ERROR
+
+ /* Create several links, up to limit of compact form */
+ for(u = 0; u < max_compact; u++) {
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Check for creating hard or soft link */
+ if(hard_link) {
+ 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
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end if */
+ else {
+ /* Make value for link */
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
+
+ /* Create soft link */
+ if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ } /* end else */
+
+ /* Verify link information for new link */
+ if(link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, hard_link, use_index) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Verify state of group */
+ if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR
+
+ /* Check for out of bound offset queries */
+ H5E_BEGIN_TRY {
+ ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(name_len >= 0) TEST_ERROR
+
+ /* Create more links, to push group into dense form */
+ for(; u < (max_compact * 2); u++) {
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Check for creating hard or soft link */
+ if(hard_link) {
+ 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
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end if */
+ else {
+ /* Make value for link */
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
+
+ /* Create soft link */
+ if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ } /* end else */
+
+ /* Verify state of group */
+ if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR
+
+ /* Verify link information for new link */
+ if(link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, hard_link, use_index) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Check for out of bound offset queries */
+ H5E_BEGIN_TRY {
+ ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(name_len >= 0) TEST_ERROR
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the group creation property list */
+ if(H5Pclose(gcpl_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ } /* end for */
+ } /* end for */
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(gcpl_id);
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end link_info_by_idx_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_info_by_idx_old_deprec
+ *
+ * Purpose: Create a old-format group and test querying
+ * info by index.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_info_by_idx_old_deprec(hid_t fapl)
+{
+ 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_info1_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
+ unsigned u; /* Local index variable */
+ ssize_t name_len; /* Length of name */
+ herr_t ret; /* Generic return value */
+
+ /* Loop over creating hard or soft links */
+ for(hard_link = FALSE; hard_link <= TRUE; hard_link++) {
+ if(hard_link)
+ TESTING("querying info by index in old-style group, using hard links and deprecated routines")
+ else
+ TESTING("querying info by index in old-style group, using soft links and deprecated routines")
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create group to operate on */
+ if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Create several links */
+ for(u = 0; u < CORDER_NLINKS; u++) {
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Check for creating hard or soft link */
+ if(hard_link) {
+ H5O_info1_t oi; /* Buffer for querying object's info */
+
+ /* Create group */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Retrieve group's address on disk */
+ if(H5Oget_info2(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oi.addr;
+
+ /* Close group */
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end if */
+ else {
+ /* Make value for link */
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
+
+ /* Create soft link */
+ if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ } /* end else */
+ } /* end for */
+
+ /* Verify link information for created links */
+ for(u = 0; u < CORDER_NLINKS; u++) {
+ unsigned dec_u = CORDER_NLINKS - (u + 1); /* Decreasing mapped index */
+
+ /* Make link name for increasing/native order queries */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Make link value for increasing/native order queries */
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
+
+ /* Verify link information (in increasing order) */
+ if(hard_link) {
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5F_addr_ne(linfo.u.address, objno[u])) TEST_ERROR
+ } /* end if */
+ else {
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end else */
+
+ /* Verify link name (in increasing order) */
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+
+
+ /* Verify link information (in native order - native is increasing) */
+ if(hard_link) {
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5F_addr_ne(linfo.u.address, objno[u])) TEST_ERROR
+ } /* end if */
+ else {
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end else */
+
+ /* Verify link name (in native order - native is increasing) */
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+
+
+ /* Make link name for decreasing order queries */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
+
+ /* Make link value for decreasing order queries */
+ HDsnprintf(valname, sizeof(valname), "value %02u", dec_u);
+
+ /* Verify link information (in decreasing order) */
+ if(hard_link) {
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ } /* end if */
+ else {
+ if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(valname, tmpval)) TEST_ERROR
+ } /* end else */
+
+ /* Verify link name (in decreasing order) */
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Check for creation order index queries */
+ H5E_BEGIN_TRY {
+ ret = H5Lget_info_by_idx1(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+ H5E_BEGIN_TRY {
+ name_len = H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(name_len >= 0) TEST_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ } /* end for */
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end link_info_by_idx_old_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: delete_by_idx_deprec
+ *
+ * Purpose: Create a group with creation order indices and test deleting
+ * links by index.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+delete_by_idx_deprec(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 */
+ 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 */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5L_info1_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
+
+ /* Loop over operating on different indices on link fields */
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
+ /* Loop over operating in different orders */
+ for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) {
+ /* Loop over using index for creation order value */
+ for(use_index = FALSE; use_index <= TRUE; use_index++) {
+ /* Print appropriate test message */
+ if(idx_type == H5_INDEX_CRT_ORDER) {
+ if(order == H5_ITER_INC) {
+ if(use_index)
+ TESTING("deleting links by creation order index in increasing order w/creation order index using deprecated routines")
+ else
+ TESTING("deleting links by creation order index in increasing order w/o creation order index using deprecated routines")
+ } /* end if */
+ else {
+ if(use_index)
+ TESTING("deleting links by creation order index in decreasing order w/creation order index using deprecated routines")
+ else
+ TESTING("deleting links by creation order index in decreasing order w/o creation order index using deprecated routines")
+ } /* end else */
+ } /* end if */
+ else {
+ if(order == H5_ITER_INC) {
+ if(use_index)
+ TESTING("deleting links by name index in increasing order w/creation order index using deprecated routines")
+ else
+ TESTING("deleting links by name index in increasing order w/o creation order index using deprecated routines")
+ } /* end if */
+ else {
+ if(use_index)
+ TESTING("deleting links by name index in decreasing order w/creation order index using deprecated routines")
+ else
+ TESTING("deleting links by name index in decreasing order w/o creation order index using deprecated routines")
+ } /* end else */
+ } /* end else */
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Create group creation property list */
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
+
+ /* Set creation order tracking & indexing on group */
+ if(H5Pset_link_creation_order(gcpl_id, (H5P_CRT_ORDER_TRACKED | (use_index ? H5P_CRT_ORDER_INDEXED : (unsigned)0))) < 0) TEST_ERROR
+
+ /* 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
+
+ /* 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);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Check for deletion on non-existing group */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, "None", 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 */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create hard link, with group object */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+
+ /* Verify link information for new link */
+ if(link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Verify state of group (compact) */
+ if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR
+
+ /* Check for out of bound deletion */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Delete links from compact group */
+ for(u = 0; u < (max_compact - 1); u++) {
+ /* Delete first link in appropriate order */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for first link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(linfo.corder != (u + 1)) TEST_ERROR
+ } /* end if */
+ else {
+ if(linfo.corder != (max_compact - (u + 2))) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for first link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete last link */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify state of group (empty) */
+ if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR
+
+ /* Create more links, to push group into dense form */
+ for(u = 0; u < (max_compact * 2); u++) {
+ hid_t group_id2; /* Group ID */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create hard link, with group object */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+
+ /* Verify state of group (dense) */
+ if(u >= max_compact)
+ if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR
+
+ /* Verify link information for new link */
+ if(link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Check for out of bound deletion again */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Delete links from dense group, in appropriate order */
+ for(u = 0; u < ((max_compact * 2) - 1); u++) {
+ /* Delete first link in appropriate order */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for first link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(linfo.corder != (u + 1)) TEST_ERROR
+ } /* end if */
+ else {
+ if(linfo.corder != ((max_compact * 2) - (u + 2))) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for first link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete last link */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify state of group (empty) */
+ if(H5G__has_links_test(group_id, NULL) == TRUE) TEST_ERROR
+ if(H5G__is_new_dense_test(group_id) == TRUE) TEST_ERROR
+
+ /* Check for deletion on empty group again */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
+ } 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 */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create hard link, with group object */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+
+ /* Verify state of group (dense) */
+ if(u >= max_compact)
+ if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR
+
+ /* Verify link information for new link */
+ if(link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, TRUE, use_index) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Delete every other link from dense group, in appropriate order */
+ for(u = 0; u < max_compact; u++) {
+ /* Delete link */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for current link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", idx_type, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(linfo.corder != ((u * 2) + 1)) TEST_ERROR
+ } /* end if */
+ else {
+ if(linfo.corder != ((max_compact * 2) - ((u * 2) + 2))) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for current link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2)));
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete remaining links from dense group, in appropriate order */
+ for(u = 0; u < (max_compact - 1); u++) {
+ /* Delete link */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for first link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(linfo.corder != ((u * 2) + 3)) TEST_ERROR
+ } /* end if */
+ else {
+ if(linfo.corder != ((max_compact * 2) - ((u * 2) + 4))) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for first link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4)));
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete last link */
+ if(H5Ldelete_by_idx(group_id, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify state of group (empty) */
+ 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
+
+ /* Close the group creation property list */
+ if(H5Pclose(gcpl_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ } /* end for */
+ } /* end for */
+ } /* end for */
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(gcpl_id);
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* end delete_by_idx_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: delete_by_idx_old_deprec
+ *
+ * Purpose: Create a old-format group and test deleting
+ * links by index.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+delete_by_idx_old_deprec(hid_t fapl)
+{
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ H5L_info1_t linfo; /* Link info struct */
+ H5_iter_order_t order; /* Order within in the index */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
+
+ /* Loop over operating in different orders */
+ for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) {
+ /* Print test banner */
+ if(order == H5_ITER_INC)
+ TESTING("deleting links by index in increasing order in old-style group using deprecated routines")
+ else
+ TESTING("deleting links by index in decreasing order in old-style group using deprecated routines")
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* 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);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Create several links */
+ for(u = 0; u < CORDER_NLINKS; u++) {
+ H5O_info1_t oi; /* Buffer for querying object's info */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create group */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Retrieve group's address on disk */
+ if(H5Oget_info2(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oi.addr;
+
+ /* Close group */
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Check for bad index type deletion */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)0, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Check for out of bounds deletion */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Delete links, in appropriate order */
+ for(u = 0; u < (CORDER_NLINKS - 1); u++) {
+ unsigned dec_u = CORDER_NLINKS - (u + 2); /* Decreasing mapped index */
+
+ /* Delete first link in appropriate order */
+ if(H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for first link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(H5F_addr_ne(linfo.u.address, objno[u + 1])) TEST_ERROR
+ } /* end if */
+ else {
+ if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for first link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete last link */
+ if(H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check for deletion in empty group (again) */
+ H5E_BEGIN_TRY {
+ ret = H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* 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_info1_t oi; /* Buffer for querying object's info */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create group */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Retrieve group's address on disk */
+ if(H5Oget_info2(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oi.addr;
+
+ /* Close group */
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Delete every other link from group, in appropriate order */
+ for(u = 0; u < (CORDER_NLINKS / 2); u++) {
+ unsigned dec_u = CORDER_NLINKS - ((u * 2) + 2); /* Decreasing mapped index */
+
+ /* Delete link */
+ if(H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for current link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(H5F_addr_ne(linfo.u.address, objno[(u * 2) + 1])) TEST_ERROR
+ } /* end if */
+ else {
+ if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for current link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete remaining links from group, in appropriate order */
+ for(u = 0; u < ((CORDER_NLINKS / 2) - 1); u++) {
+ unsigned dec_u = CORDER_NLINKS - ((u * 2) + 4); /* Decreasing mapped index */
+
+ /* Delete link */
+ if(H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify the link information for first link in appropriate order */
+ HDmemset(&linfo, 0, sizeof(linfo));
+ if(H5Lget_info_by_idx1(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ if(H5F_addr_ne(linfo.u.address, objno[(u * 2) + 3])) TEST_ERROR
+ } /* end if */
+ else {
+ if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ } /* end else */
+
+ /* Verify the name for first link in appropriate order */
+ HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
+ if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(order == H5_ITER_INC)
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
+ else
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if(HDstrcmp(objname, tmpname)) TEST_ERROR
+ } /* end for */
+
+ /* Delete last link */
+ if(H5Ldelete_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Verify state of group */
+ if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ } /* end for */
+
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+} /* end delete_by_idx_old_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_deprec_cb
+ *
+ * Purpose: Callback routine for iterating over links in group
*
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_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_info1_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_info1(group_id, link_name, &my_info, H5P_DEFAULT) < 0)
+ return H5_ITER_ERROR;
+
+ /* Check more things for link iteration (vs. group iteration) */
+ if(info) {
+ /* Check for correct order of iteration */
+ /* (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;
+
+ /* Compare link info structs */
+ if(info->type != my_info.type)
+ return H5_ITER_ERROR;
+ if(info->corder_valid != my_info.corder_valid)
+ return H5_ITER_ERROR;
+ if(info->corder != my_info.corder)
+ return H5_ITER_ERROR;
+ if(info->cset != my_info.cset)
+ return H5_ITER_ERROR;
+ if(H5F_addr_ne(info->u.address, my_info.u.address))
+ 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;
+
+ /* Check if we've visited this link before */
+ if((size_t)op_data->curr >= op_data->max_visit)
+ return H5_ITER_ERROR;
+ if(op_data->visited[op_data->curr])
+ return H5_ITER_ERROR;
+ op_data->visited[op_data->curr] = TRUE;
+
+ /* Advance to next value, in correct direction */
+ if(op_data->order != H5_ITER_DEC)
+ op_data->curr++;
+ else
+ op_data->curr--;
+
+ /* Check for stopping in the middle of iterating */
+ if(op_data->stop > 0)
+ if(--op_data->stop == 0)
+ return CORDER_ITER_STOP;
+
+ return H5_ITER_CONT;
+} /* end link_iterate_deprec_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: group_iterate_deprec_cb
+ *
+ * Purpose: Callback routine for iterating over links in group with
+ * H5Giterate()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+group_iterate_deprec_cb(hid_t group_id, const char *link_name, void *_op_data)
+{
+ return link_iterate_deprec_cb(group_id, link_name, NULL, _op_data);
+} /* end group_iterate_deprec_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_fail_deprec_cb
+ *
+ * Purpose: Callback routine for iterating over links in group that
+ * always returns failure
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_fail_deprec_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *link_name,
+ const H5L_info1_t H5_ATTR_UNUSED *info, void H5_ATTR_UNUSED *_op_data)
+{
+ return H5_ITER_ERROR;
+} /* end link_iterate_fail_deprec_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_check_deprec
+ *
+ * Purpose: Check iteration over links in a group
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, 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 */
+ int gskip; /* # of links to skip in group, with H5Giterate */
+ herr_t ret; /* Generic return value */
+
+ /* Iterate over links in group */
+ iter_info->nskipped = (unsigned)(skip = 0);
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(skip != max_links) TEST_ERROR
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+
+ /* Iterate over links in group, with H5Giterate */
+ iter_info->nskipped = (unsigned)(gskip = 0);
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Giterate(group_id, ".", &gskip, group_iterate_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(gskip != (int)max_links) TEST_ERROR
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+
+ /* Skip over some links in group */
+ iter_info->nskipped = (unsigned)(skip = max_links / 2);
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(skip != max_links) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v + (max_links / 2)] == FALSE) TEST_ERROR
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+ } /* end if */
+ else {
+ unsigned nvisit = 0; /* # of links visited */
+
+ HDassert(order == H5_ITER_NATIVE);
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == TRUE)
+ nvisit++;
+
+ if(nvisit != (max_links / 2)) TEST_ERROR
+ } /* end else */
+
+ /* Skip over some links in group, with H5Giterate */
+ iter_info->nskipped = (unsigned)(gskip = (int)(max_links / 2));
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? (unsigned)gskip : ((max_links - 1) - (unsigned)gskip);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Giterate(group_id, ".", &gskip, group_iterate_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(gskip != (int)max_links) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v + (max_links / 2)] == FALSE) TEST_ERROR
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+ } /* end if */
+ else {
+ unsigned nvisit = 0; /* # of links visited */
+
+ HDassert(order == H5_ITER_NATIVE);
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == TRUE)
+ nvisit++;
+
+ if(nvisit != (max_links / 2)) TEST_ERROR
+ } /* end else */
+
+ /* Iterate over links in group, stopping in the middle */
+ iter_info->nskipped = (unsigned)(skip = 0);
+ iter_info->order = order;
+ iter_info->stop = 3;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if((ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, iter_info)) < 0) TEST_ERROR
+ if(ret != CORDER_ITER_STOP) TEST_ERROR
+ if(iter_info->ncalled != 3) TEST_ERROR
+
+ /* Iterate over links in group, stopping in the middle, with H5Giterate() */
+ iter_info->nskipped = (unsigned)(gskip = 0);
+ iter_info->order = order;
+ iter_info->stop = 3;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if((ret = H5Giterate(group_id, ".", &gskip, group_iterate_deprec_cb, iter_info)) < 0) TEST_ERROR
+ if(ret != CORDER_ITER_STOP) TEST_ERROR
+ if(iter_info->ncalled != 3) TEST_ERROR
+
+ /* Check for iteration routine indicating failure */
+ skip = 0;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_fail_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Success */
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end link_iterate_check_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_deprec
+ *
+ * Purpose: Create a group with creation order indices and test iterating over
+ * links by index.
+ *
+ * Return: Success: 0
* Failure: -1
*
* Programmer: Quincey Koziol
- * Wednesday, May 25, 2005
+ * Tuesday, November 14, 2006
*
- * Modifications:
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_deprec(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 */
+ 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 */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ link_iter_info_t iter_info; /* Iterator info */
+ hbool_t *visited = NULL; /* Array of flags for visiting links */
+ hsize_t skip; /* # of links to skip in group */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
+
+ /* Create group creation property list */
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
+
+ /* Query the group creation properties */
+ if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
+
+ /* Allocate the "visited link" array */
+ iter_info.max_visit = max_compact * 2;
+ if(NULL == (visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit))) TEST_ERROR
+ iter_info.visited = visited;
+
+ /* Loop over operating on different indices on link fields */
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
+ /* Loop over operating in different orders */
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
+ /* Loop over using index for creation order value */
+ for(use_index = FALSE; use_index <= TRUE; use_index++) {
+ /* Print appropriate test message */
+ if(idx_type == H5_INDEX_CRT_ORDER) {
+ if(order == H5_ITER_INC) {
+ if(use_index)
+ TESTING("iterating over links by creation order index in increasing order w/creation order index using deprecated routines")
+ else
+ TESTING("iterating over links by creation order index in increasing order w/o creation order index using deprecated routines")
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ if(use_index)
+ TESTING("iterating over links by creation order index in decreasing order w/creation order index using deprecated routines")
+ else
+ TESTING("iterating over links by creation order index in decreasing order w/o creation order index using deprecated routines")
+ } /* end else */
+ else {
+ HDassert(order == H5_ITER_NATIVE);
+ if(use_index)
+ TESTING("iterating over links by creation order index in native order w/creation order index using deprecated routines")
+ else
+ TESTING("iterating over links by creation order index in native order w/o creation order index using deprecated routines")
+ } /* end else */
+ } /* end if */
+ else {
+ if(order == H5_ITER_INC) {
+ if(use_index)
+ TESTING("iterating over links by name index in increasing order w/creation order index using deprecated routines")
+ else
+ TESTING("iterating over links by name index in increasing order w/o creation order index using deprecated routines")
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ if(use_index)
+ TESTING("iterating over links by name index in decreasing order w/creation order index using deprecated routines")
+ else
+ TESTING("iterating over links by name index in decreasing order w/o creation order index using deprecated routines")
+ } /* end else */
+ else {
+ HDassert(order == H5_ITER_NATIVE);
+ if(use_index)
+ TESTING("iterating over links by name index in native order w/creation order index using deprecated routines")
+ else
+ TESTING("iterating over links by name index in native order w/o creation order index using deprecated routines")
+ } /* end else */
+ } /* end else */
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* Set creation order tracking & indexing on group */
+ if(H5Pset_link_creation_order(gcpl_id, (H5P_CRT_ORDER_TRACKED | (use_index ? H5P_CRT_ORDER_INDEXED : (unsigned)0))) < 0) TEST_ERROR
+
+ /* 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(H5Literate1(group_id, idx_type, order, NULL, link_iterate_deprec_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 */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create hard link, with group object */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Verify state of group (compact) */
+ if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR
+
+ /* Check for out of bound iteration on compact group */
+ skip = (hsize_t)u;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Test iteration over links in compact group */
+ if(link_iterate_check_deprec(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 */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create hard link, with group object */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Verify state of group (dense) */
+ if(H5G__is_new_dense_test(group_id) != TRUE) TEST_ERROR
+
+ /* Check for out of bound iteration on dense group */
+ skip = (hsize_t)u;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Test iteration over links in dense group */
+ if(link_iterate_check_deprec(group_id, idx_type, order, u, &iter_info) < 0) TEST_ERROR
+
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ } /* end for */
+ } /* end for */
+ } /* end for */
+
+ /* Close the group creation property list */
+ if(H5Pclose(gcpl_id) < 0) TEST_ERROR
+
+ /* Free resources */
+ if(visited)
+ HDfree(visited);
+
+ return SUCCEED;
+
+error:
+ /* Free resources */
+ H5E_BEGIN_TRY {
+ H5Pclose(gcpl_id);
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+
+ if(visited)
+ HDfree(visited);
+
+ return FAIL;
+} /* end link_iterate_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_old_deprec_cb
*
+ * Purpose: Callback routine for iterating over [old] links in group
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_old_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_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_info1_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_info1(group_id, link_name, &my_info, H5P_DEFAULT) < 0)
+ 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;
+ if(info->corder_valid != my_info.corder_valid)
+ return H5_ITER_ERROR;
+ if(info->corder != my_info.corder)
+ return H5_ITER_ERROR;
+ if(info->cset != my_info.cset)
+ return H5_ITER_ERROR;
+ if(H5F_addr_ne(info->u.address, my_info.u.address))
+ 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;
+
+ /* Check if we've visited this link before */
+ if((size_t)op_data->curr >= op_data->max_visit)
+ return H5_ITER_ERROR;
+ if(op_data->visited[op_data->curr])
+ return H5_ITER_ERROR;
+ op_data->visited[op_data->curr] = TRUE;
+
+ /* Advance to next value, in correct direction */
+ if(op_data->order != H5_ITER_DEC)
+ op_data->curr++;
+ else
+ op_data->curr--;
+
+ /* Check for stopping in the middle of iterating */
+ if(op_data->stop > 0)
+ if(--op_data->stop == 0)
+ return CORDER_ITER_STOP;
+
+ return H5_ITER_CONT;
+} /* end link_iterate_old_deprec_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: group_iterate_old_deprec_cb
+ *
+ * Purpose: Callback routine for iterating over links in group with
+ * H5Giterate()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+group_iterate_old_deprec_cb(hid_t group_id, const char *link_name, void *_op_data)
+{
+ return link_iterate_old_deprec_cb(group_id, link_name, NULL, _op_data);
+} /* end group_iterate_old_deprec_cb() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_old_check_deprec
+ *
+ * Purpose: Check iteration over [old] links in a group
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_old_check_deprec(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 */
+ int gskip; /* # of links to skip in group, with H5Giterate */
+ herr_t ret; /* Generic return value */
+
+ /* Iterate over links in group */
+ iter_info->nskipped = (unsigned)(skip = 0);
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(skip != max_links) TEST_ERROR
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+
+ /* Iterate over links in group, with H5Giterate */
+ iter_info->nskipped = (unsigned)(gskip = 0);
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Giterate(group_id, ".", &gskip, group_iterate_old_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(gskip != (int)max_links) TEST_ERROR
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+
+ /* Skip over some links in group */
+ iter_info->nskipped = (unsigned)(skip = max_links / 2);
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(skip != max_links) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v + (max_links / 2)] == FALSE) TEST_ERROR
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+ } /* end if */
+ else {
+ unsigned nvisit = 0; /* # of links visited */
+
+ HDassert(order == H5_ITER_NATIVE);
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == TRUE)
+ nvisit++;
+
+ if(nvisit != (max_links / 2)) TEST_ERROR
+ } /* end else */
+
+ /* Skip over some links in group, with H5Giterate */
+ iter_info->nskipped = (unsigned)(gskip = (int)(max_links / 2));
+ iter_info->order = order;
+ iter_info->stop = -1;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? (unsigned)gskip : ((max_links - 1) - (unsigned)gskip);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if(H5Giterate(group_id, ".", &gskip, group_iterate_old_deprec_cb, iter_info) < 0) TEST_ERROR
+
+ /* Verify that we visited all the links */
+ if(gskip != (int)max_links) TEST_ERROR
+ if(order == H5_ITER_INC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v + (max_links / 2)] == FALSE) TEST_ERROR
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ for(v = 0; v < (max_links / 2); v++)
+ if(iter_info->visited[v] == FALSE) TEST_ERROR
+ } /* end if */
+ else {
+ unsigned nvisit = 0; /* # of links visited */
+
+ HDassert(order == H5_ITER_NATIVE);
+ for(v = 0; v < max_links; v++)
+ if(iter_info->visited[v] == TRUE)
+ nvisit++;
+
+ if(nvisit != (max_links / 2)) TEST_ERROR
+ } /* end else */
+
+ /* Iterate over links in group, stopping in the middle */
+ iter_info->nskipped = (unsigned)(skip = 0);
+ iter_info->order = order;
+ iter_info->stop = 3;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if((ret = H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, iter_info)) < 0) TEST_ERROR
+ if(ret != CORDER_ITER_STOP) TEST_ERROR
+ if(iter_info->ncalled != 3) TEST_ERROR
+
+ /* Iterate over links in group, stopping in the middle, with H5Giterate() */
+ iter_info->nskipped = (unsigned)(gskip = 0);
+ iter_info->order = order;
+ iter_info->stop = 3;
+ iter_info->ncalled = 0;
+ iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
+ HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ if((ret = H5Giterate(group_id, ".", &gskip, group_iterate_old_deprec_cb, iter_info)) < 0) TEST_ERROR
+ if(ret != CORDER_ITER_STOP) TEST_ERROR
+ if(iter_info->ncalled != 3) TEST_ERROR
+
+ /* Check for iteration routine indicating failure */
+ skip = 0;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Check for iteration w/bad location ID */
+ skip = 0;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ H5E_BEGIN_TRY {
+ ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_deprec_cb, iter_info);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Success */
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end link_iterate_old_check_deprec() */
+
+/*-------------------------------------------------------------------------
+ * Function: link_iterate_old_deprec
+ *
+ * Purpose: Create a "old-style" group and test iterating over links by index.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+link_iterate_old_deprec(hid_t fapl)
+{
+ 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 */
+ link_iter_info_t iter_info; /* Iterator info */
+ hbool_t *visited = NULL; /* Array of flags for visiting links */
+ hsize_t skip; /* # of links to skip in group */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
+
+ /* Allocate the "visited link" array */
+ iter_info.max_visit = CORDER_NLINKS;
+ if(NULL == (visited = (hbool_t *)HDmalloc(sizeof(hbool_t) * iter_info.max_visit))) TEST_ERROR
+ iter_info.visited = visited;
+
+ /* Loop over operating in different orders */
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
+ /* Print appropriate test message */
+ if(order == H5_ITER_INC) {
+ TESTING("iterating over links by name index in increasing order in old-style group using deprecated routines")
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ TESTING("iterating over links by name index in decreasing order in old-style group using deprecated routines")
+ } /* end else */
+ else {
+ HDassert(order == H5_ITER_NATIVE);
+ TESTING("iterating over links by name index in native order in old-style group using deprecated routines")
+ } /* end else */
+
+ /* Create file */
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+
+ /* 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(H5Literate1(group_id, H5_INDEX_NAME, order, NULL, link_iterate_old_deprec_cb, NULL) < 0) TEST_ERROR
+
+ /* Create several links */
+ for(u = 0; u < CORDER_NLINKS; u++) {
+ hid_t group_id2; /* Group ID */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Create hard link, with group object */
+ if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group_id2) < 0) TEST_ERROR
+ } /* end for */
+
+ /* Verify state of group (symbol table) */
+ if(H5G__has_stab_test(group_id) != TRUE) TEST_ERROR
+
+ /* Check for out of bound iteration on old-style group */
+ skip = (hsize_t)u;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Check for iteration on creation order */
+ /* (should fail) */
+ skip = (hsize_t)0;
+ H5E_BEGIN_TRY {
+ ret = H5Literate1(group_id, H5_INDEX_CRT_ORDER, order, &skip, link_iterate_old_deprec_cb, NULL);
+ } H5E_END_TRY;
+ if(ret >= 0) TEST_ERROR
+
+ /* Test iteration over links in group */
+ if(link_iterate_old_check_deprec(group_id, order, u, &iter_info) < 0) TEST_ERROR
+
+ /* Close the group */
+ if(H5Gclose(group_id) < 0) TEST_ERROR
+
+ /* Close the file */
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ } /* end for */
+
+ /* Free resources */
+ if(visited)
+ HDfree(visited);
+
+ return SUCCEED;
+
+error:
+ /* Free resources */
+ H5E_BEGIN_TRY {
+ H5Gclose(group_id);
+ H5Fclose(file_id);
+ } H5E_END_TRY;
+
+ if(visited)
+ HDfree(visited);
+
+ return FAIL;
+} /* end link_iterate_old_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
*-------------------------------------------------------------------------
*/
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_info2_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)")
@@ -1820,23 +5698,23 @@ external_link_root(hid_t fapl, hbool_t new_format)
if(H5Lcreate_external(filename1, "/", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Check information for external link */
- if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
+ if(H5Lget_info2(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 */
@@ -1844,30 +5722,29 @@ external_link_root(hid_t fapl, hbool_t new_format)
if(H5Lcreate_external(filename1, "///", fid, "ext_link2", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Check information for external link */
- if(H5Lget_info(fid, "ext_link", &linfo, H5P_DEFAULT) < 0) goto error;
+ if(H5Lget_info2(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
@@ -1939,18 +5816,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
*
@@ -1958,24 +5835,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)")
@@ -2047,18 +5917,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
*
@@ -2066,26 +5936,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)")
@@ -2211,44 +6074,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)")
@@ -2309,8 +6165,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
@@ -2334,7 +6190,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
@@ -2359,19 +6214,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
*
@@ -2399,11 +6254,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)")
@@ -2415,7 +6270,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
@@ -2430,7 +6285,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
@@ -2442,7 +6297,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
@@ -2463,7 +6318,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
@@ -2482,18 +6336,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
*
@@ -2521,24 +6375,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)")
@@ -2573,7 +6420,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
@@ -2594,16 +6441,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();
- printf("%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 */
@@ -2626,18 +6473,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
*
@@ -2645,25 +6492,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)")
@@ -2675,7 +6515,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
@@ -2685,26 +6525,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 */
@@ -2712,9 +6552,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 */
@@ -2734,47 +6574,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)")
@@ -2786,16 +6620,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
@@ -2803,7 +6637,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
@@ -2819,9 +6653,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 */
@@ -2829,45 +6663,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)")
@@ -2876,17 +6704,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);
@@ -2913,9 +6741,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 */
@@ -2923,43 +6751,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)")
@@ -2972,14 +6794,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
@@ -2987,7 +6809,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
@@ -2999,9 +6821,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 */
@@ -3009,45 +6831,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)")
@@ -3063,8 +6877,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);
@@ -3091,9 +6905,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 */
@@ -3101,46 +6915,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)")
@@ -3150,19 +6957,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 */
@@ -3173,7 +6980,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
@@ -3187,9 +6993,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 */
@@ -3197,44 +7003,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)")
@@ -3247,14 +7047,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);
@@ -3267,7 +7067,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
@@ -3281,9 +7080,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 */
@@ -3291,42 +7090,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)")
@@ -3336,12 +7129,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 */
@@ -3361,9 +7153,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 */
@@ -3371,45 +7163,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)")
@@ -3421,11 +7207,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 */
@@ -3436,9 +7221,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
@@ -3458,9 +7242,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 */
@@ -3468,62 +7252,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][500];
- 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)")
@@ -3531,20 +7309,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" */
@@ -3557,9 +7334,9 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
HDmemset(memb_addr, 0, sizeof memb_addr);
HDmemset(sv, 0, sizeof sv);
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
- memb_map[mt] = H5FD_MEM_SUPER;
- memb_fapl[mt] = H5P_DEFAULT;
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
+ memb_map[mt] = H5FD_MEM_SUPER;
+ memb_fapl[mt] = H5P_DEFAULT;
} /* end for */
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
@@ -3567,34 +7344,33 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
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');
+ HDsnprintf(sv[H5FD_MEM_SUPER], sizeof(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');
+ HDsnprintf(sv[H5FD_MEM_BTREE], sizeof(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');
+ HDsnprintf(sv[H5FD_MEM_DRAW], sizeof(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');
+ HDsnprintf(sv[H5FD_MEM_GHEAP], sizeof(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');
+ HDsnprintf(sv[H5FD_MEM_LHEAP], sizeof(sv[H5FD_MEM_LHEAP]), "%%s-%c.h5", 'l');
memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP];
memb_addr[H5FD_MEM_LHEAP] = (HADDR_MAX/3)*2;
- sprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o');
+ HDsnprintf(sv[H5FD_MEM_OHDR], sizeof(sv[H5FD_MEM_OHDR]), "%%s-%c.h5", 'o');
memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR];
memb_addr[H5FD_MEM_OHDR] = (HADDR_MAX/6)*5;
/* 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" */
@@ -3618,11 +7394,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
@@ -3633,9 +7407,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 */
@@ -3647,9 +7421,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 */
@@ -3662,92 +7436,110 @@ 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);
+ 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;
+ 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 = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t core_fapl = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t dset = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t dapl_id = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
+ char *filename1 = NULL;
+ char *filename2 = NULL;
+ char *tmpname = NULL;
+ char *cwdpath = NULL;
+ hsize_t dims[2];
+ int **points = NULL;
+ int *points_data = NULL;
+ int i, j, n;
+ h5_stat_size_t filesize;
+ h5_stat_size_t new_filesize;
if(new_format)
TESTING("H5Pset/get_elink_fapl() with same physical layout (w/new group format)")
else
TESTING("H5Pset/get_elink_fapl() with same physical layout")
+ /* Set up file names and paths */
+ if(NULL == (filename1 = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename2 = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (tmpname = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (cwdpath = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+
if((HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST) || (NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE)))
TEST_ERROR
+ /* Set up data array */
+ if(NULL == (points_data = (int *)HDcalloc(NUM40 * NUM40, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (points = (int **)HDcalloc(NUM40, sizeof(points_data))))
+ TEST_ERROR;
+ for (i = 0; i < NUM40; i++)
+ points[i] = points_data + (i * NUM40);
+
/*
* 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);
+ h5_fixname(tmpname, fapl, filename1, NAME_BUF_SIZE);
/* 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" */
- h5_fixname(FILENAME[39], core_fapl, filename2, sizeof filename2);
+ h5_fixname(FILENAME[39], core_fapl, filename2, NAME_BUF_SIZE);
/* Create the target file to be a "core" file */
if((fid = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, core_fapl)) < 0) TEST_ERROR
@@ -3758,12 +7550,16 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if (dcpl_g == H5P_DEFAULT)
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ else
+ dcpl = H5Pcopy(dcpl_g);
+ if (0 > dcpl)
+ TEST_ERROR;
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
@@ -3779,12 +7575,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
@@ -3804,8 +7598,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_data) < 0) TEST_ERROR
if(H5Pclose(dapl_id) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -3818,60 +7611,71 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if(H5Pclose(core_fapl) < 0) TEST_ERROR
+ HDfree(points);
+ HDfree(points_data);
+
+ HDfree(filename1);
+ HDfree(filename2);
+ HDfree(tmpname);
+ HDfree(cwdpath);
+
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;
+
+ HDfree(points);
+ HDfree(points_data);
+
+ HDfree(filename1);
+ HDfree(filename2);
+ HDfree(tmpname);
+ HDfree(cwdpath);
+
+ 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)")
@@ -3880,12 +7684,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
@@ -3926,9 +7728,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);
@@ -3936,10 +7738,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
*
@@ -3947,12 +7749,6 @@ external_set_elink_fapl3(hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Jan. 5, 2009
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -4052,7 +7848,7 @@ external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_fo
if(H5Fclose(file1) < 0) TEST_ERROR
/* Only run this part with VFDs that support SWMR */
- if(H5FD_supports_swmr_test(env_h5_drvr)) {
+ if(H5FD__supports_swmr_test(env_h5_drvr)) {
/* Reopen file1, with read-write and SWMR-write access */
/* Only supported under the latest file format */
@@ -4147,9 +7943,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);
@@ -4157,10 +7953,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
*
@@ -4168,12 +7964,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 */
@@ -4211,7 +8001,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 */
@@ -4220,7 +8010,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];
@@ -4236,7 +8026,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
@@ -4313,9 +8103,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);
@@ -4324,10 +8114,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
*
@@ -4336,12 +8126,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
@@ -4379,47 +8163,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)")
@@ -4432,7 +8210,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]);
@@ -4449,7 +8227,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
@@ -4463,9 +8240,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 */
@@ -4473,46 +8250,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)")
@@ -4522,17 +8293,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 */
@@ -4557,9 +8328,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 */
@@ -4567,46 +8338,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)")
@@ -4616,16 +8381,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();
- sprintf(tmpname, "%c:%s", (drive+'A'-1), FILENAME[32]);
+ 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 */
@@ -4650,9 +8415,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 */
@@ -4660,74 +8425,67 @@ 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();
- sprintf(tmpname, "%c:%s", (drive+'A'-1), FILENAME[13]);
+ HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive+'A'-1), FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
/* set up name for target link: "<drive-letter>:extlinks13" */
- sprintf(tmpname, "%c:%s", (drive+'A'-1), FILENAME[33]);
+ 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
@@ -4739,9 +8497,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 */
@@ -4749,47 +8507,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)")
@@ -4799,6 +8551,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 */
@@ -4806,11 +8562,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" */
- sprintf(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 */
@@ -4821,7 +8577,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
@@ -4835,9 +8590,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 */
@@ -4845,78 +8600,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" */
- sprintf(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
@@ -4928,9 +8680,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 */
@@ -4938,25 +8690,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
@@ -4965,8 +8717,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],
@@ -4984,7 +8736,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]);
@@ -5001,7 +8753,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
@@ -5025,17 +8776,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
*
@@ -5043,7 +8794,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
@@ -5053,9 +8804,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],
@@ -5070,16 +8821,14 @@ 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();
- sprintf(tmpname, "\\\\?\\%c:%s\\%s", (drive+'A'-1), &cwdpath[2], FILENAME[30]);
+ HDsnprintf(tmpname, sizeof(tmpname), "\\\\?\\%c:%s\\%s", (drive+'A'-1), &cwdpath[2], FILENAME[30]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "extlinks10" */
@@ -5093,7 +8842,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
@@ -5108,7 +8856,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;
}
@@ -5117,25 +8865,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
@@ -5144,13 +8892,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)")
@@ -5160,10 +8908,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]);
@@ -5180,7 +8927,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
@@ -5204,19 +8950,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
*
@@ -5224,20 +8970,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)")
@@ -5248,7 +8988,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
@@ -5256,36 +8996,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
*
@@ -5294,26 +9032,20 @@ 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 */
- 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 */
- H5L_info_t li; /* Link information */
- 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 */
+ 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_info2_t oi; /* Object information */
+ H5L_info2_t li; /* Link information */
+ 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)
TESTING("query aspects of external link (w/new group format)")
@@ -5325,26 +9057,26 @@ 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) */
if(H5Lcreate_external(filename2, "///dst//", fid, "src", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Get size of buffer for external link */
- if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(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
@@ -5353,17 +9085,16 @@ 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
/* Get size of buffer for external link */
- if(H5Lget_info(fid, "src", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(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 */
@@ -5377,11 +9108,11 @@ external_link_query(hid_t fapl, hbool_t new_format)
if(HDstrcmp(object_name, "/dst")) TEST_ERROR
/* Query information about object that external link points to */
- if(H5Oget_info_by_name(fid, "src", &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(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 */
@@ -5392,30 +9123,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
*
@@ -5423,19 +9154,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)")
@@ -5465,9 +9192,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
@@ -5490,18 +9214,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
*
@@ -5509,25 +9233,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)")
@@ -5563,7 +9283,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
/* Create enough objects in the root group to change it into a "dense" group */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid2) < 0) TEST_ERROR
} /* end for */
@@ -5592,9 +9312,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
@@ -5606,7 +9323,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
/* Remove enough objects in the root group to change it into a "compact" group */
for(u = 0; u < ((max_compact - min_dense) + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -5636,18 +9353,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
*
@@ -5655,20 +9372,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)")
@@ -5698,9 +9411,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
@@ -5784,7 +9495,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
@@ -5827,18 +9537,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
*
@@ -5847,25 +9557,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)")
@@ -5891,7 +9597,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Create enough objects in the root group to change it into a "dense" group */
for(u = 0; u < (max_compact + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid2) < 0) TEST_ERROR
} /* end for */
@@ -5960,7 +9666,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Remove enough objects in the root group to change it into a "compact" group */
for(u = 0; u < ((max_compact - min_dense) + 3); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(gid, objname, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -6012,19 +9718,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
*
@@ -6033,10 +9739,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Wednesday, August 16, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6046,13 +9748,13 @@ 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 */
- H5L_info_t li;
- H5O_info_t oi;
+ filename3[NAME_BUF_SIZE],
+ filename4[NAME_BUF_SIZE], /* Names of files to externally link across */
+ buf[NAME_BUF_SIZE]; /* misc. buffer */
+ H5L_info2_t li;
+ H5O_info2_t oi;
hobj_ref_t obj_ref;
if(new_format)
@@ -6100,7 +9802,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
/* Test creating each kind of object */
if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close objects */
if(H5Gclose(gid) < 0) TEST_ERROR
@@ -6108,10 +9810,10 @@ external_link_closing(hid_t fapl, hbool_t new_format)
if(H5Dclose(did) < 0) TEST_ERROR
/* Test that getting info works */
- if(H5Lget_info(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(fid1, "elink/elink/elink/type1", &oi, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(fid1, "elink/elink/elink", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid1, "elink/elink/elink/type1", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid1, "elink/elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(fid1, "elink/elink/elink/type1", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(fid1, "elink/elink/elink", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
/* Test move */
if(H5Lmove(fid1, "elink/elink/elink/group1", fid1,
@@ -6198,7 +9900,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
if((gid = H5Gcreate2(fid1, "elink/elink2/group2/group3/group4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Oget_info_by_name(fid1, "elink/elink2/group2/group3/group4", &oi, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(fid1, "elink/elink2/group2/group3/group4", &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
/* Add a few regular groups and a soft link in file2 using intermediate group creation */
if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
@@ -6212,13 +9914,13 @@ external_link_closing(hid_t fapl, hbool_t new_format)
*/
if((gid = H5Gcreate2(fid1, "elink/file2group1/file2group2/slink/group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Lget_info(fid1, "elink/file2group1/file2group2/slink/group3", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid1, "elink/file2group1/file2group2/slink/group3", &li, H5P_DEFAULT) < 0) TEST_ERROR
/* Some simpler tests */
if((gid = H5Gcreate2(fid1, "elink/file2group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Lget_info(fid1, "elink/file2group3", &li, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(fid1, "elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid1, "elink/file2group3", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid1, "elink/elink", &li, H5P_DEFAULT) < 0) TEST_ERROR
/* Close file1, the only file that should still be open */
@@ -6240,7 +9942,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -6254,10 +9956,10 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* external_link_closing() */
-
+
/*-------------------------------------------------------------------------
* Function: ext_link_endian
*
@@ -6267,19 +9969,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)
@@ -6321,18 +10019,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
*
@@ -6341,10 +10039,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, March 5, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6354,7 +10048,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)
@@ -6403,7 +10097,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 {
@@ -6414,10 +10108,10 @@ error:
H5Fclose(fid2);
H5Fclose(fid1);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end external_link_strong() */
-
+
/*-------------------------------------------------------------------------
* Function: external_symlink
*
@@ -6426,29 +10120,32 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Nov. 23, 2009
- *
*-------------------------------------------------------------------------
*/
static int
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];
+ hid_t file1 = H5I_INVALID_HID;
+ hid_t file2 = H5I_INVALID_HID;
+ hid_t file3 = H5I_INVALID_HID;
+ hid_t file4 = H5I_INVALID_HID;
+ hid_t file5 = H5I_INVALID_HID;
+ hid_t group2 = H5I_INVALID_HID;
+ hid_t group3 = H5I_INVALID_HID;
+ hid_t group4 = H5I_INVALID_HID;
+ hid_t group5 = H5I_INVALID_HID;
+ char *filename1 = NULL;
+ char *filename2a = NULL;
+ char *filename2b = NULL;
+ char *filename3a = NULL;
+ char *filename3b = NULL;
+ char *filename4a = NULL;
+ char *filename4b = NULL;
+ char *filename5a = NULL;
+ char *filename5b = NULL;
+ char *tmpname = NULL;
+ char *cwdpath = NULL;
hbool_t have_posix_compat_vfd; /* Whether VFD used is compatible w/POSIX I/O calls */
#endif /* H5_HAVE_SYMLINK */
@@ -6464,155 +10161,183 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
have_posix_compat_vfd = (hbool_t)(!HDstrcmp(env_h5_drvr, "sec2")
|| !HDstrcmp(env_h5_drvr, "core")
|| !HDstrcmp(env_h5_drvr, "nomatch"));
- if(have_posix_compat_vfd) {
- /* set up name for main file: "extlinks21A" */
- h5_fixname(FILENAME[45], fapl, filename1, sizeof(filename1));
-
- /* create tmp 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)
- TEST_ERROR
- if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
- TEST_ERROR
-
- /* Set up names for files in the subdirectories */
-
- /* set up names for file #2 in temporary directory #2: "tmp2/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) */
- if(HDsymlink(filename2b, SYMLINK1) < 0 && errno != EEXIST) TEST_ERROR
+ if(!have_posix_compat_vfd) {
+ SKIPPED();
+ HDputs(" Current VFD doesn't support POSIX I/O calls");
+ return SUCCEED;
+ }
- /* set up name for file #3 in temporary directory #2: "tmp2/extlinks21C" */
- h5_fixname(FILENAME[47], fapl, filename3a, sizeof(filename3a));
- h5_fixname(FILENAME[48], fapl, filename3b, sizeof(filename3b));
+ if(NULL == (filename1 = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename2a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename2b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename3a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename3b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename4a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename4b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename5a = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (filename5b = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (tmpname = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (cwdpath = (char *)HDcalloc(NAME_BUF_SIZE, sizeof(char))))
+ TEST_ERROR;
- /* set up name for file #4 in temporary directory #1: "tmp/extlinks21D" */
- h5_fixname(FILENAME[49], fapl, filename4a, sizeof(filename4a));
- fix_ext_filename(tmpname, cwdpath, FILENAME[49]);
- h5_fixname(tmpname, fapl, filename4b, sizeof(filename4b));
+ /* set up name for main file: "extlinks21A" */
+ h5_fixname(FILENAME[45], fapl, filename1, NAME_BUF_SIZE);
- /* 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) */
- if(HDsymlink(filename4b, SYMLINK2) < 0 && errno != EEXIST) TEST_ERROR
+ /* 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)
+ TEST_ERROR
+ if(NULL == HDgetcwd(cwdpath, (size_t)NAME_BUF_SIZE))
+ TEST_ERROR
- /* set up name for file #5 in temporary directory #1: "tmp/extlinks21E" */
- h5_fixname(FILENAME[50], fapl, filename5a, sizeof(filename5a));
- h5_fixname(FILENAME[51], fapl, filename5b, sizeof(filename5b));
+ /* Set up names for files in the subdirectories */
+ /* set up names for file #2 in temporary directory #2: "tmp2_links/extlinks21B" */
+ h5_fixname(FILENAME[46], fapl, filename2a, NAME_BUF_SIZE);
+ fix_ext_filename(tmpname, cwdpath, FILENAME[46]);
+ h5_fixname(tmpname, fapl, filename2b, NAME_BUF_SIZE);
- /* Create file #1 in current directory */
- if((file1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ /* Create symbolic link #1 in temporary directory #1 to file #2 in temporary directory #2 */
+ /* (i.e. tmp_links/sym1.h5 -> <full path to>/tmp2_links/extlinks21B.h5) */
+ if(HDsymlink(filename2b, SYMLINK1) < 0 && errno != EEXIST) TEST_ERROR
- /* Create external link to file & object in temporary directory #2, using symlink #1 name */
- if(H5Lcreate_external(SYMLINK1, "group2", file1, "extlink2-sym", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ /* set up name for file #3 in temporary directory #2: "tmp2_links/extlinks21C" */
+ h5_fixname(FILENAME[47], fapl, filename3a, NAME_BUF_SIZE);
+ h5_fixname(FILENAME[48], fapl, filename3b, NAME_BUF_SIZE);
- /* Close file #1 */
- if(H5Fclose(file1) < 0) TEST_ERROR
+ /* set up name for file #4 in temporary directory #1: "tmp_links/extlinks21D" */
+ h5_fixname(FILENAME[49], fapl, filename4a, NAME_BUF_SIZE);
+ fix_ext_filename(tmpname, cwdpath, FILENAME[49]);
+ h5_fixname(tmpname, fapl, filename4b, NAME_BUF_SIZE);
+ /* Create symbolic link #2 in temporary directory #2 to file #4 in temporary directory #1 */
+ /* (i.e. tmp2_links/sym2.h5 -> <full path to>/tmp_links/extlinks21D.h5) */
+ if(HDsymlink(filename4b, SYMLINK2) < 0 && errno != EEXIST) TEST_ERROR
- /* Create file #2 in tmp directory #2 */
- if((file2 = H5Fcreate(filename2a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- if(H5Fclose(file2) < 0) TEST_ERROR
+ /* set up name for file #5 in temporary directory #1: "tmp_links/extlinks21E" */
+ h5_fixname(FILENAME[50], fapl, filename5a, NAME_BUF_SIZE);
+ h5_fixname(FILENAME[51], fapl, filename5b, NAME_BUF_SIZE);
- /* Re-open file #2 in tmp directory through symlink */
- if((file2 = H5Fopen(SYMLINK1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ /* Create file #1 in current directory */
+ if((file1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- /* Create group in file #2 in temporary directory */
- if((group2 = H5Gcreate2(file2, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ /* Create external link to file & object in temporary directory #2, using symlink #1 name */
+ if(H5Lcreate_external(SYMLINK1, "group2", file1, "extlink2-sym", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- /* Create external link to file #3 & object in temporary directory #2 */
- if(H5Lcreate_external(filename3b, "group3", group2, "extlink3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ /* Close file #1 */
+ if(H5Fclose(file1) < 0) TEST_ERROR
- /* Close group in file #2 */
- if(H5Gclose(group2) < 0) TEST_ERROR
+ /* 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
- /* Close file #2 */
- if(H5Fclose(file2) < 0) TEST_ERROR
+ /* 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 */
+ if((group2 = H5Gcreate2(file2, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Create file #3 in temp. directory #2 */
- if((file3 = H5Fcreate(filename3a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ /* Create external link to file #3 & object in temporary directory #2 */
+ if(H5Lcreate_external(filename3b, "group3", group2, "extlink3", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- /* Create group in file #3 */
- if((group3 = H5Gcreate2(file3, "group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ /* Close group in file #2 */
+ if(H5Gclose(group2) < 0) TEST_ERROR
- /* Create external link to file & object in temporary directory #1, using symlink #2 name */
- if(H5Lcreate_external(SYMLINK2, "group4", group3, "extlink4-sym", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ /* Close file #2 */
+ if(H5Fclose(file2) < 0) TEST_ERROR
- /* Close group in file #3 */
- if(H5Gclose(group3) < 0) TEST_ERROR
+ /* Create file #3 in temp. directory #2 */
+ if((file3 = H5Fcreate(filename3a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- /* Close file #3 */
- if(H5Fclose(file3) < 0) TEST_ERROR
+ /* Create group in file #3 */
+ if((group3 = H5Gcreate2(file3, "group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ /* Create external link to file & object in temporary directory #1, using symlink #2 name */
+ if(H5Lcreate_external(SYMLINK2, "group4", group3, "extlink4-sym", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- /* Create file #4 in temporary directory #1 */
- if((file4 = H5Fcreate(filename4b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ /* Close group in file #3 */
+ if(H5Gclose(group3) < 0) TEST_ERROR
- /* Create group in file #4 in 'temporary' directory */
- if((group4 = H5Gcreate2(file4, "group4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ /* Close file #3 */
+ if(H5Fclose(file3) < 0) TEST_ERROR
- /* Create external link to file #5 & object in temporary directory #1 */
- if(H5Lcreate_external(filename5b, "group5", group4, "extlink5", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ /* Create file #4 in temporary directory #1 */
+ if((file4 = H5Fcreate(filename4b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- /* Close group in file #4 */
- if(H5Gclose(group4) < 0) TEST_ERROR
+ /* Create group in file #4 in 'temporary' directory */
+ if((group4 = H5Gcreate2(file4, "group4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Close file #4 */
- if(H5Fclose(file4) < 0) TEST_ERROR
+ /* Create external link to file #5 & object in temporary directory #1 */
+ if(H5Lcreate_external(filename5b, "group5", group4, "extlink5", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ /* Close group in file #4 */
+ if(H5Gclose(group4) < 0) TEST_ERROR
- /* Create file #5 in temporary directory #1 */
- if((file5 = H5Fcreate(filename5a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ /* Close file #4 */
+ if(H5Fclose(file4) < 0) TEST_ERROR
- /* Create group in file #5 in 'temporary' directory #1 */
- if((group5 = H5Gcreate2(file5, "group5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gclose(group5) < 0) TEST_ERROR
+ /* Create file #5 in temporary directory #1 */
+ if((file5 = H5Fcreate(filename5a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
- /* Close file #5 */
- if(H5Fclose(file5) < 0) TEST_ERROR
+ /* Create group in file #5 in 'temporary' directory #1 */
+ if((group5 = H5Gcreate2(file5, "group5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group5) < 0) TEST_ERROR
+ /* Close file #5 */
+ if(H5Fclose(file5) < 0) TEST_ERROR
- /* Actual tests... */
+ /* Actual tests... */
- /* Reopen file #1 */
- if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
+ /* Reopen file #1 */
+ if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
- /* Open group in file #2, through external link w/symlink */
- if((group2 = H5Gopen2(file1, "extlink2-sym", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2) < 0) TEST_ERROR
+ /* Open group in file #2, through external link w/symlink */
+ if((group2 = H5Gopen2(file1, "extlink2-sym", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(group2) < 0) TEST_ERROR
- /* Open group in file #3, through external link w/symlink to external link */
- if((group3 = H5Gopen2(file1, "extlink2-sym/extlink3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3) < 0) TEST_ERROR
+ /* Open group in file #3, through external link w/symlink to external link */
+ if((group3 = H5Gopen2(file1, "extlink2-sym/extlink3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(group3) < 0) TEST_ERROR
- /* Open group in file #4, through external link w/symlink to external link w/symlink */
- if((group4 = H5Gopen2(file1, "extlink2-sym/extlink3/extlink4-sym", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4) < 0) TEST_ERROR
+ /* Open group in file #4, through external link w/symlink to external link w/symlink */
+ if((group4 = H5Gopen2(file1, "extlink2-sym/extlink3/extlink4-sym", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(group4) < 0) TEST_ERROR
- /* Open group in file #5, through external link w/symlink to external link w/symlink to external link */
- if((group5 = H5Gopen2(file1, "extlink2-sym/extlink3/extlink4-sym/extlink5", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group5) < 0) TEST_ERROR
+ /* Open group in file #5, through external link w/symlink to external link w/symlink to external link */
+ if((group5 = H5Gopen2(file1, "extlink2-sym/extlink3/extlink4-sym/extlink5", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(group5) < 0) TEST_ERROR
- /* Close file #1 */
- if(H5Fclose(file1) < 0) TEST_ERROR
+ /* Close file #1 */
+ if(H5Fclose(file1) < 0) TEST_ERROR
+ HDfree(filename1);
+ HDfree(filename2a);
+ HDfree(filename2b);
+ HDfree(filename3a);
+ HDfree(filename3b);
+ HDfree(filename4a);
+ HDfree(filename4b);
+ HDfree(filename5a);
+ HDfree(filename5b);
+ HDfree(tmpname);
+ HDfree(cwdpath);
- PASSED();
- } /* end if */
- else {
- SKIPPED();
- HDputs(" Current VFD doesn't support POSIX I/O calls");
- } /* end else */
+ PASSED();
- return 0;
+ return SUCCEED;
- error:
+error:
H5E_BEGIN_TRY {
H5Gclose(group5);
H5Gclose(group4);
@@ -6624,16 +10349,30 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
H5Fclose(file2);
H5Fclose(file1);
} H5E_END_TRY;
- return -1;
+
+ HDfree(filename1);
+ HDfree(filename2a);
+ HDfree(filename2b);
+ HDfree(filename3a);
+ HDfree(filename3b);
+ HDfree(filename4a);
+ HDfree(filename4b);
+ HDfree(filename5a);
+ HDfree(filename5b);
+ HDfree(tmpname);
+ HDfree(cwdpath);
+
+ 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
*
@@ -6644,18 +10383,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)
@@ -6694,7 +10429,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 {
@@ -6703,10 +10438,10 @@ error:
H5Pclose(ocpyplid);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_copy_invalid_object */
-
+
/*-------------------------------------------------------------------------
* Function: external_dont_fail_to_source
*
@@ -6716,18 +10451,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)
@@ -6758,7 +10489,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 {
@@ -6767,10 +10498,10 @@ error:
H5Fclose(fid);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_dont_fail_to_source */
-
+
/*-------------------------------------------------------------------------
* Function: external_file_cache
*
@@ -6780,21 +10511,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];
@@ -6813,333 +10540,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);
@@ -7148,7 +10771,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
H5Pclose(my_fapl);
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -7160,10 +10783,10 @@ error:
H5Pclose(my_fapl);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_file_cache */
-
+
/*-------------------------------------------------------------------------
* Function: external_open_twice
*
@@ -7172,21 +10795,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];
@@ -7199,192 +10818,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,
- H5P_DEFAULT, 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 {
@@ -7396,10 +10946,10 @@ error:
H5Sclose(space);
} H5E_END_TRY
- return -1;
+ return FAIL;
} /* end external_open_twice() */
-
+
/*-------------------------------------------------------------------------
* Function: external_link_with_committed_datatype
*
@@ -7422,24 +10972,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)")
@@ -7450,206 +11000,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 = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- FAIL_STACK_ERROR
- if(H5Pset_chunk(dcpl, 2, chunks) < 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
/* 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 {
@@ -7668,13 +11169,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
*
@@ -7683,10 +11184,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
/* Callback functions for UD hard links. */
@@ -7695,19 +11192,19 @@ static herr_t
UD_hard_create(const char H5_ATTR_UNUSED * link_name, hid_t loc_group, const void *udata,
size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id)
{
- haddr_t addr;
+ H5O_token_t token;
hid_t target_obj = -1;
herr_t ret_value = 0;
- if(udata_size != sizeof(haddr_t)) {
+ if(udata_size != sizeof(H5O_token_t)) {
ret_value = -1;
goto done;
} /* end if */
- addr = *((const haddr_t *)udata);
+ token = *(const H5O_token_t *)udata;
/* Open the object this link points to */
- target_obj= H5Oopen_by_addr(loc_group, addr);
+ target_obj = H5Oopen_by_token(loc_group, token);
if(target_obj < 0) {
ret_value = -1;
goto done;
@@ -7738,21 +11235,25 @@ 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:
case H5I_DATASPACE:
case H5I_ATTR:
- case H5I_REFERENCE:
case H5I_VFL:
+ case H5I_VOL:
case H5I_GENPROP_CLS:
case H5I_GENPROP_LST:
case H5I_ERROR_CLASS:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
+ case H5I_SPACE_SEL_ITER:
case H5I_NTYPES:
default:
- return -1;
+ return FAIL;
} /* end switch */
} /* end if */
@@ -7762,17 +11263,19 @@ done:
/* Traverse a hard link by opening the object */
static hid_t
UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
- const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id)
+ const void *udata, size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id,
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
- haddr_t addr;
+ H5O_token_t token;
hid_t ret_value = -1;
- if(udata_size != sizeof(haddr_t))
- return -1;
+ if(udata_size != sizeof(H5O_token_t))
+ return FAIL;
- addr = *((const haddr_t *) udata);
+ token = *(const H5O_token_t *)udata;
- ret_value = H5Oopen_by_addr(cur_group, addr); /* If this fails, our return value will be negative. */
+ /* If this fails, our return value will be negative. */
+ ret_value = H5Oopen_by_token(cur_group, token);
return ret_value;
} /* end UD_hard_traverse() */
@@ -7782,19 +11285,19 @@ static herr_t
UD_hard_delete(const char H5_ATTR_UNUSED * link_name, hid_t file, const void *udata,
size_t udata_size)
{
- haddr_t addr;
+ H5O_token_t token;
hid_t target_obj = -1;
herr_t ret_value = 0;
- if(udata_size != sizeof(haddr_t)) {
+ if(udata_size != sizeof(H5O_token_t)) {
ret_value = -1;
goto done;
} /* end if */
- addr = *((const haddr_t *) udata);
+ token = *(const H5O_token_t *)udata;
/* Open the object this link points to */
- target_obj= H5Oopen_by_addr(file, addr);
+ target_obj = H5Oopen_by_token(file, token);
if(target_obj < 0) {
ret_value = -1;
goto done;
@@ -7825,48 +11328,40 @@ 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:
case H5I_DATASPACE:
case H5I_ATTR:
- case H5I_REFERENCE:
case H5I_VFL:
+ case H5I_VOL:
case H5I_GENPROP_CLS:
case H5I_GENPROP_LST:
case H5I_ERROR_CLASS:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
+ case H5I_SPACE_SEL_ITER:
case H5I_NTYPES:
default:
- return -1;
+ return FAIL;
} /* end switch */
} /* end if */
return ret_value;
} /* end UD_hard_delete() */
-const H5L_class_t UD_hard_class[1] = {{
- H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
- (H5L_type_t)UD_HARD_TYPE, /* Link type id number */
- "UD_hard_link", /* Link class name for debugging */
- UD_hard_create, /* Creation callback */
- NULL, /* Move/rename callback */
- NULL, /* Copy callback */
- UD_hard_traverse, /* The actual traversal function */
- UD_hard_delete, /* Deletion callback */
- NULL /* Query callback */
-}};
-
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_info2_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)")
@@ -7896,14 +11391,13 @@ ud_hard_links(hid_t fapl)
if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get address for the group to give to the hard link */
- if(H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
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
+ * from H5Lget_info2 */
+ if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_HARD_TYPE, &(li.u.token), sizeof(H5O_token_t), H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Close and re-open file to ensure that data is written to disk */
if(H5Fclose(fid) < 0) TEST_ERROR
@@ -7934,13 +11428,13 @@ ud_hard_links(hid_t fapl)
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
/* Check that H5Lget_objinfo works on the hard link */
- if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lget_info2(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* 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
@@ -7967,18 +11461,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
*
@@ -7987,18 +11481,15 @@ 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
+/* A traversal function that ignores any udata and simply opens an object
* in the current group named REREG_TARGET_NAME
*/
static hid_t
UD_rereg_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group,
- const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id)
+ const void H5_ATTR_UNUSED *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id,
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
hid_t ret_value;
@@ -8007,43 +11498,29 @@ 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
- * has a very different traversal function */
-const H5L_class_t UD_rereg_class[1] = {{
- H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
- (H5L_type_t)UD_HARD_TYPE, /* Link type id number */
- "UD_reregistered_type", /* Link class name for debugging */
- NULL, /* Creation callback */
- NULL, /* Move/rename callback */
- NULL, /* Copy callback */
- UD_rereg_traverse, /* The actual traversal function */
- NULL, /* Deletion callback */
- NULL /* Query callback */
-}};
-
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_info2_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
@@ -8058,11 +11535,11 @@ ud_link_reregister(hid_t fapl)
/* Point a UD defined hard link to a group in the same way as the previous test */
if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if (H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Gclose(gid) < 0) TEST_ERROR
- if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_HARD_TYPE, &(li.u.address),
- sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_HARD_TYPE, &(li.u.token),
+ sizeof(H5O_token_t), H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR
/* Create a group named REREG_TARGET_NAME in the same group as the ud link */
@@ -8082,9 +11559,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),
- sizeof(li.u.address), H5P_DEFAULT, H5P_DEFAULT) >= 0)
- TEST_ERROR
+ if(H5Lcreate_ud(fid, "ud_link2", (H5L_type_t)UD_HARD_TYPE, &(li.u.token),
+ sizeof(H5O_token_t), H5P_DEFAULT, H5P_DEFAULT) >= 0)
+ TEST_ERROR
} H5E_END_TRY
/* Register a new kind of link with the same ID number */
@@ -8152,30 +11629,26 @@ 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
+ * Function: UD_cb_create
*
* Purpose: Check that all callbacks are called and are given the correct
* information.
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
/* Callback functions for UD "callback" links. */
@@ -8193,15 +11666,15 @@ 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
UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata,
- size_t udata_size, hid_t lapl_id)
+ size_t udata_size, hid_t lapl_id, hid_t H5_ATTR_UNUSED dxpl_id)
{
const char *target = (const char *)udata;
hid_t ret_value;
@@ -8220,7 +11693,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 */
@@ -8236,10 +11709,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 */
@@ -8255,10 +11728,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 */
@@ -8282,30 +11755,18 @@ 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] = {{
- H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
- (H5L_type_t)UD_CB_TYPE, /* Link type id number */
- NULL, /* NULL name (to make sure this doesn't break anything */
- UD_cb_create, /* Creation callback */
- UD_cb_move, /* Move/rename callback */
- UD_cb_move, /* Copy callback */
- UD_cb_traverse, /* The actual traversal function */
- UD_cb_delete, /* Deletion callback */
- UD_cb_query /* Query callback */
-}};
-
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_info2_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)
@@ -8328,8 +11789,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 */
@@ -8349,12 +11809,12 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
if(H5Gclose(gid) < 0) TEST_ERROR
/* Query the link to test its query callback */
- if (H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.u.val_size != 16) TEST_ERROR
if (UD_CB_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;
}
/* Fill the query buffer */
@@ -8371,7 +11831,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
@@ -8382,7 +11841,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
if(H5Pclose(lcpl) < 0) FAIL_STACK_ERROR
/* Check its character encoding */
- if(H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lget_info2(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(li.cset != H5T_CSET_UTF8) TEST_ERROR
/* Unregister the link class so the library forgets what its callbacks do */
@@ -8398,7 +11857,7 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
} H5E_END_TRY
/* The query callback should NOT fail, but should be unable to give a linklen */
- if(H5Lget_info(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lget_info2(fid, UD_CB_LINK_NAME, &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(li.u.val_size != 0) TEST_ERROR
if(li.type != UD_CB_TYPE) TEST_ERROR
@@ -8409,18 +11868,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
*
@@ -8429,15 +11888,12 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Tuesday, June 6, 2006
- *
*-------------------------------------------------------------------------
*/
static hid_t
UD_plist_traverse(const char H5_ATTR_UNUSED * link_name, hid_t cur_group,
- const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id)
+ const void H5_ATTR_UNUSED *udata, size_t udata_size, hid_t lapl_id,
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
char target[NAME_BUF_SIZE];
hid_t ret_value;
@@ -8447,36 +11903,23 @@ 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] = {{
- H5L_LINK_CLASS_T_VERS, /* H5L_class_t version */
- (H5L_type_t)UD_PLIST_TYPE, /* Link type id number */
- "UD_plist_link", /* Link class name for debugging */
- NULL, /* Creation callback */
- NULL, /* Move/rename callback */
- NULL, /* Copy callback */
- UD_plist_traverse, /* The actual traversal function */
- NULL, /* Deletion callback */
- NULL /* Query callback */
-}};
-
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)")
@@ -8547,19 +11990,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
*
@@ -8568,10 +12011,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
@@ -8579,15 +12018,15 @@ 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
UD_cbsucc_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group,
- const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id)
+ const void *udata, size_t H5_ATTR_UNUSED udata_size, hid_t lapl_id,
+ hid_t H5_ATTR_UNUSED dxpl_id)
{
const char *target = (const char *)udata;
hid_t ret_value;
@@ -8599,7 +12038,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 */
@@ -8608,7 +12047,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 */
@@ -8617,7 +12056,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 */
@@ -8626,7 +12065,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 */
@@ -8636,7 +12075,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 */
@@ -8645,7 +12084,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 */
@@ -8658,10 +12097,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 */
@@ -8768,12 +12206,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];
+ 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 */
+ H5L_info2_t li; /* Link information */
if(new_format)
TESTING("user-defined link error conditions (w/new group format)")
@@ -8786,10 +12224,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. */
@@ -8804,12 +12242,15 @@ 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
+ } H5E_END_TRY;
+
/* Create a user-defined link to the group. */
strcpy(group_name, "/group");
if(H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -8835,7 +12276,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
if(H5Ldelete(fid, "ud_link", H5P_DEFAULT) >= 0) TEST_ERROR
/* The query callback will fail */
- if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) >=0) TEST_ERROR
+ if(H5Lget_info2(fid, "ud_link", &li, H5P_DEFAULT) >=0) TEST_ERROR
} H5E_END_TRY
/* Now use a class with different callback functions */
@@ -8848,7 +12289,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
if(H5Lcopy(fid, "ud_link", fid, "copy_succ", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* The query callback will succeed when we only want to get the size of the buffer... */
- if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lget_info2(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(li.u.val_size != 0) TEST_ERROR
/* ...but fail when we try to write data to the buffer itself*/
H5E_BEGIN_TRY {
@@ -8859,7 +12300,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
if(H5Lregister(UD_cbfail_class3) < 0) FAIL_STACK_ERROR
/* Now querying should succeed */
- if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lget_info2(fid, "ud_link", &li, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(li.u.val_size != 8) TEST_ERROR
if(H5Lget_val(fid, "ud_link", query_buf, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(HDstrcmp(query_buf, "succeed") != 0) TEST_ERROR
@@ -8875,17 +12316,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
*
@@ -8893,28 +12334,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)")
@@ -8929,7 +12363,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
@@ -8958,7 +12392,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 */
@@ -9000,9 +12434,9 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
gid = H5Oopen(fid, "soft5", plist);
} 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 lesser soft link */
@@ -9012,7 +12446,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
@@ -9033,9 +12466,9 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* H5Ldelete */
if(H5Ldelete(fid, "soft17/soft_link", plist) < 0) TEST_ERROR
- /* H5Lget_val and H5Lget_info */
+ /* H5Lget_val and H5Lget_info2 */
if(H5Lget_val(fid, "soft17", NULL, (size_t)0, plist) < 0) TEST_ERROR
- if(H5Lget_info(fid, "soft17", NULL, plist) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "soft17", NULL, plist) < 0) TEST_ERROR
/* H5Lcreate_external and H5Lcreate_ud */
if(H5Lcreate_external("filename", "path", fid, "soft17/extlink", H5P_DEFAULT, plist) < 0) TEST_ERROR
@@ -9045,7 +12478,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
@@ -9054,7 +12486,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
dims[0] = 2;
dims[1] = 2;
if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
- if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
/* Close group */
@@ -9104,25 +12536,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);
+ 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;
+ return FAIL;
} /* end lapl_nlinks() */
-
+
/*-------------------------------------------------------------------------
* Function: linkinfo
*
@@ -9130,21 +12562,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_info2_t li; /* Link information */
+ char filename[NAME_BUF_SIZE];
if(new_format)
TESTING("link type field in H5Lget_info (w/new group format)")
@@ -9166,7 +12594,7 @@ linkinfo(hid_t fapl, hbool_t new_format)
if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
- if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Lcreate_ud(fid, "ud_link", (H5L_type_t)UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -9177,39 +12605,39 @@ linkinfo(hid_t fapl, hbool_t new_format)
if(H5Dclose(did) < 0) TEST_ERROR
/* Make sure that link type is correct when objects are queried */
- if(H5Lget_info(fid, "datatype", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "datatype", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.type != H5L_TYPE_HARD) TEST_ERROR
- if(H5Lget_info(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "group", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.type != H5L_TYPE_HARD) TEST_ERROR
- if(H5Lget_info(fid, "dataset", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "dataset", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.type != H5L_TYPE_HARD) TEST_ERROR
- if(H5Lget_info(fid, "ext_link", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "ext_link", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.type != H5L_TYPE_EXTERNAL) TEST_ERROR
- if(H5Lget_info(fid, "softlink", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "softlink", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.type != H5L_TYPE_SOFT) TEST_ERROR
- if(H5Lget_info(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "ud_link", &li, H5P_DEFAULT) < 0) TEST_ERROR
if(li.type != UD_PLIST_TYPE) TEST_ERROR
/* Ensure that passing a NULL pointer doesn't cause an error */
- if(H5Lget_info(fid, "group", NULL, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid, "group", NULL, H5P_DEFAULT) < 0) TEST_ERROR
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
*
@@ -9222,10 +12650,6 @@ linkinfo(hid_t fapl, hbool_t new_format)
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: James Laird
- * Thursday, August 17, 2006
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9245,8 +12669,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
@@ -9254,17 +12677,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
*
@@ -9272,10 +12693,6 @@ error:
*
* Return: Success: >0, File ID for file built
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, November 24, 2007
- *
*-------------------------------------------------------------------------
*/
static hid_t
@@ -9283,9 +12700,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 */
@@ -9304,7 +12721,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
@@ -9312,7 +12728,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
@@ -9331,13 +12746,13 @@ build_visit_file(hid_t fapl)
/* Create dataset in each group */
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
- if((did = H5Dcreate2(fid, "/Dataset_zero", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid, "/Dataset_zero", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- if((did = H5Dcreate2(fid, "/Group1/Dataset_one", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid, "/Group1/Dataset_one", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- if((did = H5Dcreate2(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid, "/Group1/Group2/Dataset_two", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -9361,10 +12776,10 @@ error:
H5E_BEGIN_TRY {
H5Fclose(fid);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end build_visit_file() */
-
+
/*-------------------------------------------------------------------------
* Function: visit_link_cb
*
@@ -9372,15 +12787,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_info2_t *linfo, void *_op_data)
{
lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data;
@@ -9394,7 +12804,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
*
@@ -9402,10 +12812,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
@@ -9426,45 +12832,43 @@ link_visit(hid_t fapl, hbool_t new_format)
/* Visit all the links reachable from the root group (with file ID) */
udata.idx = 0;
udata.info = lvisit0;
- if(H5Lvisit(fid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit2(fid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
/* Visit all the links reachable from the root group (with group ID) */
if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = lvisit0;
- if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit2(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;
udata.info = lvisit1;
- if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit2(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, "/Group1/Group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = lvisit2;
- if(H5Lvisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit2(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
*
@@ -9472,10 +12876,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Saturday, November 24, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9496,53 +12896,51 @@ link_visit_by_name(hid_t fapl, hbool_t new_format)
/* Visit all the links reachable from the root group (with file ID) */
udata.idx = 0;
udata.info = lvisit0;
- if(H5Lvisit_by_name(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit_by_name2(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Visit all the links reachable from the root group (with group ID) */
if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = lvisit0;
- if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit_by_name2(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;
- if(H5Lvisit_by_name(fid, "/Group1", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit_by_name2(fid, "/Group1", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, "/Group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = lvisit1;
- if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit_by_name2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = lvisit2;
- if(H5Lvisit_by_name(fid, "/Group1/Group2", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit_by_name2(fid, "/Group1/Group2", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, "/Group1/Group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = lvisit2;
- if(H5Lvisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_link_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lvisit_by_name2(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
*
@@ -9550,15 +12948,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_info2_t *oinfo, void *_op_data)
{
ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data;
@@ -9572,7 +12965,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
*
@@ -9580,10 +12973,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
@@ -9604,45 +12993,43 @@ obj_visit(hid_t fapl, hbool_t new_format)
/* Visit all the objects reachable from the root group (with file ID) */
udata.idx = 0;
udata.info = new_format ? ovisit0_new : ovisit0_old;
- if(H5Ovisit(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit3(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR
/* Visit all the objects reachable from the root group (with group ID) */
if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = new_format ? ovisit0_new : ovisit0_old;
- if(H5Ovisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit3(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;
udata.info = new_format ? ovisit1_new : ovisit1_old;
- if(H5Ovisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit3(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
if((gid = H5Gopen2(fid, "/Group1/Group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = new_format ? ovisit2_new : ovisit2_old;
- if(H5Ovisit(gid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit3(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
*
@@ -9650,10 +13037,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 25, 2007
- *
*-------------------------------------------------------------------------
*/
static int
@@ -9674,69 +13057,61 @@ obj_visit_by_name(hid_t fapl, hbool_t new_format)
/* Visit all the objects reachable from the root group (with file ID) */
udata.idx = 0;
udata.info = new_format ? ovisit0_new : ovisit0_old;
- if(H5Ovisit_by_name(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit_by_name3(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Visit all the objects reachable from the root group (with group ID) */
if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = new_format ? ovisit0_new : ovisit0_old;
- if(H5Ovisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit_by_name3(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;
- if(H5Ovisit_by_name(fid, "/Group1", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit_by_name3(fid, "/Group1", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, "/Group1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = new_format ? ovisit1_new : ovisit1_old;
- if(H5Ovisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit_by_name3(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_name(fid, "/Group1/Group2", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit_by_name3(fid, "/Group1/Group2", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((gid = H5Gopen2(fid, "/Group1/Group2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
udata.idx = 0;
udata.info = new_format ? ovisit2_new : ovisit2_old;
- if(H5Ovisit_by_name(gid, ".", H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, &udata, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Ovisit_by_name3(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_info2_t H5_ATTR_UNUSED *oinfo, void *_op_data)
{
unsigned *op_data = (unsigned *)_op_data;
@@ -9746,7 +13121,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
*
@@ -9755,10 +13130,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
@@ -9780,15 +13151,15 @@ obj_visit_stop(hid_t fapl, hbool_t new_format)
* returns H5_ITER_STOP
*/
nvisited = 0;
- if((ret = H5Ovisit(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_stop_cb, &nvisited)) < 0)
+ if((ret = H5Ovisit3(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_stop_cb, &nvisited, H5O_INFO_BASIC)) < 0)
FAIL_STACK_ERROR
if(ret != H5_ITER_STOP) TEST_ERROR
if(nvisited != 1) TEST_ERROR
/* Same test with H5Ovisit_by_name */
nvisited = 0;
- if((ret = H5Ovisit_by_name(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_obj_stop_cb,
- &nvisited, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((ret = H5Ovisit_by_name3(fid, "/", H5_INDEX_NAME, H5_ITER_INC, visit_obj_stop_cb,
+ &nvisited, H5O_INFO_BASIC, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(ret != H5_ITER_STOP) TEST_ERROR
if(nvisited != 1) TEST_ERROR
@@ -9796,16 +13167,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
*
@@ -9814,10 +13185,6 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Tuesday, June 16, 2009
- *
*-------------------------------------------------------------------------
*/
static enum {
@@ -9830,14 +13197,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;
@@ -9846,14 +13210,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;
@@ -9864,19 +13225,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 */
@@ -9897,7 +13255,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;
@@ -9915,8 +13273,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
@@ -9944,8 +13301,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 */
@@ -9953,14 +13309,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
@@ -9984,12 +13336,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 */
@@ -10018,10 +13368,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
@@ -10032,34 +13380,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
@@ -10085,8 +13426,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
@@ -10114,7 +13454,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 */
@@ -10128,8 +13467,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)
@@ -10147,8 +13485,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)
@@ -10161,16 +13498,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 {
@@ -10182,10 +13517,10 @@ error:
H5Pclose(gcpl2);
H5Pclose(fcpl);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end link_filters() */
-
+
/*-------------------------------------------------------------------------
* Function: obj_exists
*
@@ -10193,19 +13528,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)")
@@ -10215,8 +13546,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 */
@@ -10226,13 +13556,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 {
@@ -10240,240 +13568,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
*
@@ -10481,19 +13774,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 */
@@ -10515,9 +13804,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 */
@@ -10542,7 +13831,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
@@ -10569,7 +13857,7 @@ corder_create_empty(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10577,10 +13865,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_create_empty() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_create_compact
*
@@ -10589,21 +13877,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 */
@@ -10633,7 +13917,7 @@ corder_create_compact(hid_t fapl)
/* Create several links, but keep group in compact form */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10653,7 +13937,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
@@ -10669,11 +13952,11 @@ corder_create_compact(hid_t fapl)
/* Loop through links, checking their creation order values */
/* (the name index is used, but the creation order value is in the same order) */
for(u = 0; u < max_compact; u++) {
- H5L_info_t linfo; /* Link information */
+ H5L_info2_t linfo; /* Link information */
/* Retrieve information for link */
- sprintf(objname, "filler %u", u);
- if(H5Lget_info(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ if(H5Lget_info2(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify creation order of link */
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -10687,7 +13970,7 @@ corder_create_compact(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10695,10 +13978,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_create_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_create_dense
*
@@ -10707,21 +13990,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 */
@@ -10753,7 +14032,7 @@ corder_create_dense(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10765,7 +14044,7 @@ corder_create_dense(hid_t fapl)
} /* end for */
/* Create another link, to push group into dense form */
- sprintf(objname, "filler %u", max_compact);
+ HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10787,7 +14066,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
@@ -10802,11 +14080,11 @@ corder_create_dense(hid_t fapl)
/* Loop through links, checking their creation order values */
/* (the name index is used, but the creation order value is in the same order) */
for(u = 0; u < (max_compact + 1); u++) {
- H5L_info_t linfo; /* Link information */
+ H5L_info2_t linfo; /* Link information */
/* Retrieve information for link */
- sprintf(objname, "filler %u", u);
- if(H5Lget_info(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ if(H5Lget_info2(group_id, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify creation order of link */
if(linfo.corder_valid != TRUE) TEST_ERROR
@@ -10820,7 +14098,7 @@ corder_create_dense(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -10828,10 +14106,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_create_dense() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_transition
*
@@ -10840,25 +14118,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 */
@@ -10898,7 +14172,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
@@ -10907,13 +14180,13 @@ corder_transition(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end for */
/* Create another link, to push group into dense form */
- sprintf(objname, "filler %u", max_compact);
+ HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -10928,7 +14201,7 @@ corder_transition(hid_t fapl)
/* Delete several links from group, until it resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -10942,7 +14215,7 @@ corder_transition(hid_t fapl)
} /* end for */
/* Delete another link, to push group into compact form */
- sprintf(objname, "filler %u", (min_dense - 1));
+ HDsnprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -10953,7 +14226,7 @@ corder_transition(hid_t fapl)
/* Re-add links to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end for */
@@ -10973,7 +14246,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
@@ -10991,7 +14263,7 @@ corder_transition(hid_t fapl)
/* Delete several links from group, until it resumes compact form */
for(u = max_compact; u >= min_dense; u--) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -11005,7 +14277,7 @@ corder_transition(hid_t fapl)
} /* end for */
/* Delete another link, to push group into compact form */
- sprintf(objname, "filler %u", (min_dense - 1));
+ HDsnprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Verify state of group */
@@ -11016,7 +14288,7 @@ corder_transition(hid_t fapl)
/* Re-add links to get back into dense form */
for(u = (min_dense - 1); u < (max_compact + 1); u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end for */
@@ -11032,10 +14304,10 @@ corder_transition(hid_t fapl)
/* Delete all the links */
for(u = max_compact; u > 0; u--) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
} /* end for */
- sprintf(objname, "filler %u", (unsigned)0);
+ HDsnprintf(objname, sizeof(objname), "filler %u", (unsigned)0);
if(H5Ldelete(group_id, objname, H5P_DEFAULT) < 0) TEST_ERROR
/* Close the group */
@@ -11049,7 +14321,7 @@ corder_transition(hid_t fapl)
if(file_size != empty_size) TEST_ERROR
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11057,10 +14329,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end corder_transition() */
-
+
/*-------------------------------------------------------------------------
* Function: corder_delete
*
@@ -11070,25 +14342,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 */
@@ -11101,7 +14369,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 */
@@ -11135,7 +14403,7 @@ corder_delete(hid_t fapl)
/* Create links until the group is in dense form */
for(u = 0; u < max_compact * 2; u++) {
- sprintf(objname, "filler %u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %u", u);
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Gclose(group_id2) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -11178,7 +14446,7 @@ corder_delete(hid_t fapl)
} /* end for */
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11186,25 +14454,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
@@ -11214,19 +14478,19 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n,
char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
char valname[NAME_BUF_SIZE]; /* Link value name */
char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
- H5L_info_t linfo; /* Link info struct */
+ H5L_info2_t linfo; /* Link info struct */
/* Make link value for increasing/native order queries */
- sprintf(valname, "value %02u", (unsigned)n);
+ HDsnprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
/* Verify the link information for first link, in increasing creation order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != 0) TEST_ERROR
/* Verify the link information for new link, in increasing creation order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != (int64_t)n) TEST_ERROR
/* Verify value for new soft link, in increasing creation order */
@@ -11248,12 +14512,12 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n,
if(use_index) {
/* Verify the link information for first link, in native creation order (which is increasing) */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != 0) TEST_ERROR
/* Verify the link information for new link, in native creation order (which is increasing) */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != (int64_t)n) TEST_ERROR
/* Verify value for new soft link, in native creation order (which is increasing) */
@@ -11271,12 +14535,12 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n,
/* Verify the link information for first link, in decreasing creation order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != 0) TEST_ERROR
/* Verify the link information for new link, in decreasing creation order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != (int64_t)n) TEST_ERROR
/* Verify value for new soft link, in decreasing creation order */
@@ -11294,12 +14558,12 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n,
/* Verify the link information for first link, in increasing link name order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != 0) TEST_ERROR
/* Verify the link information for new link, in increasing link name order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != (int64_t)n) TEST_ERROR
/* Verify value for new soft link, in increasing link name order */
@@ -11320,12 +14584,12 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n,
/* Verify the link information for first link, in decreasing link name order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, n, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != 0) TEST_ERROR
/* Verify the link information for new link, in decreasing link name order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.corder != (int64_t)n) TEST_ERROR
/* Verify value for new soft link, in decreasing link name order */
@@ -11348,7 +14612,7 @@ error:
return(-1);
} /* end link_info_by_idx_check() */
-
+
/*-------------------------------------------------------------------------
* Function: link_info_by_idx
*
@@ -11357,23 +14621,19 @@ 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 */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5L_info_t linfo; /* Link info struct */
+ H5L_info2_t linfo; /* Link info struct */
char objname[NAME_BUF_SIZE]; /* Object name */
char valname[NAME_BUF_SIZE]; /* Link value name */
char filename[NAME_BUF_SIZE];/* File name */
@@ -11417,7 +14677,7 @@ link_info_by_idx(hid_t fapl)
/* Check for query on empty group */
H5E_BEGIN_TRY {
- ret = H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT);
+ ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &linfo, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
H5E_BEGIN_TRY {
@@ -11428,11 +14688,11 @@ link_info_by_idx(hid_t fapl)
/* Create several links, up to limit of compact form */
for(u = 0; u < max_compact; u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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
@@ -11440,7 +14700,7 @@ link_info_by_idx(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11455,11 +14715,11 @@ link_info_by_idx(hid_t fapl)
/* Check for out of bound offset queries */
H5E_BEGIN_TRY {
- ret = H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
H5E_BEGIN_TRY {
@@ -11470,11 +14730,11 @@ link_info_by_idx(hid_t fapl)
/* Create more links, to push group into dense form */
for(; u < (max_compact * 2); u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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
@@ -11482,7 +14742,7 @@ link_info_by_idx(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11497,11 +14757,11 @@ link_info_by_idx(hid_t fapl)
/* Check for out of bound offset queries */
H5E_BEGIN_TRY {
- ret = H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
H5E_BEGIN_TRY {
@@ -11522,7 +14782,7 @@ link_info_by_idx(hid_t fapl)
} /* end for */
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -11530,10 +14790,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
*
@@ -11542,28 +14802,27 @@ 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 */
- unsigned hard_link; /* Create hard or soft link? */
- H5L_info_t linfo; /* Link info struct */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value name */
- char filename[NAME_BUF_SIZE];/* File name */
- haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
- unsigned u; /* Local index variable */
- ssize_t name_len; /* Length of name */
- herr_t ret; /* Generic return value */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ H5F_t *f = NULL;
+ unsigned hard_link; /* Create hard or soft link? */
+ H5L_info2_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ H5O_token_t objtoken[CORDER_NLINKS];/* Tokens (Addresses) of the objects created */
+ void *vol_obj_file = NULL; /* Object of file_id */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
+ unsigned u; /* Local index variable */
+ ssize_t name_len; /* Length of name */
+ int token_cmp;
+ herr_t ret; /* Generic return value */
/* Loop over creating hard or soft links */
for(hard_link = FALSE; hard_link <= TRUE; hard_link++) {
@@ -11576,31 +14835,38 @@ link_info_by_idx_old(hid_t fapl)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ /* Need the file struct to address encoding */
+ /* Retrieve VOL object */
+ if(NULL == (vol_obj_file = H5VL_vol_object(file_id))) TEST_ERROR
+ /* Retrieve file from VOL object */
+ if(NULL == (f = (H5F_t *)H5VL_object_data((const H5VL_object_t *)vol_obj_file))) TEST_ERROR
+
/* Create group to operate on */
if((group_id = H5Gcreate2(file_id, CORDER_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if(hard_link) {
- H5O_info_t oi; /* Buffer for querying object's info */
+ H5O_info2_t oi; /* Buffer for querying object's info */
/* Create group */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
- objno[u] = oi.addr;
+ /* Retrieve group's object token */
+ if(H5Oget_info3(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+
+ HDmemcpy(&objtoken[u], &oi.token, sizeof(H5O_token_t));
/* Close group */
if(H5Gclose(group_id2) < 0) TEST_ERROR
} /* end if */
else {
/* Make value for link */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if(H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11612,15 +14878,16 @@ link_info_by_idx_old(hid_t fapl)
unsigned dec_u = CORDER_NLINKS - (u + 1); /* Decreasing mapped index */
/* Make link name for increasing/native order queries */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Make link value for increasing/native order queries */
- sprintf(valname, "value %02u", u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", u);
/* Verify link information (in increasing order) */
if(hard_link) {
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5F_addr_ne(linfo.u.address, objno[u])) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11634,8 +14901,9 @@ link_info_by_idx_old(hid_t fapl)
/* Verify link information (in native order - native is increasing) */
if(hard_link) {
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5F_addr_ne(linfo.u.address, objno[u])) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11648,15 +14916,16 @@ link_info_by_idx_old(hid_t fapl)
/* Make link name for decreasing order queries */
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
/* Make link value for decreasing order queries */
- sprintf(valname, "value %02u", dec_u);
+ HDsnprintf(valname, sizeof(valname), "value %02u", dec_u);
/* Verify link information (in decreasing order) */
if(hard_link) {
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[dec_u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
if(H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
@@ -11670,7 +14939,7 @@ link_info_by_idx_old(hid_t fapl)
/* Check for creation order index queries */
H5E_BEGIN_TRY {
- ret = H5Lget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
+ ret = H5Lget_info_by_idx2(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &linfo, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
H5E_BEGIN_TRY {
@@ -11690,17 +14959,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
*
@@ -11709,24 +14978,20 @@ 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 */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5L_info_t linfo; /* Link info struct */
+ H5L_info2_t linfo; /* Link info struct */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];/* File name */
char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
@@ -11734,9 +14999,9 @@ delete_by_idx(hid_t fapl)
herr_t ret; /* Generic return value */
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -11785,10 +15050,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);
@@ -11803,10 +15066,10 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11832,7 +15095,7 @@ delete_by_idx(hid_t fapl)
/* Verify the link information for first link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
if(linfo.corder != (u + 1)) TEST_ERROR
} /* end if */
@@ -11844,9 +15107,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", (u + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- sprintf(objname, "filler %02u", (max_compact - (u + 2)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11858,10 +15121,10 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11888,7 +15151,7 @@ delete_by_idx(hid_t fapl)
/* Verify the link information for first link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
if(linfo.corder != (u + 1)) TEST_ERROR
} /* end if */
@@ -11900,9 +15163,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", (u + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- sprintf(objname, "filler %02u", ((max_compact * 2) - (u + 2)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11919,16 +15182,14 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -11949,7 +15210,7 @@ delete_by_idx(hid_t fapl)
/* Verify the link information for current link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", idx_type, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
if(linfo.corder != ((u * 2) + 1)) TEST_ERROR
} /* end if */
@@ -11961,9 +15222,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 2)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 2)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11974,7 +15235,7 @@ delete_by_idx(hid_t fapl)
/* Verify the link information for first link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", idx_type, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
if(linfo.corder != ((u * 2) + 3)) TEST_ERROR
} /* end if */
@@ -11986,9 +15247,9 @@ delete_by_idx(hid_t fapl)
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", idx_type, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 3));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- sprintf(objname, "filler %02u", ((max_compact * 2) - ((u * 2) + 4)));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - ((u * 2) + 4)));
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -11999,8 +15260,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
@@ -12015,7 +15274,7 @@ delete_by_idx(hid_t fapl)
} /* end for */
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -12023,10 +15282,10 @@ error:
H5Gclose(group_id);
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end delete_by_idx() */
-
+
/*-------------------------------------------------------------------------
* Function: delete_by_idx_old
*
@@ -12035,28 +15294,27 @@ 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 */
- H5L_info_t linfo; /* Link info struct */
- H5_iter_order_t order; /* Order within in the index */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE];/* File name */
- haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = -1; /* File ID */
+ hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ H5F_t *f = NULL;
+ H5L_info2_t linfo; /* Link info struct */
+ H5_iter_order_t order; /* Order within in the index */
+ void *vol_obj_file = NULL; /* Object of file_id */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE];/* File name */
+ H5O_token_t objtoken[CORDER_NLINKS];/* Tokens (Addresses) of the objects created */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ int token_cmp;
+ herr_t ret; /* Generic return value */
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_DEC; order++) {
/* Print test banner */
if(order == H5_ITER_INC)
TESTING("deleting links by index in increasing order in old-style group")
@@ -12067,13 +15325,17 @@ delete_by_idx_old(hid_t fapl)
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ /* Need the file struct to address encoding */
+ /* Retrieve VOL object */
+ if(NULL == (vol_obj_file = H5VL_vol_object(file_id))) TEST_ERROR
+ /* Retrieve file from VOL object */
+ if(NULL == (f = (H5F_t *)H5VL_object_data((const H5VL_object_t *)vol_obj_file))) TEST_ERROR
+
/* 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);
@@ -12082,17 +15344,18 @@ delete_by_idx_old(hid_t fapl)
/* Create several links */
for(u = 0; u < CORDER_NLINKS; u++) {
- H5O_info_t oi; /* Buffer for querying object's info */
+ H5O_info2_t oi; /* Buffer for querying object's info */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
- objno[u] = oi.addr;
+ /* Retrieve group's object token */
+ if(H5Oget_info3(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+
+ HDmemcpy(&objtoken[u], &oi.token, sizeof(H5O_token_t));
/* Close group */
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -12119,21 +15382,23 @@ delete_by_idx_old(hid_t fapl)
/* Verify the link information for first link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
- if(H5F_addr_ne(linfo.u.address, objno[u + 1])) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[u + 1], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
- if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[dec_u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end else */
/* Verify the name for first link in appropriate order */
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", (u + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12149,23 +15414,22 @@ 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 */
+ H5O_info2_t oi; /* Buffer for querying object's info */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* Retrieve group's address on disk */
- if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
- objno[u] = oi.addr;
+ /* Retrieve group's object token */
+ if(H5Oget_info3(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+
+ HDmemcpy(&objtoken[u], &oi.token, sizeof(H5O_token_t));
/* Close group */
if(H5Gclose(group_id2) < 0) TEST_ERROR
@@ -12180,21 +15444,23 @@ delete_by_idx_old(hid_t fapl)
/* Verify the link information for current link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
- if(H5F_addr_ne(linfo.u.address, objno[(u * 2) + 1])) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[(u * 2) + 1], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
- if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[dec_u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end else */
/* Verify the name for current link in appropriate order */
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 1));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12207,21 +15473,23 @@ delete_by_idx_old(hid_t fapl)
/* Verify the link information for first link in appropriate order */
HDmemset(&linfo, 0, sizeof(linfo));
- if(H5Lget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info_by_idx2(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC) {
- if(H5F_addr_ne(linfo.u.address, objno[(u * 2) + 3])) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[(u * 2) + 3], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
- if(H5F_addr_ne(linfo.u.address, objno[dec_u])) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &linfo.u.token, &objtoken[dec_u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end else */
/* Verify the name for first link in appropriate order */
HDmemset(tmpname, 0, (size_t)NAME_BUF_SIZE);
if(H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, tmpname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
if(order == H5_ITER_INC)
- sprintf(objname, "filler %02u", ((u * 2) + 3));
+ HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- sprintf(objname, "filler %02u", dec_u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
if(HDstrcmp(objname, tmpname)) TEST_ERROR
} /* end for */
@@ -12240,7 +15508,7 @@ delete_by_idx_old(hid_t fapl)
PASSED();
} /* end for */
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -12248,10 +15516,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end delete_by_idx_old() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_cb
*
@@ -12259,58 +15527,58 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Monday, November 20, 2006
- *
*-------------------------------------------------------------------------
*/
static int
-link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info_t *info,
+link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info2_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_info2_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);
+ if(H5Lget_info2(group_id, link_name, &my_info, H5P_DEFAULT) < 0)
+ return H5_ITER_ERROR;
/* Check more things for link iteration (vs. group iteration) */
if(info) {
+ int token_cmp;
+
/* Check for correct order of iteration */
/* (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);
- if(H5F_addr_ne(info->u.address, my_info.u.address))
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
+ if(H5Otoken_cmp(group_id, &info->u.token, &my_info.u.token, &token_cmp) < 0)
+ return H5_ITER_ERROR;
+ if(token_cmp)
+ return H5_ITER_ERROR;
} /* end if */
/* Verify name of link */
- sprintf(objname, "filler %02u", (unsigned)my_info.corder);
+ 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 */
@@ -12322,13 +15590,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
*
@@ -12337,20 +15605,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
*
@@ -12359,20 +15623,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)
+ const H5L_info2_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
*
@@ -12380,10 +15640,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
@@ -12404,14 +15660,13 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
- if(H5Literate(group_id, idx_type, order, &skip, link_iterate_cb, iter_info) < 0) TEST_ERROR
+ if(H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, iter_info) < 0) TEST_ERROR
/* Verify that we visited all the links */
if(skip != max_links) TEST_ERROR
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);
@@ -12428,7 +15683,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;
@@ -12436,7 +15690,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
iter_info->ncalled = 0;
iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
- if(H5Literate(group_id, idx_type, order, &skip, link_iterate_cb, iter_info) < 0) TEST_ERROR
+ if(H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, iter_info) < 0) TEST_ERROR
/* Verify that we visited all the links */
if(skip != max_links) TEST_ERROR
@@ -12459,7 +15713,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));
@@ -12492,7 +15745,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;
@@ -12500,11 +15752,10 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order,
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
- if((ret = H5Literate(group_id, idx_type, order, &skip, link_iterate_cb, iter_info)) < 0) TEST_ERROR
+ if((ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, iter_info)) < 0) TEST_ERROR
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);
@@ -12518,22 +15769,21 @@ 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 {
- ret = H5Literate(group_id, idx_type, order, &skip, link_iterate_fail_cb, NULL);
+ ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_fail_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
/* Success */
- return(0);
+ return SUCCEED;
error:
- return(-1);
+ return FAIL;
} /* end link_iterate_check() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate
*
@@ -12551,9 +15801,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 */
@@ -12579,9 +15829,9 @@ link_iterate(hid_t fapl)
iter_info.visited = visited;
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -12638,17 +15888,16 @@ 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
+ if(H5Literate2(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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12661,20 +15910,19 @@ link_iterate(hid_t fapl)
/* Check for out of bound iteration on compact group */
skip = (hsize_t)u;
H5E_BEGIN_TRY {
- ret = H5Literate(group_id, idx_type, order, &skip, link_iterate_cb, NULL);
+ ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
/* 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12687,7 +15935,7 @@ link_iterate(hid_t fapl)
/* Check for out of bound iteration on dense group */
skip = (hsize_t)u;
H5E_BEGIN_TRY {
- ret = H5Literate(group_id, idx_type, order, &skip, link_iterate_cb, NULL);
+ ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
@@ -12713,7 +15961,7 @@ link_iterate(hid_t fapl)
if(visited)
HDfree(visited);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -12726,10 +15974,10 @@ error:
if(visited)
HDfree(visited);
- return -1;
+ return FAIL;
} /* end link_iterate() */
-
+
/*-------------------------------------------------------------------------
* Function: link_iterate_old_cb
*
@@ -12737,52 +15985,51 @@ 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_info2_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_info2_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);
+ if(H5Lget_info2(group_id, link_name, &my_info, H5P_DEFAULT) < 0)
+ return H5_ITER_ERROR;
/* Check more things for link iteration (vs. group iteration) */
if(info) {
+ int token_cmp;
+
/* 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);
- if(H5F_addr_ne(info->u.address, my_info.u.address))
- return(H5_ITER_ERROR);
+ return H5_ITER_ERROR;
+ if(H5Otoken_cmp(group_id, &info->u.token, &my_info.u.token, &token_cmp) < 0)
+ return H5_ITER_ERROR;
+ if(token_cmp)
+ return H5_ITER_ERROR;
} /* end if */
/* Verify name of link */
- sprintf(objname, "filler %02u", (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
+ 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 */
@@ -12794,13 +16041,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
*
@@ -12809,20 +16056,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
*
@@ -12830,15 +16073,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 */
@@ -12854,14 +16092,13 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
- if(H5Literate(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info) < 0) TEST_ERROR
+ if(H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info) < 0) TEST_ERROR
/* Verify that we visited all the links */
if(skip != max_links) TEST_ERROR
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);
@@ -12878,7 +16115,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;
@@ -12886,7 +16122,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
iter_info->ncalled = 0;
iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
- if(H5Literate(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info) < 0) TEST_ERROR
+ if(H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info) < 0) TEST_ERROR
/* Verify that we visited all the links */
if(skip != max_links) TEST_ERROR
@@ -12909,7 +16145,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));
@@ -12942,7 +16177,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;
@@ -12950,11 +16184,10 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order,
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
HDmemset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
- if((ret = H5Literate(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info)) < 0) TEST_ERROR
+ if((ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info)) < 0) TEST_ERROR
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);
@@ -12968,18 +16201,17 @@ 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 {
- ret = H5Literate(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
+ ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
/* Check for iteration w/bad location ID */
skip = 0;
H5E_BEGIN_TRY {
- ret = H5Literate((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
+ ret = H5Literate2((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
@@ -12991,13 +16223,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
*
@@ -13005,17 +16237,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 */
@@ -13031,7 +16259,7 @@ link_iterate_old(hid_t fapl)
iter_info.visited = visited;
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
/* Print appropriate test message */
if(order == H5_ITER_INC) {
TESTING("iterating over links by name index in increasing order in old-style group")
@@ -13051,17 +16279,16 @@ 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
+ if(H5Literate2(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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13074,7 +16301,7 @@ link_iterate_old(hid_t fapl)
/* Check for out of bound iteration on old-style group */
skip = (hsize_t)u;
H5E_BEGIN_TRY {
- ret = H5Literate(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, NULL);
+ ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
@@ -13082,14 +16309,13 @@ link_iterate_old(hid_t fapl)
/* (should fail) */
skip = (hsize_t)0;
H5E_BEGIN_TRY {
- ret = H5Literate(group_id, H5_INDEX_CRT_ORDER, order, &skip, link_iterate_old_cb, NULL);
+ ret = H5Literate2(group_id, H5_INDEX_CRT_ORDER, order, &skip, link_iterate_old_cb, NULL);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
/* 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
@@ -13103,7 +16329,7 @@ link_iterate_old(hid_t fapl)
if(visited)
HDfree(visited);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13115,10 +16341,10 @@ error:
if(visited)
HDfree(visited);
- return -1;
+ return FAIL;
} /* end link_iterate_old() */
-
+
/*-------------------------------------------------------------------------
* Function: open_by_idx_check
*
@@ -13126,24 +16352,20 @@ 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, H5O_token_t *objno)
{
char mntname[NAME_BUF_SIZE]; /* Link value */
- 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 group_id = -1; /* ID of group to test */
+ H5O_info2_t oi; /* Buffer for querying object's info */
+ H5O_token_t mnt_root_token; /* Token (address) of root group in file to mount */
hid_t obj_id; /* ID of object opened */
unsigned mnt_idx; /* Index to mount group on */
unsigned u, v; /* Local index variables */
+ int token_cmp;
/* Work through main & soft link groups */
for(v = 0; v < 2; v++) {
@@ -13159,16 +16381,18 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
if((obj_id = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get the object's information */
- if(H5Oget_info(obj_id, &oi) < 0) TEST_ERROR
+ if(H5Oget_info3(obj_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
/* Check that the object is the correct one */
if(order == H5_ITER_INC) {
- if(H5F_addr_ne(oi.addr, objno[u])) TEST_ERROR
+ if(H5Otoken_cmp(obj_id, &oi.token, &objno[u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else if(order == H5_ITER_DEC) {
unsigned dec_u = max_links - (u + 1); /* Decreasing mapped index */
- if(H5F_addr_ne(oi.addr, objno[dec_u])) TEST_ERROR
+ if(H5Otoken_cmp(obj_id, &oi.token, &objno[dec_u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
} /* end if */
else {
/* XXX: What to do about native order? */
@@ -13179,29 +16403,29 @@ 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_info(mount_file_id, &oi) < 0) TEST_ERROR
- mnt_root_addr = oi.addr;
+ if(H5Oget_info3(mount_file_id, &oi, H5O_INFO_BASIC) < 0)
+ TEST_ERROR
+ HDmemcpy(&mnt_root_token, &oi.token, sizeof(mnt_root_token));
/* Mount a file over a group in main group */
mnt_idx = 2;
- sprintf(mntname, "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
+ HDsnprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
if(H5Fmount(main_group_id, mntname, mount_file_id, H5P_DEFAULT) < 0) TEST_ERROR
/* Open the object that the file is mounted on */
if((obj_id = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)mnt_idx, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get the object's information */
- if(H5Oget_info(obj_id, &oi) < 0) TEST_ERROR
+ if(H5Oget_info3(obj_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
/* Check that the object is the root of the mounted file and not in the previous file */
- if(H5F_addr_ne(oi.addr, mnt_root_addr)) TEST_ERROR
- if(H5F_addr_eq(oi.addr, objno[mnt_idx])) TEST_ERROR
+ if(H5Otoken_cmp(obj_id, &oi.token, &mnt_root_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
+ if(H5Otoken_cmp(obj_id, &oi.token, &objno[mnt_idx], &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
/* Close object */
if(H5Oclose(obj_id) < 0) TEST_ERROR
@@ -13209,15 +16433,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
*
@@ -13226,30 +16449,26 @@ 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 */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5O_info_t oi; /* Buffer for querying object's info */
+ H5O_info2_t oi; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
- haddr_t *objno = NULL; /* Addresses of the objects created */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */
unsigned u; /* Local index variable */
hid_t ret; /* Generic return value */
@@ -13259,17 +16478,17 @@ open_by_idx(hid_t fapl)
/* Query the group creation properties */
if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
- /* Allocate object address array */
- if(NULL == (objno = (haddr_t *)HDmalloc(sizeof(haddr_t) * (max_compact * 2)))) TEST_ERROR
+ /* Allocate object token array */
+ if(NULL == (objno = (H5O_token_t *)HDmalloc(sizeof(H5O_token_t) * (max_compact * 2)))) TEST_ERROR
/* Create file to mount */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((mount_file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <= H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -13329,35 +16548,33 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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 address on disk */
- if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
- objno[u] = oi.addr;
+ if(H5Oget_info3(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oi.token;
/* Close group created */
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
- } /* end for */
+ }
/* Verify state of group (compact) */
if(H5G__has_links_test(group_id, NULL) != TRUE) TEST_ERROR
@@ -13371,26 +16588,25 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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 address on disk */
- if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
- objno[u] = oi.addr;
+ if(H5Oget_info3(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oi.token;
/* Close group created */
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
} /* end for */
@@ -13406,7 +16622,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
@@ -13429,7 +16644,7 @@ open_by_idx(hid_t fapl)
if(objno)
HDfree(objno);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13444,10 +16659,104 @@ error:
if(objno)
HDfree(objno);
- return -1;
+ return FAIL;
} /* end open_by_idx() */
-
+
+/*-------------------------------------------------------------------------
+ * Function: open_by_idx_check_old
+ *
+ * Purpose: Check opening by index in a group
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+open_by_idx_check_old(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, H5O_token_t *objno)
+{
+ char mntname[NAME_BUF_SIZE]; /* Link value */
+ hid_t group_id = -1; /* ID of group to test */
+ H5O_info2_t oi; /* Buffer for querying object's info */
+ H5O_token_t mnt_root_token; /* Token of root group in file to mount */
+ hid_t obj_id; /* ID of object opened */
+ unsigned mnt_idx; /* Index to mount group on */
+ unsigned u, v; /* Local index variables */
+ int cmp_value; /* Token comparison value */
+
+ /* Work through main & soft link groups */
+ for(v = 0; v < 2; v++) {
+ /* Choose appropriate group to open links within */
+ if(0 == v)
+ group_id = main_group_id;
+ else
+ group_id = soft_group_id;
+
+ /* Open each object in main group by index and check that it's the correct one */
+ for(u = 0; u < max_links; u++) {
+ /* Open the object */
+ if((obj_id = H5Oopen_by_idx(group_id, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Get the object's information */
+ if(H5Oget_info3(obj_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+
+ /* Check that the object is the correct one */
+ if(order == H5_ITER_INC) {
+ if(H5Otoken_cmp(group_id, &oi.token, &objno[u], &cmp_value) < 0) TEST_ERROR
+ if(0 != cmp_value) TEST_ERROR
+ } /* end if */
+ else if(order == H5_ITER_DEC) {
+ unsigned dec_u = max_links - (u + 1); /* Decreasing mapped index */
+
+ if(H5Otoken_cmp(group_id, &oi.token, &objno[dec_u], &cmp_value) < 0) TEST_ERROR
+ if(0 != cmp_value) TEST_ERROR
+ } /* end if */
+ else {
+ /* XXX: What to do about native order? */
+ } /* end else */
+
+ /* Close object */
+ if(H5Oclose(obj_id) < 0) TEST_ERROR
+ } /* end for */
+ } /* end for */
+
+ /* 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_info3(mount_file_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ mnt_root_token = oi.token;
+
+ /* Mount a file over a group in main group */
+ mnt_idx = 2;
+ HDsnprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
+ if(H5Fmount(main_group_id, mntname, mount_file_id, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Open the object that the file is mounted on */
+ if((obj_id = H5Oopen_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)mnt_idx, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Get the object's information */
+ if(H5Oget_info3(obj_id, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+
+ /* Check that the object is the root of the mounted file and not in the previous file */
+ if(H5Otoken_cmp(group_id, &oi.token, &mnt_root_token, &cmp_value) < 0) TEST_ERROR
+ if(0 != cmp_value) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &oi.token, &objno[mnt_idx], &cmp_value) < 0) TEST_ERROR
+ if(0 == cmp_value) TEST_ERROR
+
+ /* Close object */
+ if(H5Oclose(obj_id) < 0) TEST_ERROR
+
+ /* Unmount the file */
+ if(H5Funmount(main_group_id, mntname) < 0) TEST_ERROR
+
+ /* Success */
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end open_by_idx_check_old() */
+
/*-------------------------------------------------------------------------
* Function: open_by_idx_old
*
@@ -13456,25 +16765,21 @@ 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 */
+ H5O_info2_t oi; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
- haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */
unsigned u; /* Local index variable */
hid_t ret; /* Generic return value */
@@ -13483,7 +16788,7 @@ open_by_idx_old(hid_t fapl)
if((mount_file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
/* Print appropriate test message */
if(order == H5_ITER_INC) {
TESTING("open object by name index in increasing order in old-style group")
@@ -13513,26 +16818,25 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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 address on disk */
- if(H5Oget_info(group_id2, &oi) < 0) TEST_ERROR
- objno[u] = oi.addr;
+ if(H5Oget_info3(group_id2, &oi, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oi.token;
/* Close group created */
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
} /* end for */
@@ -13552,8 +16856,7 @@ open_by_idx_old(hid_t fapl)
if(ret >= 0) TEST_ERROR
/* 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
-
+ if(open_by_idx_check_old(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
@@ -13568,7 +16871,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 */
@@ -13579,10 +16882,10 @@ error:
H5Fclose(mount_file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end open_by_idx_old() */
-
+
/*-------------------------------------------------------------------------
* Function: object_info_check
*
@@ -13590,20 +16893,17 @@ error:
*
* Return: Success: 0
* Failure: -1
- *
- * Programmer: Quincey Koziol
- * Sunday, November 26, 2006
- *
*-------------------------------------------------------------------------
*/
static int
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)
+ H5_iter_order_t order, unsigned max_links, H5O_token_t *objno)
{
char objname[NAME_BUF_SIZE]; /* Object name */
- hid_t group_id = (-1); /* ID of group to test */
- H5O_info_t oinfo; /* Buffer for querying object's info */
+ hid_t group_id = -1; /* ID of group to test */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
unsigned u, v; /* Local index variables */
+ int token_cmp;
/* Work through main & soft link groups */
for(v = 0; v < 2; v++) {
@@ -13616,28 +16916,31 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
/* Open each object in group by name and check that it's the correct one */
for(u = 0; u < max_links; u++) {
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* Query the object's information, by name */
- if(H5Oget_info_by_name(group_id, objname, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(group_id, objname, &oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS, H5P_DEFAULT) < 0) TEST_ERROR
/* Check that the object is the correct one */
- if(H5F_addr_ne(oinfo.addr, objno[u])) TEST_ERROR
- if(H5F_addr_ne(oinfo.num_attrs, u)) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &oinfo.token, &objno[u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
+ if(oinfo.num_attrs != u) TEST_ERROR
/* Query the object's information, by index */
- if(H5Oget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_idx3(group_id, ".", idx_type, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS, H5P_DEFAULT) < 0) TEST_ERROR
/* Check that the object is the correct one */
if(order == H5_ITER_INC) {
- if(H5F_addr_ne(oinfo.addr, objno[u])) TEST_ERROR
- if(H5F_addr_ne(oinfo.num_attrs, u)) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &oinfo.token, &objno[u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
+ if(oinfo.num_attrs != u) TEST_ERROR
} /* end if */
else if(order == H5_ITER_DEC) {
unsigned dec_u = max_links - (u + 1); /* Decreasing mapped index */
- if(H5F_addr_ne(oinfo.addr, objno[dec_u])) TEST_ERROR
- if(H5F_addr_ne(oinfo.num_attrs, dec_u)) TEST_ERROR
+ if(H5Otoken_cmp(group_id, &oinfo.token, &objno[dec_u], &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
+ if(oinfo.num_attrs != dec_u) TEST_ERROR
} /* end if */
else {
/* XXX: What to do about native order? */
@@ -13647,13 +16950,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
*
@@ -13662,31 +16965,27 @@ 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 */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5O_info_t oinfo; /* Buffer for querying object's info */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
char attrname[NAME_BUF_SIZE]; /* Attribute name */
- haddr_t *objno = NULL; /* Addresses of the objects created */
+ H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */
herr_t ret; /* Generic return value */
unsigned u, v; /* Local index variables */
@@ -13696,16 +16995,16 @@ object_info(hid_t fapl)
/* Query the group creation properties */
if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
- /* Allocate object address array */
- if(NULL == (objno = (haddr_t *)HDmalloc(sizeof(haddr_t) * (max_compact * 2)))) TEST_ERROR
+ /* Allocate object token array */
+ if(NULL == (objno = (H5O_token_t *)HDmalloc(sizeof(H5O_token_t) * (max_compact * 2)))) TEST_ERROR
/* Create dataspace for attributes */
if((space_id = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -13768,29 +17067,29 @@ object_info(hid_t fapl)
/* Check for out of bound query by index on empty group */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5O_INFO_BASIC, 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 */
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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 address on disk */
- if(H5Oget_info(group_id2, &oinfo) < 0) TEST_ERROR
- objno[u] = oinfo.addr;
+ if(H5Oget_info3(group_id2, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oinfo.token;
/* Create attributes on new object */
for(v = 0; v < u; v++) {
/* Make name for attribute */
- sprintf(attrname, "attr %02u", v);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13803,7 +17102,7 @@ object_info(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
} /* end for */
@@ -13812,7 +17111,7 @@ object_info(hid_t fapl)
/* Check for out of bound query by index */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
@@ -13822,23 +17121,23 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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 address on disk */
- if(H5Oget_info(group_id2, &oinfo) < 0) TEST_ERROR
- objno[u] = oinfo.addr;
+ if(H5Oget_info3(group_id2, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oinfo.token;
/* Create attributes on new object */
for(v = 0; v < u; v++) {
/* Make name for attribute */
- sprintf(attrname, "attr %02u", v);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13851,7 +17150,7 @@ object_info(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
} /* end for */
@@ -13860,7 +17159,7 @@ object_info(hid_t fapl)
/* Check for out of bound query by index */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
@@ -13886,7 +17185,7 @@ object_info(hid_t fapl)
if(objno)
HDfree(objno);
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -13901,37 +17200,104 @@ error:
if(objno)
HDfree(objno);
- return -1;
+ return FAIL;
} /* end object_info() */
-
+
/*-------------------------------------------------------------------------
- * Function: object_info_old
+ * Function: object_info_check_old
*
- * Purpose: Create an old-style group test querying object info.
+ * Purpose: Check querying object info in a group
*
* Return: Success: 0
* Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+object_info_check_old(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
+ H5_iter_order_t order, unsigned max_links, H5O_token_t *objno)
+{
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t group_id = -1; /* ID of group to test */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
+ unsigned u, v; /* Local index variables */
+
+ /* Work through main & soft link groups */
+ for(v = 0; v < 2; v++) {
+ /* Choose appropriate group to open links within */
+ if(0 == v)
+ group_id = main_group_id;
+ else
+ group_id = soft_group_id;
+
+ /* Open each object in group by name and check that it's the correct one */
+ for(u = 0; u < max_links; u++) {
+ int cmp_value; /* Token comparison value */
+
+ /* Make name for link */
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+
+ /* Query the object's information, by name */
+ if(H5Oget_info_by_name3(group_id, objname, &oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check that the object is the correct one */
+ if(H5Otoken_cmp(group_id, &oinfo.token, &objno[u], &cmp_value) < 0) TEST_ERROR
+ if(0 != cmp_value) TEST_ERROR
+ if(oinfo.num_attrs != u) TEST_ERROR
+
+ /* Query the object's information, by index */
+ if(H5Oget_info_by_idx3(group_id, ".", idx_type, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check that the object is the correct one */
+ if(order == H5_ITER_INC) {
+ if(H5Otoken_cmp(group_id, &oinfo.token, &objno[u], &cmp_value) < 0) TEST_ERROR
+ if(0 != cmp_value) TEST_ERROR
+ if(oinfo.num_attrs != u) TEST_ERROR
+ }
+ else if(order == H5_ITER_DEC) {
+ unsigned dec_u = max_links - (u + 1); /* Decreasing mapped index */
+
+ if(H5Otoken_cmp(group_id, &oinfo.token, &objno[dec_u], &cmp_value) < 0) TEST_ERROR
+ if(0 != cmp_value) TEST_ERROR
+ if(oinfo.num_attrs != dec_u) TEST_ERROR
+ }
+ else {
+ /* XXX: What to do about native order? */
+ }
+
+ } /* end for */
+ } /* end for */
+
+ /* Success */
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end object_info_check_old() */
+
+/*-------------------------------------------------------------------------
+ * Function: object_info_old
*
- * Programmer: Quincey Koziol
- * Sunday, November 26, 2006
+ * Purpose: Create an old-style group test querying object info.
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
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 */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
char attrname[NAME_BUF_SIZE]; /* Attribute name */
- haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
+ H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */
herr_t ret; /* Generic return value */
unsigned u, v; /* Local index variables */
@@ -13939,7 +17305,8 @@ object_info_old(hid_t fapl)
if((space_id = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
+
/* Print appropriate test message */
if(order == H5_ITER_INC) {
TESTING("query object info by name index in increasing order in old-style group")
@@ -13962,32 +17329,31 @@ 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_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} 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 */
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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 address on disk */
- if(H5Oget_info(group_id2, &oinfo) < 0) TEST_ERROR
- objno[u] = oinfo.addr;
+ if(H5Oget_info3(group_id2, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ objno[u] = oinfo.token;
/* Create attributes on new object */
for(v = 0; v < u; v++) {
/* Make name for attribute */
- sprintf(attrname, "attr %02u", v);
+ HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14000,7 +17366,7 @@ object_info_old(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
/* Create soft link in another group, to objects in main group */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
} /* end for */
@@ -14009,19 +17375,18 @@ object_info_old(hid_t fapl)
/* Check for out of bound query by index */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_NAME, order, (hsize_t)u, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
/* Check for creation order index query */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)(u - 1), &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(group_id, ".", H5_INDEX_CRT_ORDER, order, (hsize_t)(u - 1), &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(ret >= 0) TEST_ERROR
/* Verify querying objects by name */
- if(object_info_check(group_id, soft_group_id, H5_INDEX_NAME, order, u, objno) < 0) TEST_ERROR
-
+ if(object_info_check_old(group_id, soft_group_id, H5_INDEX_NAME, order, u, objno) < 0) TEST_ERROR
/* Close the groups */
if(H5Gclose(group_id) < 0) TEST_ERROR
@@ -14036,7 +17401,7 @@ object_info_old(hid_t fapl)
/* Free resources */
if(H5Sclose(space_id) < 0) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14047,10 +17412,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end object_info_old() */
-
+
/*-------------------------------------------------------------------------
* Function: group_info
*
@@ -14059,20 +17424,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 */
@@ -14081,7 +17442,7 @@ group_info(hid_t fapl)
char filename[NAME_BUF_SIZE];/* File name */
char objname[NAME_BUF_SIZE]; /* Object name */
char objname2[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
herr_t ret; /* Generic return value */
unsigned u, v; /* Local index variables */
@@ -14092,9 +17453,9 @@ group_info(hid_t fapl)
if(H5Pget_link_phase_change(gcpl_id, &max_compact, &min_dense) < 0) TEST_ERROR
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -14154,7 +17515,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);
@@ -14163,15 +17523,14 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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
@@ -14196,11 +17555,10 @@ 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 */
- sprintf(objname2, "filler %02u", v);
+ HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14209,7 +17567,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
@@ -14234,7 +17591,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) {
@@ -14253,7 +17609,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
@@ -14278,9 +17633,8 @@ 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 */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
/* Retrieve soft link group's information, by name */
@@ -14301,18 +17655,16 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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
@@ -14337,11 +17689,10 @@ 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 */
- sprintf(objname2, "filler %02u", v);
+ HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14350,7 +17701,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
@@ -14375,7 +17725,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) {
@@ -14394,7 +17743,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
@@ -14419,9 +17767,8 @@ 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 */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
/* Retrieve soft link group's information, by name */
@@ -14442,7 +17789,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
@@ -14458,7 +17804,7 @@ group_info(hid_t fapl)
/* Free resources */
if(H5Pclose(gcpl_id) < 0) TEST_ERROR
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14469,10 +17815,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end group_info() */
-
+
/*-------------------------------------------------------------------------
* Function: group_info_old
*
@@ -14481,29 +17827,25 @@ 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 */
char objname[NAME_BUF_SIZE]; /* Object name */
char objname2[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
herr_t ret; /* Generic return value */
unsigned u, v; /* Local index variables */
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <=H5_ITER_NATIVE; order++) {
if(order == H5_ITER_INC) {
TESTING("query group info by name index in increasing order in old-style group")
} /* end if */
@@ -14525,7 +17867,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);
@@ -14534,15 +17875,14 @@ 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 */
- sprintf(objname, "filler %02u", u);
+ HDsnprintf(objname, sizeof(objname), "filler %02u", u);
/* 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
@@ -14567,11 +17907,10 @@ 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 */
- sprintf(objname2, "filler %02u", v);
+ HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -14580,7 +17919,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
@@ -14605,7 +17943,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) {
@@ -14624,7 +17961,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
@@ -14649,9 +17985,8 @@ 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 */
- sprintf(valname, "/%s/%s", CORDER_GROUP_NAME, objname);
+ 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
/* Retrieve soft link group's information, by name */
@@ -14678,7 +18013,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
@@ -14689,7 +18023,7 @@ group_info_old(hid_t fapl)
PASSED();
} /* end for */
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14699,10 +18033,10 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end group_info_old() */
-
+
/*-------------------------------------------------------------------------
* Function: timestamps
*
@@ -14711,21 +18045,18 @@ 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 */
- H5O_info_t oinfo, oinfo2; /* Object info for groups created */
+ 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_info2_t oinfo, oinfo2; /* Object info for groups created */
+ H5O_native_info_t ninfo, ninfo2; /* Native info for groups created */
char filename[NAME_BUF_SIZE];/* File name */
hbool_t track_times; /* The object timestamp setting */
@@ -14750,7 +18081,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
@@ -14775,10 +18105,15 @@ timestamps(hid_t fapl)
if(track_times != TRUE) TEST_ERROR
/* Query the object information for each group */
- if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR
- if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR
+ /* Generic info */
+ if(H5Oget_info3(group_id, &oinfo, H5O_INFO_TIME) < 0) TEST_ERROR
+ if(H5Oget_info3(group_id2, &oinfo2, H5O_INFO_TIME) < 0) TEST_ERROR
+ /* Native file format info */
+ if(H5Oget_native_info(group_id, &ninfo, H5O_NATIVE_INFO_HDR) < 0) TEST_ERROR
+ if(H5Oget_native_info(group_id2, &ninfo2, H5O_NATIVE_INFO_HDR) < 0) TEST_ERROR
/* Sanity check object information for each group */
+ /* Generic info */
if(oinfo.atime != 0) TEST_ERROR
if(oinfo.mtime != 0) TEST_ERROR
if(oinfo.ctime != 0) TEST_ERROR
@@ -14787,10 +18122,11 @@ timestamps(hid_t fapl)
if(oinfo.mtime == oinfo2.mtime) TEST_ERROR
if(oinfo.ctime == oinfo2.ctime) TEST_ERROR
if(oinfo.btime == oinfo2.btime) TEST_ERROR
- if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR
- if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR
- if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR
- if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR
+ /* Native file format info */
+ if((ninfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR
+ if((ninfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR
+ if(ninfo.hdr.space.total >= ninfo2.hdr.space.total) TEST_ERROR
+ if(ninfo.hdr.space.meta >= ninfo2.hdr.space.meta) TEST_ERROR
/* Close the property lists */
if(H5Pclose(gcpl_id) < 0) TEST_ERROR
@@ -14803,7 +18139,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
@@ -14822,10 +18157,14 @@ timestamps(hid_t fapl)
if(track_times != TRUE) TEST_ERROR
/* Query the object information for each group */
- if(H5Oget_info(group_id, &oinfo) < 0) TEST_ERROR
- if(H5Oget_info(group_id2, &oinfo2) < 0) TEST_ERROR
+ if(H5Oget_info3(group_id, &oinfo, H5O_INFO_TIME) < 0) TEST_ERROR
+ if(H5Oget_info3(group_id2, &oinfo2, H5O_INFO_TIME) < 0) TEST_ERROR
+ /* Native file format info */
+ if(H5Oget_native_info(group_id, &ninfo, H5O_NATIVE_INFO_HDR) < 0) TEST_ERROR
+ if(H5Oget_native_info(group_id2, &ninfo2, H5O_NATIVE_INFO_HDR) < 0) TEST_ERROR
/* Sanity check object information for each group */
+ /* Generic info */
if(oinfo.atime != 0) TEST_ERROR
if(oinfo.mtime != 0) TEST_ERROR
if(oinfo.ctime != 0) TEST_ERROR
@@ -14834,10 +18173,11 @@ timestamps(hid_t fapl)
if(oinfo.mtime == oinfo2.mtime) TEST_ERROR
if(oinfo.ctime == oinfo2.ctime) TEST_ERROR
if(oinfo.btime == oinfo2.btime) TEST_ERROR
- if((oinfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR
- if((oinfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR
- if(oinfo.hdr.space.total >= oinfo2.hdr.space.total) TEST_ERROR
- if(oinfo.hdr.space.meta >= oinfo2.hdr.space.meta) TEST_ERROR
+ /* Native file format info */
+ if((ninfo.hdr.flags & H5O_HDR_STORE_TIMES) != 0) TEST_ERROR
+ if((ninfo2.hdr.flags & H5O_HDR_STORE_TIMES) == 0) TEST_ERROR
+ if(ninfo.hdr.space.total >= ninfo2.hdr.space.total) TEST_ERROR
+ if(ninfo.hdr.space.meta >= ninfo2.hdr.space.meta) TEST_ERROR
/* Close the property lists */
if(H5Pclose(gcpl_id) < 0) TEST_ERROR
@@ -14852,7 +18192,7 @@ timestamps(hid_t fapl)
PASSED();
- return 0;
+ return SUCCEED;
error:
/* Free resources */
@@ -14862,31 +18202,26 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
- return -1;
+ return FAIL;
} /* end timestamps() */
-
+
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Test links
- *
- * Return: Success: exit(EXIT_SUCCESS)
+ * Function: main
*
- * Failure: exit(EXIT_FAILURE)
- *
- * 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 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");
@@ -14896,165 +18231,243 @@ main(void)
h5_reset();
fapl = h5_fileaccess();
- /* Copy the file access property list */
+ /* fapl2 uses "latest version bounds" */
if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
-
- /* Set the "use the latest version of the format" bounds for creating objects in the file */
if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR
- /* Loop over using new group format */
- for(new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t my_fapl;
+ for (minimize_dset_oh = 0; minimize_dset_oh <= 1; minimize_dset_oh++) {
+ if (minimize_dset_oh) {
+ HDprintf("\n-Testing with minimzed dataset object headers-\n");
+ dcpl_g = H5Pcreate(H5P_DATASET_CREATE);
+ if (0 > dcpl_g) TEST_ERROR
+ }
+ else {
+ HDprintf("\n-Testing with unminimzed dataset object headers-\n");
+ dcpl_g = H5P_DEFAULT;
+ }
- /* Check for FAPL to use */
- if(new_format)
- my_fapl = fapl2;
- else
- my_fapl = fapl;
-
- /* General tests... (on both old & new format groups */
- nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0;
-
- /* Test new H5L link creation routine */
- nerrors += test_lcpl(my_fapl, new_format);
- nerrors += test_move(my_fapl, new_format);
- nerrors += test_copy(my_fapl, new_format);
- nerrors += test_move_preserves(my_fapl, new_format);
+ for(new_format = FALSE; new_format <= TRUE; new_format++) {
+ hid_t my_fapl;
+
+ /* Check for FAPL to use */
+ if(new_format) {
+ my_fapl = fapl2;
+ HDprintf("\n--Testing with 'new format'--\n");
+ }
+ 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
+
+ /* General tests... (on both old & new format groups */
+ nerrors += mklinks(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += cklinks(my_fapl, new_format) < 0 ? 1 : 0;
#ifndef H5_NO_DEPRECATED_SYMBOLS
- nerrors += test_deprec(my_fapl, new_format);
+ nerrors += cklinks_deprec(my_fapl, new_format) < 0 ? 1 : 0;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += new_links(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += ck_new_links(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += long_links(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += toomany(my_fapl, new_format) < 0 ? 1 : 0;
- /* tests for external link */
- /* 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;
+ /* Test new H5L link creation routine */
+ nerrors += test_lcpl(my_fapl, new_format);
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += test_lcpl_deprec(my_fapl, new_format);
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += test_move(my_fapl, new_format);
+ nerrors += test_copy(my_fapl, new_format);
+ nerrors += test_move_preserves(my_fapl, new_format);
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += test_move_preserves_deprec(my_fapl, new_format);
+ nerrors += test_deprec(my_fapl, new_format);
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
- /* This test cannot run with the EFC because it assumes that an
- * 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 */
- nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
+ /* tests for external link */
+ /* 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;
- /* 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
- printf("\n---Testing with external file cache---\n");
- } /* end if */
- else {
- if(H5Pset_elink_file_cache_size(my_fapl, 0) < 0)
- TEST_ERROR
- printf("\n---Testing without external file cache---\n");
- } /* end else */
+ /* This test cannot run with the EFC because it assumes that an
+ * 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
+ */
+ 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 */
+ for(efc = FALSE; efc <= TRUE; efc++) {
+ if(efc) {
+ 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
+ HDprintf("\n---Testing without external file cache---\n");
+ } /* end else */
- nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
- nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0;
-
- nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0;
- nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_root(my_fapl, new_format) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += external_link_root_deprec(my_fapl, new_format) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += external_link_path(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_self(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_pingpong(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_toomany(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_dangling(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_recursive(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_query(my_fapl, new_format) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += external_link_query_deprec(my_fapl, new_format) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += external_link_unlink_compact(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_unlink_dense(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_move(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_ride(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_closing(my_fapl, new_format) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += external_link_closing_deprec(my_fapl, new_format) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += external_link_endian(new_format) < 0 ? 1 : 0;
+ nerrors += external_link_strong(my_fapl, new_format) < 0 ? 1 : 0;
+
+ nerrors += external_link_prefix(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_abs_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_rel_mainpath(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_cwd(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_abstar(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_abstar_cur(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_reltar(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_chdir(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_set_elink_fapl1(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_set_elink_fapl2(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_set_elink_fapl3(new_format) < 0 ? 1 : 0;
+ nerrors += external_set_elink_cb(my_fapl, new_format) < 0 ? 1 : 0;
#ifdef H5_HAVE_WINDOW_PATH
- nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win1(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win2(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win3(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win4(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win5(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win6(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win7(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win8(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += external_link_win9(my_fapl, new_format) < 0 ? 1 : 0;
#endif
- nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
- 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;
- } /* end for */
+ nerrors += external_symlink(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
+ 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;
+ } /* with/without external file cache */
+
+ /* These tests assume that external links are a form of UD links,
+ * so assume that everything that passed for external links
+ * above has already been tested for UD links.
+ */
+ if(new_format == TRUE) {
+ nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += ud_hard_links_deprec(fapl2) < 0 ? 1 : 0; /* requires new format groups */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += ud_link_reregister_deprec(fapl2) < 0 ? 1 : 0; /* requires new format groups */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ } /* end if */
+ nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += ud_callbacks_deprec(my_fapl, new_format) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += lapl_nlinks_deprec(my_fapl, new_format) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += linkinfo_deprec(my_fapl, new_format) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
- /* These tests assume that external links are a form of UD links,
- * so assume that everything that passed for external links
- * above has already been tested for UD links.
- */
- if(new_format == TRUE) {
- nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
- nerrors += ud_link_reregister(fapl2) < 0 ? 1 : 0; /* requires new format groups */
- } /* end if */
- nerrors += ud_callbacks(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += ud_link_errors(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += lapl_udata(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += lapl_nlinks(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += linkinfo(my_fapl, new_format) < 0 ? 1 : 0;
-
- /* Misc. extra tests, useful for both new & old format files */
- nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0;
- nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0;
-
- /* Keep this test last, it's testing files that are used above */
- /* do not do this for files used by external link tests */
- nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
- } /* end for */
+ /* Misc. extra tests, useful for both new & old format files */
+ nerrors += link_visit(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += link_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += obj_visit(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += obj_visit_by_name(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += obj_visit_stop(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += link_filters(my_fapl, new_format) < 0 ? 1 : 0;
+ nerrors += obj_exists(my_fapl, new_format) < 0 ? 1 : 0;
+
+ /* Keep this test last, it's testing files that are used above */
+ /* do not do this for files used by external link tests */
+ nerrors += check_all_closed(my_fapl, new_format, EXTSTOP) < 0 ? 1 : 0;
+ } /* new/old format */
+
+ /* New group revision feature tests */
+ nerrors += corder_create_empty(fapl2) < 0 ? 1 : 0;
- /* New group revision feature tests */
- 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.
-*/
- nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
- nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
- nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
- nerrors += corder_delete(fapl2) < 0 ? 1 : 0;
- nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0;
- nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0;
- nerrors += link_iterate(fapl2) < 0 ? 1 : 0;
- nerrors += open_by_idx(fapl2) < 0 ? 1 : 0;
- nerrors += object_info(fapl2) < 0 ? 1 : 0;
- nerrors += group_info(fapl2) < 0 ? 1 : 0;
- nerrors += timestamps(fapl2) < 0 ? 1 : 0;
-
- /* Test new API calls on old-style groups */
- nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0;
- nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0;
- nerrors += link_iterate_old(fapl) < 0 ? 1 : 0;
- nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0;
- nerrors += object_info_old(fapl) < 0 ? 1 : 0;
- nerrors += group_info_old(fapl) < 0 ? 1 : 0;
+ * to these tests to make certain that the creation order values are
+ * correct.
+ */
+ nerrors += corder_create_compact(fapl2) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += corder_create_compact_deprec(fapl2) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += corder_create_dense(fapl2) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += corder_create_dense_deprec(fapl2) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += corder_transition(fapl2) < 0 ? 1 : 0;
+ nerrors += corder_delete(fapl2) < 0 ? 1 : 0;
+ nerrors += link_info_by_idx(fapl2) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += link_info_by_idx_deprec(fapl2) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += delete_by_idx(fapl2) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += delete_by_idx_deprec(fapl2) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += link_iterate(fapl2) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += link_iterate_deprec(fapl2) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += open_by_idx(fapl2) < 0 ? 1 : 0;
+ nerrors += object_info(fapl2) < 0 ? 1 : 0;
+ nerrors += group_info(fapl2) < 0 ? 1 : 0;
+ nerrors += timestamps(fapl2) < 0 ? 1 : 0;
+
+ /* Test new API calls on old-style groups */
+ nerrors += link_info_by_idx_old(fapl) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += link_info_by_idx_old_deprec(fapl) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += delete_by_idx_old(fapl) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += delete_by_idx_old_deprec(fapl) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += link_iterate_old(fapl) < 0 ? 1 : 0;
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ nerrors += link_iterate_old_deprec(fapl) < 0 ? 1 : 0;
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ nerrors += open_by_idx_old(fapl) < 0 ? 1 : 0;
+ nerrors += object_info_old(fapl) < 0 ? 1 : 0;
+ nerrors += group_info_old(fapl) < 0 ? 1 : 0;
+
+ if (minimize_dset_oh) {
+ if (H5Pclose(dcpl_g) < 0)
+ TEST_ERROR;
+ dcpl_g = -1;
+ }
+ } /* [un]minimized dataset object headers */
/* Close 2nd FAPL */
H5Pclose(fapl2);
@@ -15071,24 +18484,23 @@ main(void)
/* Results */
if(nerrors) {
- printf("***** %d LINK TEST%s FAILED! *****\n",
- nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
}
- printf("All link tests passed.\n");
+ HDprintf("All link tests passed.\n");
/* clean up symlink created by external link tests */
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);
+} /* end main() */
diff --git a/test/links_env.c b/test/links_env.c
index b32fb32..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,35 +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 */
- const char *env_h5_drvr; /* File Driver value from environment */
-
- env_h5_drvr = HDgetenv("HDF5_DRIVER");
- if(env_h5_drvr == NULL)
- env_h5_drvr = "nomatch";
+ hid_t fapl; /* File access property lists */
+ int nerrors = 0; /* Error from tests */
h5_reset();
fapl = h5_fileaccess();
@@ -177,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() */
+
diff --git a/test/memleak_H5O_dtype_decode_helper_H5Odtype.h5 b/test/memleak_H5O_dtype_decode_helper_H5Odtype.h5
new file mode 100644
index 0000000..b5980b7
--- /dev/null
+++ b/test/memleak_H5O_dtype_decode_helper_H5Odtype.h5
Binary files differ
diff --git a/test/mf.c b/test/mf.c
index fea5ee2..7cfc954 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -13,28 +13,30 @@
/*
* 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"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5FLprivate.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VMprivate.h"
#define FILENAME_LEN 1024
@@ -136,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);
@@ -210,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");
@@ -254,26 +256,26 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
if (new_ma_addr != ma_addr)
TEST_ERROR
if (addr1 < (haddr_t)file_size)
TEST_ERROR
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
if (new_ma_addr != ma_addr)
TEST_ERROR
@@ -296,11 +298,11 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -316,11 +318,11 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fapl_new) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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);
@@ -328,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() */
@@ -338,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");
@@ -399,19 +401,19 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
type = H5FD_MEM_SUPER;
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
if (addr < (haddr_t)file_size)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr) TEST_ERROR
if (new_ma_size != ma_size) TEST_ERROR
@@ -431,17 +433,17 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should succeed */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30) <= 0)
+ if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30) <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
if(new_ma_addr != ma_addr)
TEST_ERROR
if(new_ma_size != ma_size)
@@ -458,11 +460,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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");
@@ -476,22 +478,22 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
if (addr < (haddr_t)file_size)
TEST_ERROR
/* should not succeed in shrinking */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0)
+ if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
if (new_ma_addr != ma_addr) TEST_ERROR
if (new_ma_size != ma_size) TEST_ERROR
@@ -506,11 +508,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != (file_size + TBLOCK_SIZE30))
TEST_ERROR
- PASSED()
+ PASSED();
} /* end if */
else {
- SKIPPED();
- puts(" Current VFD doesn't support metadata aggregator");
+ SKIPPED();
+ HDputs(" Current VFD doesn't support metadata aggregator");
} /* end else */
@@ -525,17 +527,17 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should not succeed in shrinking */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0)
+ if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
if (new_ma_addr != ma_addr) TEST_ERROR
if (new_ma_size != ma_size) TEST_ERROR
@@ -550,11 +552,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != (file_size + TBLOCK_SIZE30))
TEST_ERROR
- PASSED()
+ 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");
@@ -568,17 +570,17 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* should succeed in shrinking */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0)
+ if(H5MF_try_shrink(f, type, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size);
if(new_ma_addr != ma_addr)
TEST_ERROR
if(new_ma_size != ma_size)
@@ -598,11 +600,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fapl_new) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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);
@@ -610,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() */
@@ -620,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");
@@ -680,18 +682,18 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
type = H5FD_MEM_SUPER;
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
if (addr < (haddr_t)file_size)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr)
TEST_ERROR
@@ -711,17 +713,17 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* should succeed */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50);
if(was_extended <= 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr)
TEST_ERROR
@@ -736,11 +738,11 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != (file_size + TBLOCK_SIZE30 + TBLOCK_SIZE50))
TEST_ERROR
- PASSED()
+ 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");
@@ -758,30 +760,30 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
type = H5FD_MEM_SUPER;
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
if(addr < (haddr_t)file_size)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(new_ma_addr != ma_addr)
TEST_ERROR
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50));
/* should not succeed */
if(was_extended > 0)
TEST_ERROR
/* nothing should be changed in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr)
TEST_ERROR
@@ -799,11 +801,11 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fapl_new) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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);
@@ -811,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() */
@@ -821,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
@@ -853,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 */
@@ -898,11 +900,11 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Retrieve the file's maxaddr */
- if(H5F_get_maxaddr_test(file, &maxaddr) < 0)
+ if(H5F__get_maxaddr_test(file, &maxaddr) < 0)
FAIL_STACK_ERROR
/* Allocate some temporary address space */
@@ -917,19 +919,19 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Reading & writing with a temporary address value should fail */
H5E_BEGIN_TRY {
- status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf);
+ status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf);
} H5E_END_TRY;
if(status >= 0)
TEST_ERROR
H5E_BEGIN_TRY {
- status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf);
+ status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf);
} H5E_END_TRY;
if(status >= 0)
TEST_ERROR
/* Freeing a temporary address value should fail */
H5E_BEGIN_TRY {
- status = H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, tmp_addr, (hsize_t)TBLOCK_SIZE30);
+ status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30);
} H5E_END_TRY;
if(status >= 0)
TEST_ERROR
@@ -952,7 +954,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 1/3 of the file as temporary address space */
@@ -962,7 +964,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Allocate 1/3 of the file as normal address space */
- if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3))))
+ if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3))))
FAIL_STACK_ERROR
if(H5F_IS_TMP_ADDR(f, norm_addr))
TEST_ERROR
@@ -976,13 +978,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Test that pushing normal space allocation into temporary space fails */
H5E_BEGIN_TRY {
- check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3));
+ check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3));
} H5E_END_TRY;
if(H5F_addr_defined(check_addr))
TEST_ERROR
/* Free the normal block (so the file doesn't blow up to a huge size) */
- if(H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, norm_addr, (hsize_t)(maxaddr / 3)) < 0)
+ if(H5MF_xfree(f, H5FD_MEM_DRAW, norm_addr, (hsize_t)(maxaddr / 3)) < 0)
FAIL_STACK_ERROR
/* Close the file */
@@ -997,18 +999,18 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -1018,21 +1020,21 @@ 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;
- TESTING("H5MF_create_fstype()/H5MF_open_fstype() of free-space manager");
+ TESTING("H5MF_create_fstype()/H5MF__open_fstype() of free-space manager");
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -1060,11 +1062,11 @@ test_mf_fs_start(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1086,19 +1088,19 @@ 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
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_start() */
@@ -1109,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;
@@ -1172,11 +1174,11 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1185,10 +1187,10 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1200,11 +1202,11 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Allocate a block of 30 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
/* 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;
@@ -1214,7 +1216,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Free the block to free-space */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30);
state.tot_space += TBLOCK_SIZE30;
state.tot_sect_count += 1;
@@ -1223,7 +1225,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
if(tmp != TBLOCK_ADDR70)
@@ -1238,9 +1240,9 @@ 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()
+ PASSED();
TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 2");
@@ -1249,11 +1251,11 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1262,10 +1264,10 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1277,11 +1279,11 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Allocate a block of 20 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE20));
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE20));
/* 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);
@@ -1290,7 +1292,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Free the block to free-space manager */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE20));
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE20));
/* Still 1 section in free-space because of merging */
state.tot_space += TBLOCK_SIZE20;
@@ -1298,7 +1300,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
if(tmp != TBLOCK_ADDR70)
@@ -1313,9 +1315,9 @@ 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()
+ PASSED();
TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 3");
@@ -1324,11 +1326,11 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1337,10 +1339,10 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1356,7 +1358,7 @@ test_mf_fs_alloc_free(hid_t fapl)
* Since free-space manager cannot fulfull the request,
* the block is obtained from file allocation
*/
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40));
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40));
/* Verify that the allocated block is not section A in free-space */
if(addr == TBLOCK_ADDR70)
@@ -1367,7 +1369,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
/* Verify that the block is section A in free-space */
@@ -1379,7 +1381,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* Free the block of size 40 to free-space */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE40));
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE40));
/*
* Free-space info is the same.
@@ -1398,19 +1400,19 @@ 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
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_alloc_free() */
@@ -1421,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;
@@ -1497,11 +1499,11 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1510,10 +1512,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
+ sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1525,7 +1527,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Allocate a block of 30 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is section A in free-space manager */
if(addr != TBLOCK_ADDR70)
@@ -1539,10 +1541,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section B */
- sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
+ sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
/* Add section B to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
FAIL_STACK_ERROR
state.tot_space += TBLOCK_SIZE50;
@@ -1553,11 +1555,11 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50);
/* should succeed */
if(was_extended <= 0)
- TEST_ERROR
+ TEST_ERROR
/* Section B is removed from free-space manager */
state.tot_space -= TBLOCK_SIZE50;
@@ -1568,7 +1570,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Free the extended block to free-space manager */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50));
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50));
/* Verify that the extended block is back into free-space */
state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE50);
@@ -1579,12 +1581,12 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the extended block */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ 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 != TBLOCK_ADDR70)
TEST_ERROR
-
+
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -1594,9 +1596,9 @@ 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()
+ PASSED();
TESTING("H5MF_try_extend() of free-space manager:test 2");
@@ -1605,11 +1607,11 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1618,10 +1620,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
+ sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1633,7 +1635,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Allocate a block of 30 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is section A in free-space manager */
if(addr != TBLOCK_ADDR70)
@@ -1647,10 +1649,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section B */
- sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
+ sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
/* Add section B to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
FAIL_STACK_ERROR
state.tot_space += TBLOCK_SIZE50;
@@ -1661,18 +1663,18 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10));
+ was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10));
/* 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))
TEST_ERROR
/* Free the allocated block A to free-space */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30);
/* the returned section A is merged with section B in free-space */
/* rest of the info remains the same */
@@ -1682,7 +1684,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the merged sections A & B from free-space */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ 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
@@ -1696,9 +1698,9 @@ 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()
+ PASSED();
TESTING("H5MF_try_extend() of free-space manager:test 3");
@@ -1707,11 +1709,11 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1720,10 +1722,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
+ sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1735,7 +1737,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Allocate a block of 30 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is section A in free-space manager */
if(addr != TBLOCK_ADDR70)
@@ -1749,10 +1751,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section B */
- sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
+ sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
/* Add section B to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
FAIL_STACK_ERROR
state.tot_space += TBLOCK_SIZE50;
@@ -1763,11 +1765,11 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40));
+ was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40));
/* 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);
@@ -1775,7 +1777,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Free the extended block */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40));
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40));
/* rest info is same, the extended section returned is merged with the section in free-space */
state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE40);
@@ -1784,9 +1786,9 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove the merged sections A & B from free-space */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ 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)
@@ -1798,9 +1800,9 @@ 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()
+ PASSED();
TESTING("H5MF_try_extend() of free-space manager:test 4");
@@ -1809,11 +1811,11 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -1822,10 +1824,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section A */
- sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10));
+ sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10));
/* Add section A of size=20 to free-space */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -1837,7 +1839,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Allocate a block of size=20 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10));
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10));
/* Verify that the allocated block is section A in free-space manager */
if(addr != TBLOCK_ADDR70)
@@ -1851,10 +1853,10 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Create section B */
- sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
+ sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50);
/* Add section B to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2))
FAIL_STACK_ERROR
state.tot_space += TBLOCK_SIZE50;
@@ -1865,18 +1867,18 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Try to extend the allocated block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50);
/* 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))
TEST_ERROR
/* Free the allocated block */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30-10));
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30-10));
state.tot_space += (TBLOCK_SIZE30-10);
state.tot_sect_count += 1;
@@ -1886,13 +1888,13 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Remove section A from free-space manger */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
if(tmp != addr) TEST_ERROR
/* Remove section B from free-space manager */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -1904,19 +1906,19 @@ 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
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
H5Pclose(fapl_new);
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_mf_fs_extend() */
@@ -1925,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
@@ -1958,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");
@@ -1981,12 +1983,12 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- /* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
- FAIL_STACK_ERROR
+ /* Start up H5FD_MEM_SUPER free-space manager */
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
TEST_ERROR
@@ -1994,19 +1996,19 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate a section from meta_aggr */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* Create a section */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr+ma_size), (hsize_t)TBLOCK_SIZE2048);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr+ma_size), (hsize_t)TBLOCK_SIZE2048);
/* Add a section to free-space that adjoins end of the aggregator */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
/* Verify that the section did absorb the aggregator */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
TEST_ERROR
if(tmp != ma_addr) TEST_ERROR
@@ -2016,16 +2018,16 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
f->shared->meta_aggr.size = ma_size;
/* Remove section from meta_aggr */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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");
@@ -2037,11 +2039,11 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -2050,24 +2052,24 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate a section from meta_aggr */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
/* Allocate a section from sdata_aggr */
- saddr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50);
/* Add a section to free-space that adjoins the beginning of meta_aggr */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30);
/* When adding, meta_aggr is absorbed onto the end of the section */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
/* Verify that the section did absorb the aggregator */
- if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE)
+ 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 */
@@ -2075,25 +2077,25 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
f->shared->meta_aggr.size = ma_size;
/* Remove section from meta_aggr */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30);
/* Remove section from sdata_aggr */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, H5FD_MEM_DRAW, saddr, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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() */
@@ -2102,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");
@@ -2163,23 +2165,23 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
TEST_ERROR
/* Allocate first block from meta_aggr */
type = H5FD_MEM_SUPER;
- if((addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF)
+ if((addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate second block from meta_aggr */
- if((addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF)
+ if((addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2+TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
if(ma_size != (TBLOCK_SIZE2048 - (TBLOCK_SIZE30 + TBLOCK_SIZE50)))
@@ -2201,13 +2203,13 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
TEST_ERROR
/* Free the two blocks: order matters because of H5F_FSPACE_STRATEGY_AGGR strategy */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) < 0)
+ if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50) < 0)
TEST_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30) < 0)
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -2224,18 +2226,18 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fcpl) < 0)
TEST_ERROR
- PASSED()
+ 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);
@@ -2245,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");
@@ -2304,28 +2306,28 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2+TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
if (ma_size != (TBLOCK_SIZE2048 - (TBLOCK_SIZE30 + TBLOCK_SIZE50)))
TEST_ERROR
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr3+TBLOCK_SIZE2058) != ma_addr)
TEST_ERROR
@@ -2350,10 +2352,10 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2366,18 +2368,18 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl)
if (new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -2386,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");
@@ -2460,21 +2462,21 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if ((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate second block from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2+TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
@@ -2483,16 +2485,16 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
/* Allocate first block from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr1+TBLOCK_SIZE30) != sdata_addr)
TEST_ERROR
if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR
/* Allocate third block, which is from file allocation not from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2058));
+ addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE2058));
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
/* info for meta_aggr shouldn't be changed */
if(addr3 != (sdata_addr+sdata_size)) TEST_ERROR
@@ -2500,8 +2502,8 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
if((new_ma_addr != ma_addr) || (new_ma_size != ma_size)) TEST_ERROR
/* Allocate fourth block, which should be from meta_aggr */
- addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr4+TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
@@ -2509,11 +2511,11 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free all the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE2058);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE2058);
+ H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2526,18 +2528,18 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -2547,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");
@@ -2623,14 +2625,14 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
@@ -2639,20 +2641,20 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
/* Allocate first block from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr1+TBLOCK_SIZE30) != sdata_addr)
TEST_ERROR
/* Allocate second block from sdata_aggr */
- saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30));
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr2 = H5MF_alloc(f, stype, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30));
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if(saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30) != sdata_addr)
TEST_ERROR
/* Allocate third block from sdata_aggr */
- saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr3+TBLOCK_SIZE50) != sdata_addr)
TEST_ERROR
@@ -2660,27 +2662,27 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate second block of 2058, which is from file allocation, not from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058);
if(addr2 != sdata_addr)
TEST_ERROR
/* sdata_aggr is reset 0 */
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((sdata_addr != 0) && (sdata_size != 0))
TEST_ERROR
/* info is unchanged in meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if((new_ma_addr != ma_addr) && (new_ma_size != ma_size))
TEST_ERROR
/* Free all the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2058);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2058);
+ H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, stype, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30);
+ H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2693,18 +2695,18 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -2713,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");
@@ -2771,20 +2773,20 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate second block from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if(addr2+TBLOCK_SIZE50 != ma_addr)
TEST_ERROR
@@ -2792,8 +2794,8 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate third block from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(addr3 != ma_addr) TEST_ERROR
if((addr3+TBLOCK_SIZE1970) != new_ma_addr) TEST_ERROR
@@ -2801,9 +2803,9 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free all the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2816,18 +2818,18 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -2836,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 */
@@ -2905,21 +2907,21 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
/* Allocate first block from meta_aggr */
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate second block from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if(addr2+TBLOCK_SIZE50 != ma_addr)
TEST_ERROR
@@ -2928,16 +2930,16 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
/* Allocate first block from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR
if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR
/* Allocate third block from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if((addr3+TBLOCK_SIZE1970) != new_ma_addr) TEST_ERROR
if(addr3 != (sdata_addr+sdata_size)) TEST_ERROR
@@ -2956,10 +2958,10 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free all the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970);
+ H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -2972,18 +2974,18 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
if(new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -2998,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 */
@@ -3072,19 +3074,19 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if ((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate the second block from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if (addr2+TBLOCK_SIZE50 != ma_addr)
TEST_ERROR
@@ -3093,38 +3095,38 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
/* Allocate the first block from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if ((saddr1+TBLOCK_SIZE30) != sdata_addr)
TEST_ERROR
/* Allocate the second block from sdata_aggr */
- saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30);
+ saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if ((saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30)) != sdata_addr)
TEST_ERROR
if (sdata_size != 0) TEST_ERROR
/* Allocate the third block from sdata_aggr */
- saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if ((saddr3+TBLOCK_SIZE50) != sdata_addr)
TEST_ERROR
if (sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE50))
TEST_ERROR
/* Allocate the third block from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if (addr3 != sdata_addr) TEST_ERROR
if ((addr3 + TBLOCK_SIZE1970) != ma_addr) TEST_ERROR
if (ma_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE1970)) TEST_ERROR
/* sdata_aggr info is reset to 0 */
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if (sdata_addr != HADDR_UNDEF) TEST_ERROR
if (sdata_size != 0) TEST_ERROR
@@ -3138,12 +3140,12 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free all the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30));
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970);
+ H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, stype, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30));
+ H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3156,18 +3158,18 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
if (file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -3176,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");
@@ -3235,13 +3237,13 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
@@ -3252,52 +3254,52 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
/* Try to extend the block by an amount < (% * aggr->alloc_size) */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50));
/* should succeed */
if(!was_extended)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(new_ma_addr != (addr+TBLOCK_SIZE50))
TEST_ERROR
if(new_ma_size != (f->shared->meta_aggr.alloc_size - TBLOCK_SIZE50)) TEST_ERROR
/* Free the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE50);
/* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700));
+ was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700));
/* should succeed */
if(!was_extended)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(new_ma_addr != (addr + TBLOCK_SIZE700))
TEST_ERROR
if(new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TBLOCK_SIZE700)) TEST_ERROR
/* Free the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE700);
+ H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE700);
/* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058));
+ was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058));
/* should succeed */
if(!was_extended)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != (addr + TBLOCK_SIZE2058))
TEST_ERROR
if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR
/* Free the allocated blocks */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE2058);
+ H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE2058);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3310,11 +3312,11 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if (file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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");
@@ -3326,20 +3328,20 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate the first block from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr+TBLOCK_SIZE50) != sdata_addr)
TEST_ERROR
@@ -3350,12 +3352,12 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
/* should be able to fulfill request from the aggreqator itself */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50));
if(!was_extended)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(new_ma_addr != (addr+TBLOCK_SIZE50))
TEST_ERROR
@@ -3366,8 +3368,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
f->shared->meta_aggr.addr = ma_addr;
f->shared->meta_aggr.size = ma_size;
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3380,11 +3382,11 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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");
@@ -3396,20 +3398,20 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
type = H5FD_MEM_SUPER;
- addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if ((addr+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate first block from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr+TBLOCK_SIZE50) != sdata_addr)
TEST_ERROR
@@ -3420,12 +3422,12 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
new_addr = addr - 10;
/* unable to fulfill request from the aggreqator itself */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50));
+ was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50));
if(was_extended)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != addr) TEST_ERROR
if (new_ma_size != 0) TEST_ERROR
@@ -3434,8 +3436,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
f->shared->meta_aggr.addr = ma_addr;
f->shared->meta_aggr.size = ma_size;
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3448,18 +3450,18 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -3470,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");
@@ -3526,23 +3528,23 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
ma_addr = new_ma_addr - TBLOCK_SIZE30;
if((addr1 + TBLOCK_SIZE30) != new_ma_addr)
TEST_ERROR
/* should succeed */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) <= 0)
+ if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE30) <= 0)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(new_ma_addr != ma_addr) TEST_ERROR
@@ -3557,11 +3559,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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");
@@ -3573,37 +3575,37 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR
if(ma_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR
/* Allocate block B from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size);
/* should succeed */
- if(H5MF_try_shrink(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0)
+ if(H5MF_try_shrink(f, stype, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0)
TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
if(new_sdata_addr != saddr1) TEST_ERROR
if(new_sdata_size != sdata_size + TBLOCK_SIZE50) TEST_ERROR
/* meta_aggr info should be updated because the block is absorbed into the meta_aggr */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr) TEST_ERROR
if (new_ma_size != (ma_size)) TEST_ERROR
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3616,11 +3618,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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");
@@ -3632,40 +3634,40 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
/* Allocate block B from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2+TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
/* Allocate block C from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50));
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50));
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr3+TBLOCK_SIZE30+TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
/* should not succeed */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) > 0)
+ if(H5MF_try_shrink(f, type, addr2, (hsize_t)TBLOCK_SIZE50) > 0)
TEST_ERROR
/* aggregator info should be the same as before */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if(new_ma_addr != ma_addr) TEST_ERROR
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50));
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50));
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3678,18 +3680,18 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl)
if(file_size != empty_size)
TEST_ERROR
- PASSED()
+ 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() */
@@ -3701,46 +3703,46 @@ error:
* Alignment = 1024 or 4096
*
* Test 1:
- * Turn off using meta data 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 meta data 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 meta data 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");
@@ -3781,7 +3783,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -3792,13 +3794,13 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from file allocation */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(addr1 % alignment) TEST_ERROR
/* there should be nothing in the aggregator */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if(ma_addr || ma_size) TEST_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -3816,13 +3818,13 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
accum += (mis_align + TBLOCK_SIZE50);
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is aligned */
if (addr2 % alignment) TEST_ERROR
/* there should be nothing in the aggregator */
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if(ma_addr || ma_size) TEST_ERROR
if(mis_align) {
@@ -3833,8 +3835,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
}
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -3845,11 +3847,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (new_file_size != file_size)
TEST_ERROR
- PASSED()
+ 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");
@@ -3863,12 +3865,12 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* allocate a block of 50 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* address should be aligned */
if (addr1 % alignment) TEST_ERROR
@@ -3885,11 +3887,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* shrink the block */
- if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50) <= 0)
+ if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE50) <= 0)
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -3900,11 +3902,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (new_file_size != (file_size-TBLOCK_SIZE50)) TEST_ERROR
- PASSED()
+ 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");
@@ -3918,12 +3920,12 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* allocate a block of 50 */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* address should be aligned */
if(addr1 % alignment) TEST_ERROR
@@ -3940,11 +3942,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* try to extend the block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30);
+ was_extended = H5MF_try_extend(f, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30);
if(was_extended <=0) TEST_ERROR
@@ -3956,18 +3958,18 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (new_file_size != (file_size+TBLOCK_SIZE30)) TEST_ERROR
- PASSED()
+ 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() */
@@ -3979,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");
@@ -4040,11 +4042,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -4053,10 +4055,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Create section A */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -4068,7 +4070,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Allocate a block of 50 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is section A in free-space */
if(addr != (haddr_t)alignment) TEST_ERROR
@@ -4082,7 +4084,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Free the block to free-space */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE50);
state.tot_space += TBLOCK_SIZE50;
state.tot_sect_count += 1;
@@ -4093,7 +4095,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
TESTING("H5MF_alloc() of free-space manager with alignment: test 2");
@@ -4103,11 +4105,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -4116,10 +4118,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Create section A */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -4131,7 +4133,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Allocate a block of 600 */
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE600);
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE600);
/* Verify that the allocated block is aligned */
if (addr % alignment) TEST_ERROR
@@ -4145,7 +4147,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* try to extend the block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200);
if(was_extended <=0) TEST_ERROR
@@ -4156,7 +4158,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Free the block to free-space manager */
- H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200));
+ H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200));
/* only 1 section in free-space because of merging */
state.tot_space += (TBLOCK_SIZE600+TBLOCK_SIZE200);
@@ -4168,7 +4170,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
TESTING("H5MF_alloc() of free-space manager with alignment: test 3");
@@ -4186,11 +4188,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
+ if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0)
FAIL_STACK_ERROR
if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN)
@@ -4199,10 +4201,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Create section A */
- sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700);
+ sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700);
/* Add section A to free-space manager */
- if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
+ if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node))
FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(H5FS_stat_t));
@@ -4217,7 +4219,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
* Since free-space manager cannot fulfull the request because of alignment,
* the block is obtained from file allocation
*/
- addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40));
+ addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40));
/* Verify that the allocated block is aligned */
if(addr % alignment)
@@ -4243,18 +4245,18 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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() */
@@ -4263,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 */
@@ -4406,7 +4408,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -4415,7 +4417,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(addr1 % alignment) TEST_ERROR
@@ -4428,7 +4430,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if ((addr1 + TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
@@ -4439,7 +4441,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 50 from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is aligned */
if(addr2 % alignment) TEST_ERROR
@@ -4451,7 +4453,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2 + TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
@@ -4461,7 +4463,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if ((tmp = ma_addr % alignment))
mis_align = alignment - tmp;
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80);
/* Verify that the allocated block is aligned */
if(addr3 % alignment) TEST_ERROR
@@ -4473,7 +4475,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr3 + TBLOCK_SIZE80) != ma_addr)
TEST_ERROR
@@ -4484,7 +4486,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 1970 from meta_aggr */
- addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970);
+ addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970);
/* Verify that the allocated block is aligned */
if(addr4 % alignment) TEST_ERROR
@@ -4496,7 +4498,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr4 + TBLOCK_SIZE1970) != ma_addr)
TEST_ERROR
@@ -4505,26 +4507,26 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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() */
@@ -4533,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");
@@ -4662,7 +4664,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -4671,7 +4673,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(addr1 % alignment) TEST_ERROR
@@ -4684,7 +4686,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1 + TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
@@ -4694,7 +4696,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if((tmp = ma_addr % alignment))
mis_align = alignment - tmp;
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is aligned */
if(addr2 % alignment) TEST_ERROR
@@ -4706,7 +4708,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2 + TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
@@ -4716,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)))
@@ -4730,7 +4732,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
/* fragment for alignment of block 30 for sdata_aggr is freed to free-space */
if(mis_align) {
@@ -4742,8 +4744,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Verify that the allocated block is aligned */
if (saddr1 % alignment) TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if(sdata_addr != (saddr1 + TBLOCK_SIZE30)) TEST_ERROR
@@ -4751,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)))
@@ -4763,7 +4765,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 80 from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80);
/* Verify that the allocated block is aligned */
if (addr3 % alignment) TEST_ERROR
@@ -4775,42 +4777,42 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr3 + TBLOCK_SIZE80) != ma_addr)
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, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50);
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80);
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80);
+ H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30);
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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() */
@@ -4819,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 */
@@ -5001,7 +5003,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
@@ -5010,7 +5012,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(addr1 % alignment) TEST_ERROR
@@ -5023,7 +5025,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if ((addr1 + TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
@@ -5033,7 +5035,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 50 from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is aligned */
if(addr2 % alignment) TEST_ERROR
@@ -5045,7 +5047,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2 + TBLOCK_SIZE50) != ma_addr)
TEST_ERROR
@@ -5068,7 +5070,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(saddr1 % alignment) TEST_ERROR
@@ -5080,7 +5082,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if(sdata_addr != (saddr1+TBLOCK_SIZE30)) TEST_ERROR
/* calculate fragment for alignment of block 50 in sdata_aggr */
@@ -5089,7 +5091,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 50 from sdata_aggr */
- saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is aligned */
if(saddr2 % alignment) TEST_ERROR
@@ -5101,7 +5103,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if(sdata_addr != (saddr2 + TBLOCK_SIZE50)) TEST_ERROR
/* calculate fragment for alignment of block 80 in sdata_aggr */
@@ -5110,7 +5112,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 80 from sdata_aggr */
- saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80);
/* Verify that the allocated block is aligned */
if(saddr3 % alignment) TEST_ERROR
@@ -5122,7 +5124,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if ((saddr3 + TBLOCK_SIZE80) != sdata_addr)
TEST_ERROR
@@ -5132,7 +5134,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 1034 for meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1034);
/* Verify that the allocated block is aligned */
if(addr3 % alignment) TEST_ERROR
@@ -5156,37 +5158,37 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr3 + TBLOCK_SIZE1034) != ma_addr)
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
- PASSED()
+ 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() */
@@ -5196,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 */
@@ -5302,7 +5304,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5315,7 +5317,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(addr1 % alignment) TEST_ERROR
@@ -5328,7 +5330,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
saved_ma_size = ma_size;
if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR
@@ -5338,7 +5340,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 2058 from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058);
/* Verify that the allocated block is aligned */
if(addr2 % alignment) TEST_ERROR
@@ -5350,7 +5352,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr2 + TBLOCK_SIZE2058) != ma_addr) TEST_ERROR
@@ -5363,7 +5365,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 5 from meta_aggr */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5);
/* fragment for alignment of block 5 is freed to free-space */
if(mis_align) {
@@ -5376,26 +5378,26 @@ 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
- PASSED()
+ 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() */
@@ -5404,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 */
@@ -5513,7 +5515,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5526,12 +5528,12 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(addr1 % alignment) TEST_ERROR
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if((addr1 + TBLOCK_SIZE30) != ma_addr) TEST_ERROR
@@ -5550,7 +5552,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if(saddr1 % alignment) TEST_ERROR
@@ -5562,7 +5564,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR
/* calculate fragment for alignment of block 2058 from meta_aggr */
@@ -5571,7 +5573,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 2058 from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058);
/* Verify that the allocated block is aligned */
if (addr2 % alignment) TEST_ERROR
@@ -5584,41 +5586,41 @@ 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);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
if (new_ma_addr != ma_addr || new_ma_size != ma_size)
TEST_ERROR
/* nothing is changed in sdata_aggr */
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size);
if (new_sdata_addr != sdata_addr || new_sdata_size != sdata_size)
TEST_ERROR
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ 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() */
@@ -5628,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");
@@ -5777,7 +5779,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5790,7 +5792,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from meta_aggr */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if (addr1 % alignment) TEST_ERROR
@@ -5803,7 +5805,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
if ((addr1+TBLOCK_SIZE30) != ma_addr)
TEST_ERROR
@@ -5814,7 +5816,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Allocate a block of 30 from sdata_aggr */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
/* Verify that the allocated block is aligned */
if (saddr1 % alignment) TEST_ERROR
@@ -5826,7 +5828,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if (sdata_addr != (saddr1+TBLOCK_SIZE30)) TEST_ERROR
/* calculate fragment for alignment of block 50 in sdata_aggr */
@@ -5835,7 +5837,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 50 from sdata_aggr */
- saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50);
/* Verify that the allocated block is aligned */
if (saddr2 % alignment) TEST_ERROR
@@ -5847,7 +5849,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if (sdata_addr != (saddr2+TBLOCK_SIZE50)) TEST_ERROR
/* calculate fragment for alignment of block 80 in sdata_aggr */
@@ -5856,7 +5858,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 80 from sdata_aggr */
- saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80);
/* Verify that the allocated block is aligned */
if (saddr3 % alignment) TEST_ERROR
@@ -5868,7 +5870,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[stype].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if (sdata_addr != (saddr3+TBLOCK_SIZE80)) TEST_ERROR
/* calculate fragment for alignment of block 2058 */
@@ -5878,7 +5880,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
mis_align = alignment - tmp;
/* Allocate a block of 2058 from meta_aggr */
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058);
+ addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058);
/* Verify that the allocated block is aligned */
if (addr2 % alignment) TEST_ERROR
@@ -5890,8 +5892,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state[type].serial_sect_count += 1;
}
- H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
- H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
+ H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size);
+ H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size);
if (new_ma_addr != ma_addr && new_ma_size != ma_size)
TEST_ERROR
@@ -5899,34 +5901,34 @@ 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
- PASSED()
+ 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);
+ return 0;
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
- return(1);
+ return 1;
} /* test_mf_align_alloc6() */
/*
@@ -6003,7 +6005,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
/* Populate memb_fapl_arr, patch memb_addr so member file addresses
* are aligned */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
memb_fapl_arr[mt] = memb_fapl;
memb_addr[mt] = ((memb_addr[mt] + align - 1) / align) * align;
} /* end for */
@@ -6013,7 +6015,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free memb_name */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
free(memb_name[mt]);
} /* end else */
@@ -6027,14 +6029,14 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
TEST_ERROR
/* Allocate a block of size align from meta_aggr. This should create an
* aggregator that extends to the end of the file, with
* block_size / 2 bytes remaining, and the end of the file aligned */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align);
+ addr1 = H5MF_alloc(f, type, align);
/* Verify that the allocated block is aligned */
if(addr1 % align) TEST_ERROR
@@ -6043,7 +6045,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
* aggregator to extend to the end of the file, with 0 bytes remaining, and
* the end of the file aligned */
type = H5FD_MEM_SUPER;
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align);
+ addr2 = H5MF_alloc(f, type, align);
/* Verify that the allocated block is aligned */
if(addr2 % align) TEST_ERROR
@@ -6055,7 +6057,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
* force the aggregator to extend to the end of the file, with 0 bytes
* remaining, and the end of the file unaligned */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, block_size + (hsize_t)1);
+ addr1 = H5MF_alloc(f, type, block_size + (hsize_t)1);
/* Verify that the allocated block is aligned */
if(addr1 % align) TEST_ERROR
@@ -6067,7 +6069,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
/* Allocate a block of size 1. This should extend the aggregator from
* the previous allocation, and align the new block */
type = H5FD_MEM_SUPER;
- addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)1);
+ addr2 = H5MF_alloc(f, type, (hsize_t)1);
/* Verify that the allocated block is aligned */
if(addr2 % align) TEST_ERROR
@@ -6076,7 +6078,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl)
* the previous */
if((addr2 - addr1) != (3 * align)) TEST_ERROR
- PASSED()
+ PASSED();
/* Close file */
if(H5Fclose(file) < 0)
@@ -6113,39 +6115,39 @@ test_mf_fs_persist_split(void)
TESTING("File's free-space managers are persistent for split-file");
- /* for now, we don't support persistant free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
- HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n");
+ HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
/* File creation property list template */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- /* for now, we don't support persistant free space managers
+ /* for now, we don't support persistent free space managers
* with the split file driver.
*/
SKIPPED();
- HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n");
+ HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
/* File creation property list template */
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));
@@ -6155,41 +6157,41 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 4 blocks of type H5FD_MEM_SUPER */
type = H5FD_MEM_SUPER;
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
/* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
/* Allocate 4 blocks of type H5FD_MEM_DRAW */
stype = H5FD_MEM_DRAW;
- if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
/* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */
- if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6200,7 +6202,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is there */
@@ -6208,7 +6210,7 @@ test_mf_fs_persist_split(void)
TEST_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6222,7 +6224,7 @@ test_mf_fs_persist_split(void)
TEST_ERROR
/* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
if(tmp_addr != addr1)
TEST_ERROR
@@ -6233,7 +6235,7 @@ test_mf_fs_persist_split(void)
/* Start up H5FD_MEM_DRAW free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6247,13 +6249,13 @@ test_mf_fs_persist_split(void)
TEST_ERROR
/* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
if(tmp_addr != saddr1)
TEST_ERROR
/* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
if(tmp_addr != saddr3)
TEST_ERROR
@@ -6262,19 +6264,19 @@ test_mf_fs_persist_split(void)
/* Allocate 4 blocks of type H5FD_MEM_BTREE */
btype = H5FD_MEM_BTREE;
- if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5)))
+ if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE5)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6)))
+ if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE6)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7)))
+ if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8)))
+ if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE8)))
FAIL_STACK_ERROR
/* Put block #5 & #7 into H5FD_MEM_BTREE free-space manager */
- if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr5, (hsize_t)TBLOCK_SIZE5) < 0)
+ if(H5MF_xfree(f, btype, baddr5, (hsize_t)TBLOCK_SIZE5) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr7, (hsize_t)TBLOCK_SIZE7) < 0)
+ if(H5MF_xfree(f, btype, baddr7, (hsize_t)TBLOCK_SIZE7) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6285,7 +6287,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the free-space manager for H5FD_MEM_DRAW is not there */
@@ -6297,7 +6299,7 @@ test_mf_fs_persist_split(void)
TEST_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6309,13 +6311,13 @@ test_mf_fs_persist_split(void)
TEST_ERROR
/* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
- FAIL_STACK_ERROR
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
+ FAIL_STACK_ERROR
if(tmp_addr != addr3)
TEST_ERROR
/* Retrieve block #7 from H5FD_MEM_BTREE free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7)))
FAIL_STACK_ERROR
if(tmp_addr != baddr7)
TEST_ERROR
@@ -6329,7 +6331,7 @@ test_mf_fs_persist_split(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is there */
@@ -6337,7 +6339,7 @@ test_mf_fs_persist_split(void)
TEST_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6356,7 +6358,7 @@ test_mf_fs_persist_split(void)
if(H5Pclose(fcpl) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return(0);
@@ -6376,7 +6378,7 @@ error:
HDmemset(memb_name, 0, sizeof memb_name); \
HDmemset(memb_addr, 0, sizeof memb_addr); \
HDmemset(sv, 0, sizeof sv); \
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { \
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { \
memb_map[mt] = H5FD_MEM_SUPER; \
memb_fapl[mt] = H5P_DEFAULT; \
} \
@@ -6384,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; \
}
@@ -6435,18 +6437,18 @@ test_mf_fs_persist_multi(void)
TESTING("File's free-space managers are persistent for multi-file");
- /* for now, we don't support persistant free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
- HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n");
+ HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
- /* for now, we don't support persistant free space managers
+ /* for now, we don't support persistent free space managers
* with the multi file driver.
*/
SKIPPED();
- HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n");
+ HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n");
return 0; /* <========== note return */
/* File creation property list template */
@@ -6472,41 +6474,41 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 4 blocks of type H5FD_MEM_SUPER */
type = H5FD_MEM_SUPER;
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
/* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
/* Allocate 4 blocks of type H5FD_MEM_DRAW */
stype = H5FD_MEM_DRAW;
- if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
/* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */
- if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6517,7 +6519,7 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the H5FD_MEM_SUPER free-space manager is there */
@@ -6525,7 +6527,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6539,7 +6541,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
if(tmp_addr != addr1)
TEST_ERROR
@@ -6549,7 +6551,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Start up H5FD_MEM_DRAW free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6563,32 +6565,32 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
if(tmp_addr != saddr1)
TEST_ERROR
/* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
if(tmp_addr != saddr3)
TEST_ERROR
/* Allocate 4 blocks of type H5FD_MEM_BTREE */
btype = H5FD_MEM_BTREE;
- if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
/* Put block #1 & #3 into H5FD_MEM_BTREE free-space manager */
- if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, btype, baddr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, btype, baddr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6599,7 +6601,7 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that the free-space manager for H5FD_MEM_SUPER is there */
@@ -6607,7 +6609,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6619,7 +6621,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
if(tmp_addr != addr3)
TEST_ERROR
@@ -6633,7 +6635,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Start up H5FD_MEM_BTREE free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)btype) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)btype) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6648,13 +6650,13 @@ test_mf_fs_persist_multi(void)
/* Allocate 2 blocks of type H5FD_MEM_GHEAP */
gtype = H5FD_MEM_GHEAP;
- if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
/* Put block #2 into H5FD_MEM_GHEAP free-space manager */
- if(H5MF_xfree(f, gtype, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0)
+ if(H5MF_xfree(f, gtype, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6665,21 +6667,21 @@ test_mf_fs_persist_multi(void)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */
if(H5F_addr_defined(f->shared->fs_addr[type])) {
/* Start up H5FD_MEM_SUPER free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0)
FAIL_STACK_ERROR
- if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type],
+ if((node_found = H5FS_sect_find(f, f->shared->fs_man[type],
(hsize_t)TBLOCK_SIZE1, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if(node_found) TEST_ERROR
- if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type],
+ if((node_found = H5FS_sect_find(f, f->shared->fs_man[type],
(hsize_t)TBLOCK_SIZE3, (H5FS_section_info_t **)&node)) < 0)
FAIL_STACK_ERROR
if(node_found) TEST_ERROR
@@ -6690,7 +6692,7 @@ test_mf_fs_persist_multi(void)
TEST_ERROR
/* Start up H5FD_MEM_GHEAP free-space manager */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)gtype) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)gtype) < 0)
FAIL_STACK_ERROR
/* Get free-space info */
@@ -6709,7 +6711,7 @@ test_mf_fs_persist_multi(void)
if(H5Pclose(fcpl) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return(0);
@@ -6746,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 */
@@ -6777,30 +6779,30 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 6 blocks */
type = H5FD_MEM_SUPER;
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5)))
+ if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6)))
+ 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, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0)
+ if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6811,28 +6813,18 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ 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]))
TEST_ERROR
- /* Since we are about to open a self referential free space
- * manager prior to the first file space allocation / deallocation
- * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid
- * assertion failures on the first file space alloc / dealloc.
- */
- if((f->shared->first_alloc_dealloc) &&
- (SUCCEED !=
- H5MF_tidy_self_referential_fsm_hack(f, H5AC_ind_read_dxpl_id)))
- FAIL_STACK_ERROR
-
/* Start up H5FD_MEM_SUPER free-space manager */
if(!(f->shared->fs_man[tt]))
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)tt) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)tt) < 0)
FAIL_STACK_ERROR
/* Get info for free-space manager */
@@ -6847,13 +6839,13 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
if(tmp_addr != addr3)
TEST_ERROR
/* Retrieve block #1 from H5FD_MEM_SUPER free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
if(tmp_addr != addr1)
TEST_ERROR
@@ -6866,7 +6858,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that H5FD_MEM_SUPER free-space manager is there */
@@ -6874,7 +6866,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Retrieve block #5 from H5FD_MEM_SUPER free-space manager */
- if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5)))
+ if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5)))
FAIL_STACK_ERROR
if(tmp_addr != addr5)
TEST_ERROR
@@ -6886,18 +6878,18 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(H5Pclose(fapl2) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
} 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;
@@ -6906,7 +6898,7 @@ error:
/*
*-------------------------------------------------------------------------
- * Verify free-space are merged/shrunk away
+ * Verify free-space are merged/shrunk away
*-------------------------------------------------------------------------
*/
static unsigned
@@ -6920,9 +6912,9 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
H5FD_mem_t type; /* File allocation type */
H5FS_stat_t fs_stat; /* Information for free-space manager */
haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */
- H5FD_mem_t fs_type;
+ haddr_t addrx;
+ H5FD_mem_t fs_type;
hbool_t contig_addr_vfd;
- hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE;
if(new_format)
TESTING("File's free-space is going away with new library format")
@@ -6941,9 +6933,13 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Copy the file access property list */
if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR
- if(new_format)
+ if(new_format) {
if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
FAIL_STACK_ERROR
+ } else {
+ if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0)
+ FAIL_STACK_ERROR
+ }
/* Set to aggregation and persisting free-space */
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
@@ -6957,30 +6953,30 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 4 blocks */
type = H5FD_MEM_SUPER;
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ 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, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
/* Retrieve block #1, #3 from H5FD_MEM_SUPER free-space manager */
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -6991,17 +6987,17 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ 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]))
TEST_ERROR
/* Put block #3 to H5FD_MEM_SUPER free-space manager */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
@@ -7012,47 +7008,36 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Verify that H5FD_MEM_SUPER free-space manager is there */
if(!H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
- /* Since we are about to open a self referential free space
- * manager prior to the first file space allocation / deallocation
- * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid
- * assertion failures on the first file space alloc / dealloc.
- */
- if(f->shared->first_alloc_dealloc){
- if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id))
- FAIL_STACK_ERROR
- ran_H5MF_tidy_self_referential_fsm_hack = TRUE;
- }
-
/* Start up H5FD_MEM_SUPER free-space manager */
if(!(f->shared->fs_man[fs_type]))
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)fs_type) < 0)
+ if(H5MF__open_fstype(f, (H5F_mem_page_t)fs_type) < 0)
FAIL_STACK_ERROR
/* Get info for H5FD_MEM_SUPER free-space manager */
if(H5FS_stat_info(f, f->shared->fs_man[fs_type], &fs_stat) < 0)
FAIL_STACK_ERROR
- /* if we ran H5MF_tidy_self_referential_fsm_hack(), the
- * H5FD_MEM_SUPER free space manager must be floating.
- * Thus fs_stat.addr must be undefined.
- */
- if((!ran_H5MF_tidy_self_referential_fsm_hack) &&
- (!H5F_addr_defined(fs_stat.addr)))
+ if(!H5F_addr_defined(fs_stat.addr))
TEST_ERROR
if(fs_stat.tot_space < TBLOCK_SIZE3)
TEST_ERROR
- /* Put block #4 to H5FD_MEM_SUPER free-space manager */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
- FAIL_STACK_ERROR
+ /* Allocate/free space accordingly so that the free-space manager will go away */
+ if(new_format) {
+ if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
+ FAIL_STACK_ERROR
+ } else {
+ if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, (hsize_t)3)))
+ FAIL_STACK_ERROR
+ }
/* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */
if(H5Fclose(file) < 0)
@@ -7063,9 +7048,8 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
-
/* Verify that the H5FD_MEM_SUPER free-space manager is not there */
if(H5F_addr_defined(f->shared->fs_addr[fs_type]))
TEST_ERROR
@@ -7078,18 +7062,18 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
if(H5Pclose(fapl2) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
} 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;
@@ -7144,7 +7128,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
for(fs_threshold = 0; fs_threshold <= TEST_THRESHOLD10; fs_threshold++) {
/* Testing for H5F_FSPACE_STRATEGY_FSM_AGGR and H5F_FSPACE_STRATEGY_PAGE strategies only */
- for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; H5_INC_ENUM(H5F_fspace_strategy_t, fs_type)) {
+ for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; fs_type++) {
if(!contig_addr_vfd && (fs_persist || fs_type == H5F_FSPACE_STRATEGY_PAGE))
continue;
@@ -7152,40 +7136,40 @@ 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
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 6 blocks */
type = H5FD_MEM_SUPER;
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5)))
+ if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6)))
+ 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, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0)
+ if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0)
FAIL_STACK_ERROR
@@ -7198,20 +7182,20 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ 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 *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if(f->shared->fs_persist) {
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
@@ -7226,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)
@@ -7251,7 +7235,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for
if(H5Pclose(fapl2) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return(0);
@@ -7259,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() */
@@ -7302,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)
@@ -7312,7 +7296,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
/* Test with TRUE or FALSE for persisting free-space */
for(fs_persist = FALSE; fs_persist <= TRUE; fs_persist++) {
/* Testing for H5F_FSPACE_STRATEGY_FSM_AGGR and H5F_FSPACE_STRATEGY_PAGE strategies only */
- for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; H5_INC_ENUM(H5F_fspace_strategy_t, fs_type)) {
+ for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; fs_type++) {
/* Skip for multi/split driver: persisting free-space or paged aggregation strategy */
if(!contig_addr_vfd && (fs_persist || fs_type == H5F_FSPACE_STRATEGY_PAGE))
@@ -7334,36 +7318,35 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate 6 blocks */
type = H5FD_MEM_SUPER;
- if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1)))
+ if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2)))
+ if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3)))
+ if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4)))
+ if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5)))
+ if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5)))
FAIL_STACK_ERROR
- if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6)))
+ 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, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
+ if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0)
+ if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0)
FAIL_STACK_ERROR
fs_state.tot_space += TBLOCK_SIZE3 + TBLOCK_SIZE5;
@@ -7374,31 +7357,31 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
TEST_ERROR
/* section #2 is less than threshold but is merged into section #3 */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2) < 0)
+ if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2) < 0)
FAIL_STACK_ERROR
fs_state.tot_space += TBLOCK_SIZE2;
if(check_stats(f, f->shared->fs_man[tt], &fs_state))
TEST_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
+ if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0)
FAIL_STACK_ERROR
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr6, (hsize_t)TBLOCK_SIZE6) < 0)
+ if(H5MF_xfree(f, type, addr6, (hsize_t)TBLOCK_SIZE6) < 0)
FAIL_STACK_ERROR
/* For paged aggregation, the sections in the page at EOF for small meta fs are merged but are not shrunk away */
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))
TEST_ERROR
/* section #1 is less than threshold but is shrunk away */
- if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
+ if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0)
FAIL_STACK_ERROR
/* For paged aggregation, the section in the page at EOF for small meta fs is not shrunk away */
@@ -7415,9 +7398,9 @@ 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 *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Free-space manager should be empty */
@@ -7437,7 +7420,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format
if(H5Pclose(fapl2) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return(0);
@@ -7445,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() */
@@ -7475,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");
@@ -7491,34 +7474,34 @@ test_dichotomy(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block of type H5FD_MEM_SUPER */
type = H5FD_MEM_SUPER;
- addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Allocate the second block of type H5FD_MEM_SUPER */
- H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50);
/* Allocate the first block of type H5FD_MEM_DRAW */
stype = H5FD_MEM_DRAW;
- saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
/* Free the first block of type H5FD_MEM_SUPER */
- H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30);
/* Allocate the second block of type H5FD_MEM_DRAW */
- saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30);
/* Verify that saddr1 is not addr1 */
if(saddr2 == addr1) TEST_ERROR
/* Free the first block of type H5FD_MEM_DRAW */
- H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30);
/* Allocate the third block of type H5FD_MEM_SUPER */
- addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30);
/* Verify that addr3 is not saddr1 */
if(addr3 == saddr1) TEST_ERROR
@@ -7526,13 +7509,13 @@ test_dichotomy(hid_t fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
return(0);
error:
H5E_BEGIN_TRY {
- H5Fclose(file);
+ H5Fclose(file);
} H5E_END_TRY;
return(1);
} /* test_dichotomy() */
@@ -7545,7 +7528,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
+set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split)
{
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl_arr[H5FD_MEM_NTYPES];
@@ -7554,7 +7537,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
hbool_t relax;
H5FD_mem_t mt;
- HDassert(multi || split);
+ HDassert(is_multi_or_split);
HDmemset(memb_name, 0, sizeof memb_name);
@@ -7562,13 +7545,13 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
if(H5Pget_fapl_multi(fapl, memb_map, memb_fapl_arr, memb_name, memb_addr, &relax) < 0)
TEST_ERROR
- if(split) {
+ if(is_multi_or_split) {
/* Set memb_addr aligned */
memb_addr[H5FD_MEM_SUPER] = ((memb_addr[H5FD_MEM_SUPER] + pagesize - 1) / pagesize) * pagesize;
memb_addr[H5FD_MEM_DRAW] = ((memb_addr[H5FD_MEM_DRAW] + pagesize - 1) / pagesize) * pagesize;
} else {
/* Set memb_addr aligned */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
memb_addr[mt] = ((memb_addr[mt] + pagesize - 1) / pagesize) * pagesize;
} /* end else */
@@ -7577,7 +7560,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
TEST_ERROR
/* Free memb_name */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
free(memb_name[mt]);
return 0;
@@ -7607,7 +7590,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Addresses for small raw data blocks */
haddr_t gaddr1; /* Addresses for large data blocks */
hbool_t split = FALSE, multi = FALSE;
@@ -7631,7 +7614,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if((fapl_new = H5Pcopy(fapl)) < 0) TEST_ERROR
if(multi || split)
- if(set_multi_split(fapl_new, 4096, multi, split) < 0)
+ if(set_multi_split(fapl_new, 4096, split) < 0)
TEST_ERROR;
/* Test with TRUE or FALSE for persisting free-space */
@@ -7651,56 +7634,54 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
-
- /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */
- H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034);
- addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+
+ /* 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);
+ addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
/* Free the block with addr2 */
- H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE1034);
+ H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE1034);
if(!fs_persist) {
+ H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type);
- H5MF_alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type);
-
- /* Verify that the freed block with addr2 is found from the small meta data manager */
- if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0)
+ /* 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)
TEST_ERROR
if(found_addr != addr2)
TEST_ERROR
} /* end if */
/* Allocate 2 small raw data blocks: saddr1, saddr2 */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30);
+ H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE1034);
/* Free the block with saddr1 */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30);
if(!fs_persist) {
/* Verify that the freed block with saddr1 is found from the small raw data manager */
- if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0)
+ if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0)
TEST_ERROR
if(found_addr != saddr1)
TEST_ERROR
} /* end if */
/* Allocate 2 large data blocks: gaddr1, gaddr2 */
- gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000);
- H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000);
+ gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000);
+ H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000);
/* Free the block with gaddr1 */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000);
+ 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, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0)
+ if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
if(found_addr != gaddr1)
TEST_ERROR
@@ -7718,38 +7699,28 @@ 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 *)H5I_object(fid)))
+ 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 meta data manager is there */
- H5MF_alloc_to_fs_type(f, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type);
+ /* Verify that the small metadata manager is there */
+ 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
- /* Since we are about to open a self referential free space
- * manager prior to the first file space allocation / deallocation
- * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid
- * assertion failures on the first file space alloc / dealloc.
- */
- if(f->shared->first_alloc_dealloc){
- if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id))
- FAIL_STACK_ERROR
- }
-
- /* Set up to use the small meta data manager */
+ /* Set up to use the small metadata manager */
if(!(f->shared->fs_man[fs_type]))
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0)
+ if(H5MF__open_fstype(f, fs_type) < 0)
TEST_ERROR
- /* Verify that the freed block with addr2 is found from the small meta data manager */
- if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0)
+ /* Verify that the freed block with addr2 is found from the small metadata manager */
+ if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
if(found_addr != (addr3+TBLOCK_SIZE50))
@@ -7758,31 +7729,31 @@ 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, H5AC_ind_read_dxpl_id, H5F_MEM_PAGE_DRAW) < 0)
+ if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0)
TEST_ERROR
/* Verify that the freed block with saddr1 is found from the small raw data manager */
- if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0)
+ if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0)
TEST_ERROR
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 */
- if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0)
+ if(H5MF__open_fstype(f, fs_type) < 0)
TEST_ERROR
/* Verify that the freed block with gaddr1 is found from the large data manager */
- if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0)
+ if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0)
TEST_ERROR
if(found_addr != gaddr1)
TEST_ERROR
-
+
/* Close file */
if(H5Fclose(fid) < 0)
TEST_ERROR
@@ -7792,11 +7763,11 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fapl_new) < 0)
TEST_ERROR
- PASSED()
+ PASSED();
} 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);
@@ -7831,7 +7802,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1; /* Address for small meta data block */
+ haddr_t addr1; /* Address for small metadata block */
haddr_t saddr1; /* Address for small raw data block */
haddr_t gaddr1; /* Address for large data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
@@ -7862,44 +7833,44 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
- addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ /* Allocate a small metadata block with addr1 */
+ addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
/* Try to shrink the block with addr1 */
- if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50)) < 0)
+ if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0)
FAIL_STACK_ERROR
- /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */
+ /* Couldn't shrink due to the section (remaining space in the page) is in the small metadata free-space manager */
if(status == TRUE) TEST_ERROR
/* Allocate a small raw data block with saddr1 */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50);
/* Try to shrink the block with saddr1 */
- if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0)
+ if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0)
FAIL_STACK_ERROR
/* Couldn't shrink due to the section (remaining space in the page) is in the small raw data free-space manager */
if(status == TRUE) TEST_ERROR
/* Allocate a large data block with gaddr1 */
- gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000);
+ gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000);
/* Try to shrink the block with gaddr1 */
- if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0)
+ if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0)
FAIL_STACK_ERROR
/* Couldn't shrink due to the section (remaining space in the page) is in the large-sized free-space manager */
if(status == TRUE) TEST_ERROR
/* Free the block with saddr1--merge to become 1 page, then return to the large manager */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50);
/* Merge all 3 sections and shrunk */
- H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000);
+ H5MF_xfree(f, H5FD_MEM_OHDR, gaddr1, (hsize_t)TBLOCK_SIZE5000);
if(H5Fclose(fid) < 0)
FAIL_STACK_ERROR
@@ -7916,11 +7887,11 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fcpl) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation");
+ HDputs(" Current VFD doesn't support paged aggregation");
}
return(0);
@@ -7954,7 +7925,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
hid_t fid = -1; /* File ID */
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2, addr3; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2, addr3; /* Addresses for small metadata blocks */
haddr_t saddr1; /* Address for small raw data block */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
htri_t was_extended; /* Whether the block can be extended or not */
@@ -7983,20 +7954,20 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
- /* Allocate a small meta data block with addr1 */
- addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE98);
+ /* Allocate a small metadata block with addr1 */
+ addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98);
/* Try extending the block with addr1 at EOF not crossing page boundary */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100);
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
- /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */
- addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100);
- addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE150);
+ /* Allocate 2 small metadata blocks with addr2 and addr3--will be on another metadata page */
+ addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100);
+ addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150);
/* The block with addr2 should be page aligned */
/* The block with addr3 resides right next to the block with addr2 */
@@ -8006,60 +7977,60 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free the block with addr2 */
- H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE100);
+ H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE100);
/* Try extending the block with addr1 that will cross to the next page where the freed block with addr2 resides */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100);
/* Shouldn't succeed--should not cross page boundary */
if(was_extended == TRUE) TEST_ERROR
/* Try extending the block with addr1 into the free-space section that is big enough to fulfill the request */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50);
+ 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, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE3248);
+ H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248);
- /* Allocate a new meta data block with addr1 */
+ /* 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 */
- addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3286);
+ /* 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 */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11);
/* Shouldn't succeed */
if(was_extended == TRUE) TEST_ERROR
/* Try extending the block into the threshold with size < H5F_FILE_SPACE_PGEND_META_THRES */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2);
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
/* Free the block with addr3--will merge with the remaining sections to become a page and then free the page */
- H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE150);
+ H5MF_xfree(f, H5FD_MEM_OHDR, addr3, (hsize_t)TBLOCK_SIZE150);
/* Allocate a small raw data block with saddr1 */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4086);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE4086);
/* Try extending the block crossing the page boundary */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11);
/* Shouldn't succeed */
if(was_extended == TRUE) TEST_ERROR
/* Try extending the block not crossing page boundary */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10);
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
/* The extended block is now "large" in size */
/* Try extending the block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10);
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
/* Try extending the large-sized block */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000);
/* Should not succeed because the mis-aligned fragment in the page is in the large-sized free-space manager */
if(was_extended == TRUE) TEST_ERROR
@@ -8071,11 +8042,11 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fcpl) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation");
+ HDputs(" Current VFD doesn't support paged aggregation");
}
return(0);
@@ -8137,70 +8108,70 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Allocate a large data block with gaddr1 */
- gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)6000);
+ gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)6000);
/* Should be page aligned */
if(gaddr1 % TBLOCK_SIZE4096)
TEST_ERROR
/* Extending the block with gaddr1 at EOF to become 2 pages */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192);
/* Should succeed */
if(was_extended != TRUE) TEST_ERROR
/* Allocate a large data block with gaddr2 */
- gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000);
+ gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000);
/* Should be page aligned */
if(gaddr2 % TBLOCK_SIZE4096)
TEST_ERROR
/* Try extending the block with gaddr1 */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50);
/* Should not succeed */
if(was_extended == TRUE) TEST_ERROR
/* Allocate a large data block with gaddr3 */
- gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000);
+ gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000);
/* Should be page aligned */
if(gaddr3 % TBLOCK_SIZE4096)
TEST_ERROR
/* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100);
/* Should succeed */
if(was_extended == FALSE) TEST_ERROR
/* Try extending the block with gaddr2--there is no free-space section big enough to fulfill the request */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100);
/* Should not succeed */
if(was_extended == TRUE) TEST_ERROR
/* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90);
/* Should succeed */
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) */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5);
+ /* 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
/* Allocate a large data block with gaddr4 */
- gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000);
+ gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000);
/* Should be page aligned */
if(gaddr4 % TBLOCK_SIZE4096)
TEST_ERROR
/* Free the block with gaddr3--will merge with remaining free space to become 2 pages + section (size 2) in previous page */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr3, (hsize_t)TBLOCK_SIZE8000);
+ H5MF_xfree(f, H5FD_MEM_DRAW, gaddr3, (hsize_t)TBLOCK_SIZE8000);
/* Try extending the block with gaddr2 crossing page boundary--there is free-space section big enough to fulfill the request */
- was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5);
+ was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5);
/* Should succeed */
if(was_extended == FALSE) TEST_ERROR
@@ -8212,11 +8183,11 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fcpl) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation strategy");
+ HDputs(" Current VFD doesn't support paged aggregation strategy");
}
return(0);
@@ -8273,18 +8244,18 @@ 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
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Allocate a large data block with gaddr1 */
/* 1 page + 1904 bytes; 2192 bytes in free-space manager */
- gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6000);
+ gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE6000);
/* Should be page aligned */
if(gaddr1 % TBLOCK_SIZE4096)
@@ -8292,20 +8263,20 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
/* Allocate a large data block with gaddr2--should be on another page */
/* Allocate 1 page + 3904 bytes; 192 bytes in free-space manager */
- gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000);
+ gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000);
/* Should be page aligned */
if(gaddr2 % TBLOCK_SIZE4096)
TEST_ERROR
/* Allocate a large data block with gaddr3--should be on another page */
/* Allocate 2 pages + 3808 bytes; 288 bytes in free-space manager */
- gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE12000);
+ gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE12000);
if(!H5F_addr_defined(gaddr3))
TEST_ERROR
/* Free the block with gaddr2 */
/* Merged sections: 2192 + 8000 + 192 = 10384 */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE8000);
+ H5MF_xfree(f, H5FD_MEM_DRAW, gaddr2, (hsize_t)TBLOCK_SIZE8000);
/* Get free-space info */
if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0)
@@ -8319,7 +8290,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
/* Allocate a large data block with gaddr4--there is a free-space section able to fulfill the request */
/* Free-space sections: 2192 + 3192 + 288 = 5672 bytes */
- gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000);
+ gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000);
/* Should be page aligned */
if(gaddr4 % TBLOCK_SIZE4096)
@@ -8337,8 +8308,8 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Free the two blocks with gaddr1 and gaddr4 */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE6000);
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr4, (hsize_t)TBLOCK_SIZE5000);
+ H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE6000);
+ H5MF_xfree(f, H5FD_MEM_DRAW, gaddr4, (hsize_t)TBLOCK_SIZE5000);
/* Get free-space info */
if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0)
@@ -8348,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
@@ -8365,11 +8336,11 @@ test_page_large(const char *env_h5_drvr, hid_t fapl)
if(file_size % TBLOCK_SIZE4096)
TEST_ERROR
- PASSED()
+ PASSED();
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation strategy");
+ HDputs(" Current VFD doesn't support paged aggregation strategy");
}
return(0);
@@ -8402,7 +8373,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl = -1; /* File creation property list */
H5F_t *f = NULL; /* Internal file object pointer */
haddr_t addr2, addr3, addr4, addr5; /* Addresses for blocks */
- haddr_t addr9, addr10, addr11; /* Address for small meta data blocks */
+ haddr_t addr9, addr10, addr11; /* Address for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
H5FS_stat_t fs_stat; /* Information for free-space manager */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8416,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) */
@@ -8435,21 +8406,21 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
- /* Allocate 2 small meta data blocks: addr1, addr2 */
- H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ /* Allocate 2 small metadata blocks: addr1, addr2 */
+ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30);
+ addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
/* Allocate a small raw data block with saddr1 */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30);
/* Should be on the second page and page aligned */
if(saddr1 % TBLOCK_SIZE4096)
TEST_ERROR
/* Allocate a small raw data block with saddr2 */
- saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50);
/* Should not be page aligned */
if(!(saddr2 % TBLOCK_SIZE4096))
TEST_ERROR
@@ -8457,14 +8428,14 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(saddr2 != (saddr1 + TBLOCK_SIZE30))
TEST_ERROR
- /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */
- addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4020);
+ /* Allocate a small metadata block with addr3--there is no free-space section big enough to fulfill the request */
+ addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020);
/* Should be on the third page and page aligned */
if(addr3 % TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */
- addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ /* Allocate a small metadata block with addr4--there is a free-space section big enough to fulfill the request */
+ addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* Should not be page aligned */
if(!(addr4 % TBLOCK_SIZE4096))
TEST_ERROR
@@ -8472,8 +8443,8 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr4 != (addr2 + TBLOCK_SIZE50))
TEST_ERROR
- /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */
- addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE40);
+ /* Allocate a small metadata block with addr5--there is a free-space section big enough to fulfill the request */
+ addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40);
/* Should not be page aligned */
if(!(addr5 % TBLOCK_SIZE4096))
TEST_ERROR
@@ -8482,22 +8453,22 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(addr5 != (addr3 + TBLOCK_SIZE4020))
TEST_ERROR
- /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */
+ /* Allocate a small metadata block with addr6--taking up the remaining space in the first page */
if(family)
- H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3080);
+ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080);
else
- H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3088);
+ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088);
- /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */
- H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE36);
+ /* Allocate a small metadata block with addr7--taking up the remaining space in the third page */
+ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36);
- /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */
- H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
- addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ /* Allocate 2 small metadata blocks: addr8, addr9--there is no free-space to fulfill the request */
+ H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50);
+ addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* Free the block with saddr1 and saddr2--merge with remaining section to become a page which will be returned to the large manager */
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30);
- H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE50);
+ H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30);
+ H5MF_xfree(f, H5FD_MEM_DRAW, saddr2, (hsize_t)TBLOCK_SIZE50);
/* Verify that the large manager does contain a section with file space page size (default is 4096) */
if(!f->shared->fs_man[H5F_MEM_PAGE_GENERIC])
@@ -8507,15 +8478,15 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(fs_stat.tot_space != TBLOCK_SIZE4096)
TEST_ERROR
- /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */
- addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3900);
+ /* Allocate a small metadata block with addr10--there is a free-space section big enough to fulfill the request */
+ addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900);
/* The block should be next to the block with addr9 */
if(addr10 != (addr9 + TBLOCK_SIZE80))
TEST_ERROR
- /* Allocate a small meta data block with addr11 */
+ /* Allocate a small metadata block with addr11 */
/* The current free-space section is unable to fulfill the request; obtain a page from the large manager */
- addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
+ addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80);
/* The address of the block should be the same the freed block with saddr1 */
if(addr11 != saddr1)
TEST_ERROR
@@ -8528,11 +8499,11 @@ test_page_small(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fcpl) < 0)
FAIL_STACK_ERROR
- PASSED()
+ PASSED();
} else {
SKIPPED();
- puts(" Current VFD doesn't support paged aggregation strategy");
+ HDputs(" Current VFD doesn't support paged aggregation strategy");
}
return(0);
@@ -8550,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
@@ -8568,7 +8539,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
hid_t fcpl2 = -1; /* File creation property list ID */
hid_t fapl_new = -1; /* File access property list ID */
H5F_t *f = NULL; /* Internal file object pointer */
- haddr_t addr1, addr2; /* Addresses for small meta data blocks */
+ haddr_t addr1, addr2; /* Addresses for small metadata blocks */
haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */
haddr_t gaddr1, gaddr2; /* Addresses for blocks */
char filename[FILENAME_LEN]; /* Filename to use */
@@ -8581,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) */
@@ -8645,7 +8616,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Populate memb_fapl_arr */
/* Set memb_addr aligned */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) {
memb_fapl_arr[mt] = memb_fapl;
memb_addr[mt] = ((memb_addr[mt] + TBLOCK_SIZE4096 - 1) / TBLOCK_SIZE4096) * TBLOCK_SIZE4096;
}
@@ -8657,7 +8628,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
} /* end else */
/* Free memb_name */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
free(memb_name[mt]);
/* Close memb_fapl */
@@ -8673,18 +8644,18 @@ 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
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
/* Allocate 2 small raw data blocks */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30);
+ saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50);
/* Should be on the second page and page aligned on 4096 (default file space page size) */
if(saddr1 % TBLOCK_SIZE4096)
@@ -8695,8 +8666,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate 2 large raw data blocks */
- gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000);
- gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000);
+ gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000);
+ gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000);
/* Should be on the 3rd page and page aligned */
if(gaddr1 % TBLOCK_SIZE4096)
@@ -8714,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.
*/
@@ -8722,7 +8693,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
/* Disable small data block mechanism */
if(H5Pset_small_data_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
- /* Disable meta data block mechanism */
+ /* Disable metadata block mechanism */
if(H5Pset_meta_block_size(fapl_new, (hsize_t)0) < 0)
TEST_ERROR
@@ -8731,12 +8702,12 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
- /* Allocate 2 small meta data blocks */
- addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ /* Allocate 2 small metadata blocks */
+ addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30);
+ addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50);
/* Should be aligned on 16 */
if(addr1 % TEST_ALIGN16 || addr2 % TEST_ALIGN16)
@@ -8748,8 +8719,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate 2 small raw data blocks */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80);
- saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE80);
+ saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE100);
/* Should be aligned on 16 */
if(saddr1 % TEST_ALIGN16 || saddr2 % TEST_ALIGN16)
@@ -8771,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.
*/
@@ -8792,12 +8763,12 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
TEST_ERROR
-
+
/* Allocate 2 small raw data blocks */
- saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30);
- saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50);
+ saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30);
+ saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50);
/* Should be aligned on 16 */
if(saddr1 % TEST_ALIGN16)
@@ -8811,7 +8782,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
TEST_ERROR
/* Allocate a large raw data block */
- gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000);
+ gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000);
/* Should be aligned on 16 */
if(gaddr1 % TEST_ALIGN16)
@@ -8834,11 +8805,11 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl)
if(H5Pclose(fapl_new) < 0)
TEST_ERROR
- PASSED()
+ PASSED();
} 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);
@@ -8856,11 +8827,12 @@ 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 */
/* Get the VFD to use */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
@@ -8871,6 +8843,10 @@ main(void)
fapl = h5_fileaccess();
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
/* Make a copy of the FAPL before adjusting the alignment */
if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
/* For old library format--interaction with file allocation */
@@ -8899,7 +8875,7 @@ main(void)
nerrors += test_mf_aggr_absorb(env_h5_drvr, fapl);
/* For old library format--tests for alignment */
- for(curr_test = TEST_NORMAL; curr_test < TEST_NTESTS; H5_INC_ENUM(test_type_t, curr_test)) {
+ for(curr_test = TEST_NORMAL; curr_test < TEST_NTESTS; curr_test++) {
switch(curr_test) {
case TEST_NORMAL: /* set alignment = 1024 */
@@ -8956,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 */
@@ -8964,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:
@@ -8984,18 +8960,25 @@ main(void)
FAIL_STACK_ERROR
h5_cleanup(FILENAME, fapl);
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
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);
} H5E_END_TRY;
+
+ if(api_ctx_pushed) H5CX_pop();
+
return(1);
} /* main() */
diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c
new file mode 100644
index 0000000..4da742f
--- /dev/null
+++ b/test/mirror_vfd.c
@@ -0,0 +1,2761 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Test the Mirror VFD functionality.
+ */
+
+/* WARNING: The use of realpath() is probably system-dependent, as are
+ * other things here such as the socket calls.
+ * Notable to realpath() in particular is the use of "PATH_MAX", which
+ * apparently has some major potential issues if paths are abused.
+ * http://insanecoding.blogspot.com/2007/11/pathmax-simply-isnt.html
+ * so BE CAREFUL about the paths we throw around?
+ */
+
+#include "h5test.h"
+#include "cache_common.h"
+#include "genall5.h"
+
+#ifdef H5_HAVE_MIRROR_VFD
+
+/* For future consideration, IP address and port number might be
+ * environment variables?
+ */
+#define SERVER_IP_ADDRESS "127.0.0.1"
+
+/* Primary listening port on server. */
+#define SERVER_HANDSHAKE_PORT 3000
+
+#define DATABUFFER_SIZE 128
+#define DSET_NAME_LEN 16
+
+/* Parameters for the "large chunked dataset" writing */
+#define MAX_DSET_COUNT 255
+#define DSET_DIM 32
+#define CHUNK_DIM 8
+
+#define CONCURRENT_COUNT 3 /* Number of files in concurrent test */
+
+/* Macro: LOGPRINT()
+ * Prints logging and debugging messages to the output stream based
+ * on the level of verbosity.
+ * 0 : no logging
+ * 1 : errors only
+ * 2 : details
+ * 3 : all
+ */
+#define DEFAULT_VERBOSITY 1
+static unsigned int g_verbosity = DEFAULT_VERBOSITY;
+
+/* Macro for selective debug printing / logging */
+#define LOGPRINT(lvl, ...) \
+do { \
+ if ((lvl) <= g_verbosity) { \
+ fprintf(g_log_stream, __VA_ARGS__); \
+ fflush(g_log_stream); \
+ } \
+} while (0)
+
+#define MIRROR_RW_DIR "mirror_rw/"
+#define MIRROR_WO_DIR "mirror_wo/"
+
+/* String buffer for error messages */
+#define MIRR_MESG_SIZE 128
+static char mesg[MIRR_MESG_SIZE + 1];
+
+/* Convenience structure for passing file names via helper functions.
+ */
+struct mirrortest_filenames {
+ char rw[H5FD_SPLITTER_PATH_MAX+1];
+ char wo[H5FD_SPLITTER_PATH_MAX+1];
+ char log[H5FD_SPLITTER_PATH_MAX+1];
+};
+
+static FILE *g_log_stream = NULL; /* initialized at runtime */
+
+static herr_t _verify_datasets(unsigned min_dset, unsigned max_dset,
+ hid_t *filespace_id, hid_t *dataset_id, hid_t memspace_id);
+
+static herr_t _create_chunking_ids(hid_t file_id, unsigned min_dset,
+ unsigned max_dset, hsize_t *chunk_dims, hsize_t *dset_dims,
+ hid_t *dataspace_ids, hid_t *filespace_ids, hid_t *dataset_ids,
+ hid_t *memspace_id);
+
+static herr_t _close_chunking_ids(unsigned min_dset, unsigned max_dset,
+ hid_t *dataspace_ids, hid_t *filespace_ids, hid_t *dataset_ids,
+ hid_t *memspace_id);
+
+static herr_t _populate_filepath(const char *dirname, const char *_basename,
+ hid_t fapl_id, char *path_out, hbool_t h5suffix);
+
+static hid_t create_mirroring_split_fapl(const char *_basename,
+ struct mirrortest_filenames *names);
+
+static void mybzero(void *dest, size_t size);
+
+
+/* ----------------------------------------------------------------------------
+ * Function: mybzero
+ *
+ * Purpose: Have bzero simplicity and abstraction in (possible) absence of
+ * it being available.
+ *
+ * Programmer: Jacob Smith
+ * 2020-03-30
+ * ----------------------------------------------------------------------------
+ */
+static void
+mybzero(void *dest, size_t size)
+{
+ size_t i = 0;
+ char *s = NULL;
+ HDassert(dest != NULL);
+ s = (char *)dest;
+ for (i = 0; i < size; i++) {
+ *(s+i) = 0;
+ }
+} /* end mybzero() */
+
+
+/* ----------------------------------------------------------------------------
+ * Function: _populate_filepath
+ *
+ * Purpose: Given a directory name and a base name, concatenate the two and
+ * run h5fixname() to get the "actual" path to the intented target.
+ * `h5suffix' should be FALSE to keep the base name unaltered;
+ * TRUE will append the '.h5' h5suffix to the basename...
+ * FALSE -> h5fixname_no_suffix(), TRUE -> h5fixname()
+ * <h5fixname_prefix> / <dirname> / <_basename> <h5prefix?>
+ *
+ * Programmer: Jacob Smith
+ * 2019-08-16
+ * ----------------------------------------------------------------------------
+ */
+static herr_t
+_populate_filepath(const char *dirname, const char *_basename, hid_t fapl_id,
+ char *path_out, hbool_t h5suffix)
+{
+ char _path[H5FD_SPLITTER_PATH_MAX];
+
+ if ((_basename == NULL) ||
+ (*_basename == 0) ||
+ (dirname == NULL) ||
+ (*dirname == 0) ||
+ (path_out == NULL))
+ {
+ TEST_ERROR;
+ }
+
+ if (HDsnprintf(_path, H5FD_SPLITTER_PATH_MAX, "%s%s%s", dirname,
+ (dirname[strlen(dirname)] == '/') ? "" : "/", /* slash iff needed */
+ _basename)
+ > H5FD_SPLITTER_PATH_MAX)
+ {
+ TEST_ERROR;
+ }
+
+ if (h5suffix == TRUE) {
+ if (h5_fixname(_path, fapl_id, path_out,
+ H5FD_SPLITTER_PATH_MAX)
+ == NULL)
+ {
+ TEST_ERROR;
+ }
+ }
+ else {
+ if (h5_fixname_no_suffix(_path, fapl_id, path_out,
+ H5FD_SPLITTER_PATH_MAX)
+ == NULL)
+ {
+ TEST_ERROR;
+ }
+ }
+
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end _populate_filepath() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: build_paths
+ *
+ * Purpose: Convenience function to create the three file paths used in
+ * most mirror tests.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2019-08-16
+ * ---------------------------------------------------------------------------
+ */
+static herr_t
+build_paths(
+ const char *_basename,
+ H5FD_splitter_vfd_config_t *splitter_config,
+ struct mirrortest_filenames *names)
+{
+ char baselogname[H5FD_SPLITTER_PATH_MAX];
+
+ if (_populate_filepath(MIRROR_RW_DIR, _basename,
+ splitter_config->rw_fapl_id, names->rw, TRUE)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ if (_populate_filepath(MIRROR_WO_DIR, _basename,
+ splitter_config->wo_fapl_id, names->wo, TRUE)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ if (_basename == NULL || *_basename == 0)
+ return FAIL;
+ if (HDsnprintf(baselogname, H5FD_SPLITTER_PATH_MAX, "%s_err.log",
+ _basename)
+ > H5FD_SPLITTER_PATH_MAX)
+ {
+ TEST_ERROR;
+ }
+
+ if (_populate_filepath(MIRROR_WO_DIR, baselogname,
+ splitter_config->wo_fapl_id, names->log, FALSE)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ return SUCCEED;
+
+error:
+ return FAIL;
+} /* end build_paths() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_fapl_configuration
+ *
+ * Purpose: Test FAPL configuration and examination.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2019-03-12
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_fapl_configuration(void)
+{
+ hid_t fapl_id;
+ H5FD_mirror_fapl_t mirror_conf = {
+ H5FD_MIRROR_FAPL_MAGIC, /* magic */
+ H5FD_MIRROR_CURR_FAPL_T_VERSION, /* version */
+ SERVER_HANDSHAKE_PORT, /* handhake_port */
+ SERVER_IP_ADDRESS, /* remote_ip "IP address" */
+ };
+ H5FD_mirror_fapl_t fa_out = {0, 0, 0, ""};
+
+ TESTING("Mirror fapl configuration (set/get)");
+
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5I_INVALID_HID == fapl_id) {
+ TEST_ERROR;
+ }
+
+ if (H5Pset_fapl_mirror(fapl_id, &mirror_conf) == FAIL) {
+ TEST_ERROR;
+ }
+
+ if (H5Pget_fapl_mirror(fapl_id, &fa_out) == FAIL) {
+ TEST_ERROR;
+ }
+ if (H5FD_MIRROR_FAPL_MAGIC != fa_out.magic) {
+ TEST_ERROR;
+ }
+ if (H5FD_MIRROR_CURR_FAPL_T_VERSION != fa_out.version) {
+ TEST_ERROR;
+ }
+ if (SERVER_HANDSHAKE_PORT != fa_out.handshake_port) {
+ TEST_ERROR;
+ }
+ if (HDstrncmp(SERVER_IP_ADDRESS, (const char *)fa_out.remote_ip,
+ H5FD_MIRROR_MAX_IP_LEN))
+ {
+ TEST_ERROR;
+ }
+
+ if (H5Pclose(fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ if (H5I_INVALID_HID != fapl_id) {
+ (void)H5Pclose(fapl_id);
+ }
+ return -1;
+} /* end test_fapl_configuration() */
+
+
+
+#define PRINT_BUFFER_DIFF(act, exp, len) do { \
+ size_t _x = 0; \
+ while ((act)[_x] == (exp)[_x]) { \
+ _x++; \
+ } \
+ if (_x != (len)) { \
+ size_t _y = 0; \
+ HDprintf("First bytes differ at %zu\n", _x); \
+ HDprintf("exp "); \
+ for (_y = _x; _y < (len); _y++) { \
+ HDprintf("%02X", (unsigned char)(exp)[_y]); \
+ } \
+ HDprintf("\nact "); \
+ for (_y = _x; _y < (len); _y++) { \
+ HDprintf("%02X", (unsigned char)(act)[_y]); \
+ } \
+ HDprintf("\n"); \
+ } \
+} while (0); /* end PRINT_BUFFER_DIFF */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_xmit_encode_decode
+ *
+ * Purpose: Test byte-encoding operations for network transport.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2020-02-02
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_xmit_encode_decode(void)
+{
+ H5FD_mirror_xmit_t xmit_mock; /* re-used header in various xmit tests */
+
+ TESTING("Mirror encode/decode of xmit elements");
+
+ /* Set bogus values matching expected; encoding doesn't care
+ * Use sequential values to easily generate the expected buffer with a
+ * for loop.
+ */
+ xmit_mock.magic = 0x00010203;
+ xmit_mock.version = 0x04;
+ xmit_mock.session_token = 0x05060708;
+ xmit_mock.xmit_count = 0x090A0B0C;
+ xmit_mock.op = 0x0D;
+
+ /* Test uint8_t encode/decode
+ */
+ do {
+ unsigned char buf[8];
+ unsigned char expected[8];
+ const uint8_t v = 200;
+ unsigned char out = 0;
+
+ /* Start of buffer uint8_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[0] = 200;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint8(buf, v) != 1) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint8(&out, buf) != 1) {
+ TEST_ERROR;
+ }
+ if (v != out) {
+ TEST_ERROR;
+ }
+
+ /* Middle of buffer uint8_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[3] = v;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint8((buf+3), v) != 1) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint8(&out, (buf+3)) != 1) {
+ TEST_ERROR;
+ }
+ if (v != out) {
+ TEST_ERROR;
+ }
+
+ /* End of buffer uint8_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[7] = v;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint8((buf+7), v) != 1) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint8(&out, (buf+7)) != 1) {
+ TEST_ERROR;
+ }
+ if (v != out) {
+ TEST_ERROR;
+ }
+
+ } while (0); /* end uint8_t en/decode */
+
+ /* Test uint16_t encode/decode
+ */
+ do {
+ unsigned char buf[8];
+ unsigned char expected[8];
+ const uint16_t v = 0x8F02;
+ uint16_t out = 0;
+
+ /* Start of buffer uint16_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[0] = 0x8F;
+ expected[1] = 0x02;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint16(buf, v) != 2) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint16(&out, buf) != 2) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+
+ /* Middle of buffer uint16_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[3] = 0x8F;
+ expected[4] = 0x02;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint16((buf+3), v) != 2) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint16(&out, (buf+3)) != 2) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+ /* slice */
+ if (H5FD__mirror_xmit_decode_uint16(&out, (buf+4)) != 2) {
+ TEST_ERROR;
+ }
+ if (out != 0x0200) {
+ TEST_ERROR;
+ }
+
+ /* End of buffer uint16_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[6] = 0x8F;
+ expected[7] = 0x02;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint16((buf+6), v) != 2) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint16(&out, (buf+6)) != 2) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+
+ } while (0); /* end uint16_t en/decode */
+
+ /* Test uint32_t encode/decode
+ */
+ do {
+ unsigned char buf[8];
+ unsigned char expected[8];
+ const uint32_t v = 0x8F020048;
+ uint32_t out = 0;
+
+ /* Start of buffer uint32_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[0] = 0x8F;
+ expected[1] = 0x02;
+ expected[2] = 0x00;
+ expected[3] = 0x48;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint32(buf, v) != 4) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint32(&out, buf) != 4) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+
+ /* Middle of buffer uint32_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[3] = 0x8F;
+ expected[4] = 0x02;
+ expected[5] = 0x00;
+ expected[6] = 0x48;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint32((buf+3), v) != 4) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint32(&out, (buf+3)) != 4) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+ /* slice */
+ if (H5FD__mirror_xmit_decode_uint32(&out, (buf+4)) != 4) {
+ TEST_ERROR;
+ }
+ if (out != 0x02004800) {
+ TEST_ERROR;
+ }
+
+ /* End of buffer uint32_t
+ */
+ mybzero(buf, 8);
+ mybzero(expected, 8);
+ expected[4] = 0x8F;
+ expected[5] = 0x02;
+ expected[6] = 0x00;
+ expected[7] = 0x48;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint32((buf+4), v) != 4) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 8);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint32(&out, (buf+4)) != 4) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+
+ } while (0); /* end uint32_t en/decode */
+
+ /* Test uint64_t encode/decode
+ */
+ do {
+ unsigned char buf[16];
+ unsigned char expected[16];
+ const uint64_t v = 0x90DCBE17939CE4BB;
+ uint64_t out = 0;
+
+ /* Start of buffer uint64_t
+ */
+ mybzero(buf, 16);
+ mybzero(expected, 16);
+ expected[0] = 0x90;
+ expected[1] = 0xDC;
+ expected[2] = 0xBE;
+ expected[3] = 0x17;
+ expected[4] = 0x93;
+ expected[5] = 0x9C;
+ expected[6] = 0xE4;
+ expected[7] = 0xBB;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint64(buf, v) != 8) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 16) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 16);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint64(&out, buf) != 8) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+
+ /* Middle of buffer uint64_t
+ */
+ mybzero(buf, 16);
+ mybzero(expected, 16);
+ expected[3] = 0x90;
+ expected[4] = 0xDC;
+ expected[5] = 0xBE;
+ expected[6] = 0x17;
+ expected[7] = 0x93;
+ expected[8] = 0x9C;
+ expected[9] = 0xE4;
+ expected[10] = 0xBB;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint64((buf+3), v) != 8) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 16) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 16);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint64(&out, (buf+3)) != 8) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+ /* slice */
+ if (H5FD__mirror_xmit_decode_uint64(&out, (buf+6)) != 8) {
+ TEST_ERROR;
+ }
+ if (out != 0x17939CE4BB000000) {
+ TEST_ERROR;
+ }
+
+ /* End of buffer uint64_t
+ */
+ mybzero(buf, 16);
+ mybzero(expected, 16);
+ expected[8] = 0x90;
+ expected[9] = 0xDC;
+ expected[10] = 0xBE;
+ expected[11] = 0x17;
+ expected[12] = 0x93;
+ expected[13] = 0x9C;
+ expected[14] = 0xE4;
+ expected[15] = 0xBB;
+ out = 0;
+ if (H5FD__mirror_xmit_encode_uint64((buf+8), v) != 8) {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, 16) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, 16);
+ TEST_ERROR;
+ }
+ if (H5FD__mirror_xmit_decode_uint64(&out, (buf+8)) != 8) {
+ TEST_ERROR;
+ }
+ if (out != v) {
+ TEST_ERROR;
+ }
+
+ } while (0); /* end uint64_t en/decode */
+
+ /* Test xmit header structure encode/decode
+ * Write bogus but easily verifiable data to inside a buffer, and compare.
+ * Then decode the buffer and compare the structure contents.
+ * Then repeat from a different offset in the buffer and compare.
+ */
+ do {
+ unsigned char buf[H5FD_MIRROR_XMIT_HEADER_SIZE+8];
+ unsigned char expected[H5FD_MIRROR_XMIT_HEADER_SIZE+8];
+ H5FD_mirror_xmit_t xmit_out;
+ size_t i = 0;
+
+ /* sanity check */
+ if (14 != H5FD_MIRROR_XMIT_HEADER_SIZE) {
+ FAIL_PUTS_ERROR("Header size definition does not match test\n");
+ }
+
+ /* Populate the expected buffer; expect end padding of 0xFF
+ */
+ HDmemset(expected, 0xFF, H5FD_MIRROR_XMIT_HEADER_SIZE+8);
+ for (i=0; i < H5FD_MIRROR_XMIT_HEADER_SIZE; i++) {
+ expected[i+2] = (unsigned char)i;
+ }
+
+ /* Encode, and compare buffer contents
+ * Initial buffer is filled with 0xFF to match expected padding
+ */
+ HDmemset(buf, 0xFF, H5FD_MIRROR_XMIT_HEADER_SIZE+8);
+ if (H5FD_mirror_xmit_encode_header((buf+2), &xmit_mock)
+ != H5FD_MIRROR_XMIT_HEADER_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, H5FD_MIRROR_XMIT_HEADER_SIZE+8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, H5FD_MIRROR_XMIT_HEADER_SIZE+8);
+ TEST_ERROR;
+ }
+
+ /* Decode from buffer
+ */
+ if (H5FD_mirror_xmit_decode_header(&xmit_out, (buf+2))
+ != H5FD_MIRROR_XMIT_HEADER_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.magic != xmit_mock.magic) TEST_ERROR;
+ if (xmit_out.version != xmit_mock.version) TEST_ERROR;
+ if (xmit_out.session_token != xmit_mock.session_token) TEST_ERROR;
+ if (xmit_out.xmit_count != xmit_mock.xmit_count) TEST_ERROR;
+ if (xmit_out.op != xmit_mock.op) TEST_ERROR;
+
+ /* Decode from different offset in buffer
+ * Observe changes when ingesting the padding
+ */
+ if (H5FD_mirror_xmit_decode_header(&xmit_out, (buf))
+ != H5FD_MIRROR_XMIT_HEADER_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.magic != 0xFFFF0001) TEST_ERROR;
+ if (xmit_out.version != 0x02) TEST_ERROR;
+ if (xmit_out.session_token != 0x03040506) TEST_ERROR;
+ if (xmit_out.xmit_count != 0x0708090A) TEST_ERROR;
+ if (xmit_out.op != 0x0B) TEST_ERROR;
+
+ } while (0); /* end xmit header en/decode */
+
+ /* Test xmit set-eoa structure encode/decode
+ * Write bogus but easily verifiable data to inside a buffer, and compare.
+ * Then decode the buffer and compare the structure contents.
+ * Then repeat from a different offset in the buffer and compare.
+ */
+ do {
+ unsigned char buf[H5FD_MIRROR_XMIT_EOA_SIZE+8];
+ unsigned char expected[H5FD_MIRROR_XMIT_EOA_SIZE+8];
+ H5FD_mirror_xmit_eoa_t xmit_in;
+ H5FD_mirror_xmit_eoa_t xmit_out;
+ size_t i = 0;
+
+ /* sanity check */
+ if ((14+9) != H5FD_MIRROR_XMIT_EOA_SIZE) {
+ FAIL_PUTS_ERROR("Header size definition does not match test\n");
+ }
+ if (xmit_mock.op != 0x0D) {
+ FAIL_PUTS_ERROR("shared header structure is not in expected state");
+ }
+
+ /* Populate the expected buffer; expect end padding of 0xFF
+ */
+ HDmemset(expected, 0xFF, H5FD_MIRROR_XMIT_EOA_SIZE+8);
+ for (i=0; i < H5FD_MIRROR_XMIT_EOA_SIZE; i++) {
+ expected[i+2] = (unsigned char)i;
+ }
+
+ /* Set xmit_in
+ */
+ xmit_in.pub = xmit_mock; /* shared/common */
+ xmit_in.type = 0x0E;
+ xmit_in.eoa_addr = 0x0F10111213141516;
+
+ /* Encode, and compare buffer contents
+ * Initial buffer is filled with 0xFF to match expected padding
+ */
+ HDmemset(buf, 0xFF, H5FD_MIRROR_XMIT_EOA_SIZE+8);
+ if (H5FD_mirror_xmit_encode_set_eoa((buf+2), &xmit_in)
+ != H5FD_MIRROR_XMIT_EOA_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, H5FD_MIRROR_XMIT_EOA_SIZE+8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, H5FD_MIRROR_XMIT_EOA_SIZE+8);
+ TEST_ERROR;
+ }
+
+ /* Decode from buffer
+ */
+ if (H5FD_mirror_xmit_decode_set_eoa(&xmit_out, (buf+2))
+ != H5FD_MIRROR_XMIT_EOA_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != xmit_mock.magic) TEST_ERROR;
+ if (xmit_out.pub.version != xmit_mock.version) TEST_ERROR;
+ if (xmit_out.pub.session_token != xmit_mock.session_token) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != xmit_mock.xmit_count) TEST_ERROR;
+ if (xmit_out.pub.op != xmit_mock.op) TEST_ERROR;
+ if (xmit_out.type != 0x0E) TEST_ERROR;
+ if (xmit_out.eoa_addr != 0x0F10111213141516) TEST_ERROR;
+
+ /* Decode from different offset in buffer
+ * Observe changes when ingesting the padding
+ */
+ if (H5FD_mirror_xmit_decode_set_eoa(&xmit_out, (buf))
+ != H5FD_MIRROR_XMIT_EOA_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != 0xFFFF0001) TEST_ERROR;
+ if (xmit_out.pub.version != 0x02) TEST_ERROR;
+ if (xmit_out.pub.session_token != 0x03040506) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != 0x0708090A) TEST_ERROR;
+ if (xmit_out.pub.op != 0x0B) TEST_ERROR;
+ if (xmit_out.type != 0x0C) TEST_ERROR;
+ if (xmit_out.eoa_addr != 0x0D0E0F1011121314) TEST_ERROR;
+
+ } while (0); /* end xmit set-eoa en/decode */
+
+ /* Test xmit lock structure encode/decode
+ * Write bogus but easily verifiable data to inside a buffer, and compare.
+ * Then decode the buffer and compare the structure contents.
+ * Then repeat from a different offset in the buffer and compare.
+ */
+ do {
+ unsigned char buf[H5FD_MIRROR_XMIT_LOCK_SIZE+8];
+ unsigned char expected[H5FD_MIRROR_XMIT_LOCK_SIZE+8];
+ H5FD_mirror_xmit_lock_t xmit_in;
+ H5FD_mirror_xmit_lock_t xmit_out;
+ size_t i = 0;
+
+ /* sanity check */
+ if ((14+8) != H5FD_MIRROR_XMIT_LOCK_SIZE) {
+ FAIL_PUTS_ERROR("Header size definition does not match test\n");
+ }
+ if (xmit_mock.op != 0x0D) {
+ FAIL_PUTS_ERROR("shared header structure is not in expected state");
+ }
+
+ /* Populate the expected buffer; expect end padding of 0xFF
+ */
+ HDmemset(expected, 0xFF, H5FD_MIRROR_XMIT_LOCK_SIZE+8);
+ for (i=0; i < H5FD_MIRROR_XMIT_LOCK_SIZE; i++) {
+ expected[i+2] = (unsigned char)i;
+ }
+
+ /* Set xmit_in
+ */
+ xmit_in.pub = xmit_mock; /* shared/common */
+ xmit_in.rw = 0x0E0F101112131415;
+
+ /* Encode, and compare buffer contents
+ * Initial buffer is filled with 0xFF to match expected padding
+ */
+ HDmemset(buf, 0xFF, H5FD_MIRROR_XMIT_LOCK_SIZE+8);
+ if (H5FD_mirror_xmit_encode_lock((buf+2), &xmit_in)
+ != H5FD_MIRROR_XMIT_LOCK_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, H5FD_MIRROR_XMIT_LOCK_SIZE+8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, H5FD_MIRROR_XMIT_LOCK_SIZE+8);
+ TEST_ERROR;
+ }
+
+ /* Decode from buffer
+ */
+ if (H5FD_mirror_xmit_decode_lock(&xmit_out, (buf+2))
+ != H5FD_MIRROR_XMIT_LOCK_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != xmit_mock.magic) TEST_ERROR;
+ if (xmit_out.pub.version != xmit_mock.version) TEST_ERROR;
+ if (xmit_out.pub.session_token != xmit_mock.session_token) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != xmit_mock.xmit_count) TEST_ERROR;
+ if (xmit_out.pub.op != xmit_mock.op) TEST_ERROR;
+ if (xmit_out.rw != 0x0E0F101112131415) TEST_ERROR;
+
+ /* Decode from different offset in buffer
+ * Observe changes when ingesting the padding
+ */
+ if (H5FD_mirror_xmit_decode_lock(&xmit_out, (buf))
+ != H5FD_MIRROR_XMIT_LOCK_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != 0xFFFF0001) TEST_ERROR;
+ if (xmit_out.pub.version != 0x02) TEST_ERROR;
+ if (xmit_out.pub.session_token != 0x03040506) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != 0x0708090A) TEST_ERROR;
+ if (xmit_out.pub.op != 0x0B) TEST_ERROR;
+ if (xmit_out.rw != 0x0C0D0E0F10111213) TEST_ERROR;
+
+ } while (0); /* end xmit lock en/decode */
+
+ /* Test xmit open structure encode/decode
+ * Write bogus but easily verifiable data to inside a buffer, and compare.
+ * Then decode the buffer and compare the structure contents.
+ * Then repeat from a different offset in the buffer and compare.
+ *
+ * Verifies that the first zero character in the filepath will end the
+ * string, with all following bytes in the encoded buffer being zeroed.
+ */
+ do {
+ unsigned char buf[H5FD_MIRROR_XMIT_OPEN_SIZE+8];
+ unsigned char expected[H5FD_MIRROR_XMIT_OPEN_SIZE+8];
+ H5FD_mirror_xmit_open_t xmit_in;
+ H5FD_mirror_xmit_open_t xmit_out;
+ size_t i = 0;
+
+ /* sanity check */
+ if ((14+20+4097) != H5FD_MIRROR_XMIT_OPEN_SIZE) {
+ FAIL_PUTS_ERROR("Header size definition does not match test\n");
+ }
+ if (xmit_mock.op != 0x0D) {
+ FAIL_PUTS_ERROR("shared header structure is not in expected state");
+ }
+
+ /* Populate the expected buffer; expect end padding of 0xFF
+ */
+ HDmemset(expected, 0xFF, H5FD_MIRROR_XMIT_OPEN_SIZE+8);
+ for (i=0; i < H5FD_MIRROR_XMIT_OPEN_SIZE; i++) {
+ /* 0x100 is "zero" in a byte, so encode will treat it as a NULL-
+ * terminator in the filepath string. Expect all zeroes following.
+ */
+ expected[i+2] = (i > 0xFF) ? 0 : (unsigned char)i;
+ }
+
+ /* Set xmit_in
+ */
+ xmit_in.pub = xmit_mock; /* shared/common */
+ xmit_in.flags = 0x0E0F1011;
+ xmit_in.maxaddr = 0x1213141516171819;
+ xmit_in.size_t_blob = 0x1A1B1C1D1E1F2021;
+ for (i=0x22; i < H5FD_MIRROR_XMIT_FILEPATH_MAX+0x22; i++) {
+ /* nonzero values repeat after 0x100, but will not be encoded */
+ xmit_in.filename[i-0x22] = (char)(i % 0x100);
+ }
+ xmit_in.filename[H5FD_MIRROR_XMIT_FILEPATH_MAX-1] = 0;
+
+ /* Encode, and compare buffer contents
+ * Initial buffer is filled with 0xFF to match expected padding
+ */
+ HDmemset(buf, 0xFF, H5FD_MIRROR_XMIT_OPEN_SIZE+8);
+ if (H5FD_mirror_xmit_encode_open((buf+2), &xmit_in)
+ != H5FD_MIRROR_XMIT_OPEN_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, H5FD_MIRROR_XMIT_OPEN_SIZE+8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, H5FD_MIRROR_XMIT_OPEN_SIZE+8);
+ TEST_ERROR;
+ }
+
+ /* Decode from buffer
+ */
+ if (H5FD_mirror_xmit_decode_open(&xmit_out, (buf+2))
+ != H5FD_MIRROR_XMIT_OPEN_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != xmit_mock.magic) TEST_ERROR;
+ if (xmit_out.pub.version != xmit_mock.version) TEST_ERROR;
+ if (xmit_out.pub.session_token != xmit_mock.session_token) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != xmit_mock.xmit_count) TEST_ERROR;
+ if (xmit_out.pub.op != xmit_mock.op) TEST_ERROR;
+ if (xmit_out.flags != xmit_in.flags) TEST_ERROR;
+ if (xmit_out.maxaddr != xmit_in.maxaddr) TEST_ERROR;
+ if (xmit_out.size_t_blob != xmit_in.size_t_blob) TEST_ERROR;
+ if (HDstrncmp(xmit_out.filename, xmit_in.filename,
+ H5FD_MIRROR_XMIT_FILEPATH_MAX)
+ != 0)
+ {
+ PRINT_BUFFER_DIFF(xmit_out.filename, xmit_in.filename,
+ H5FD_MIRROR_XMIT_FILEPATH_MAX);
+ TEST_ERROR;
+ }
+
+ /* Decode from different offset in buffer
+ * Observe changes when ingesting the padding
+ */
+ if (H5FD_mirror_xmit_decode_open(&xmit_out, (buf))
+ != H5FD_MIRROR_XMIT_OPEN_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != 0xFFFF0001) TEST_ERROR;
+ if (xmit_out.pub.version != 0x02) TEST_ERROR;
+ if (xmit_out.pub.session_token != 0x03040506) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != 0x0708090A) TEST_ERROR;
+ if (xmit_out.pub.op != 0x0B) TEST_ERROR;
+ if (xmit_out.flags != 0x0C0D0E0F) TEST_ERROR;
+ if (xmit_out.maxaddr != 0x1011121314151617) TEST_ERROR;
+ if (xmit_out.size_t_blob != 0x18191A1B1C1D1E1F) TEST_ERROR;
+ /* update expected "filepath" in structure */
+ for (i=0x20; i < H5FD_MIRROR_XMIT_FILEPATH_MAX+0x20; i++) {
+ xmit_in.filename[i-0x20] = (i > 0xFF) ? 0 : (char)i;
+ }
+ if (HDstrncmp(xmit_out.filename, xmit_in.filename,
+ H5FD_MIRROR_XMIT_FILEPATH_MAX)
+ != 0)
+ {
+ PRINT_BUFFER_DIFF(xmit_out.filename, xmit_in.filename,
+ H5FD_MIRROR_XMIT_FILEPATH_MAX);
+ TEST_ERROR;
+ }
+
+ } while (0); /* end xmit open en/decode */
+
+ /* Test xmit reply structure encode/decode
+ * Write bogus but easily verifiable data to inside a buffer, and compare.
+ * Then decode the buffer and compare the structure contents.
+ * Then repeat from a different offset in the buffer and compare.
+ *
+ * Verifies that the first zero character in the filepath will end the
+ * string, with all following bytes in the encoded buffer being zeroed.
+ */
+ do {
+ unsigned char buf[H5FD_MIRROR_XMIT_REPLY_SIZE+8];
+ unsigned char expected[H5FD_MIRROR_XMIT_REPLY_SIZE+8];
+ H5FD_mirror_xmit_reply_t xmit_in;
+ H5FD_mirror_xmit_reply_t xmit_out;
+ size_t i = 0;
+
+ /* sanity check */
+ if ((14+4+256) != H5FD_MIRROR_XMIT_REPLY_SIZE) {
+ FAIL_PUTS_ERROR("Header size definition does not match test\n");
+ }
+ if (xmit_mock.op != 0x0D) {
+ FAIL_PUTS_ERROR("shared header structure is not in expected state");
+ }
+
+ /* Populate the expected buffer; expect end padding of 0xFF
+ */
+ HDmemset(expected, 0xFF, H5FD_MIRROR_XMIT_REPLY_SIZE+8);
+ for (i=0; i < H5FD_MIRROR_XMIT_REPLY_SIZE; i++) {
+ /* 0x100 is "zero" in a byte, so encode will treat it as a NULL-
+ * terminator in the filepath string. Expect all zeroes following.
+ */
+ expected[i+2] = (i > 0xFF) ? 0 : (unsigned char)i;
+ }
+
+ /* Set xmit_in
+ */
+ xmit_in.pub = xmit_mock; /* shared/common */
+ xmit_in.status = 0x0E0F1011;
+ for (i=0x12; i < H5FD_MIRROR_STATUS_MESSAGE_MAX+0x12; i++) {
+ /* nonzero values repeat after 0x100, but will not be encoded */
+ xmit_in.message[i-0x12] = (char)(i % 0x100);
+ }
+ xmit_in.message[H5FD_MIRROR_STATUS_MESSAGE_MAX-1] = 0;
+
+ /* Encode, and compare buffer contents
+ * Initial buffer is filled with 0xFF to match expected padding
+ */
+ HDmemset(buf, 0xFF, H5FD_MIRROR_XMIT_REPLY_SIZE+8);
+ if (H5FD_mirror_xmit_encode_reply((buf+2), &xmit_in)
+ != H5FD_MIRROR_XMIT_REPLY_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, H5FD_MIRROR_XMIT_REPLY_SIZE+8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, H5FD_MIRROR_XMIT_REPLY_SIZE+8);
+ TEST_ERROR;
+ }
+
+ /* Decode from buffer
+ */
+ if (H5FD_mirror_xmit_decode_reply(&xmit_out, (buf+2))
+ != H5FD_MIRROR_XMIT_REPLY_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != xmit_mock.magic) TEST_ERROR;
+ if (xmit_out.pub.version != xmit_mock.version) TEST_ERROR;
+ if (xmit_out.pub.session_token != xmit_mock.session_token) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != xmit_mock.xmit_count) TEST_ERROR;
+ if (xmit_out.pub.op != xmit_mock.op) TEST_ERROR;
+ if (xmit_out.status != xmit_in.status) TEST_ERROR;
+ if (HDstrncmp(xmit_out.message, xmit_in.message,
+ H5FD_MIRROR_STATUS_MESSAGE_MAX)
+ != 0)
+ {
+ PRINT_BUFFER_DIFF(xmit_out.message, xmit_in.message,
+ H5FD_MIRROR_STATUS_MESSAGE_MAX);
+ TEST_ERROR;
+ }
+
+ /* Decode from different offset in buffer
+ * Observe changes when ingesting the padding
+ */
+ if (H5FD_mirror_xmit_decode_reply(&xmit_out, (buf))
+ != H5FD_MIRROR_XMIT_REPLY_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != 0xFFFF0001) TEST_ERROR;
+ if (xmit_out.pub.version != 0x02) TEST_ERROR;
+ if (xmit_out.pub.session_token != 0x03040506) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != 0x0708090A) TEST_ERROR;
+ if (xmit_out.pub.op != 0x0B) TEST_ERROR;
+ if (xmit_out.status != 0x0C0D0E0F) TEST_ERROR;
+ /* update expected "message" in structure */
+ for (i=0x10; i < H5FD_MIRROR_STATUS_MESSAGE_MAX+0x10; i++) {
+ xmit_in.message[i-0x10] = (i > 0xFF) ? 0 : (char)i;
+ }
+ if (HDstrncmp(xmit_out.message, xmit_in.message,
+ H5FD_MIRROR_STATUS_MESSAGE_MAX)
+ != 0)
+ {
+ PRINT_BUFFER_DIFF(xmit_out.message, xmit_in.message,
+ H5FD_MIRROR_STATUS_MESSAGE_MAX);
+ TEST_ERROR;
+ }
+
+ } while (0); /* end xmit reply en/decode */
+
+ /* Test xmit write structure encode/decode
+ * Write bogus but easily verifiable data to inside a buffer, and compare.
+ * Then decode the buffer and compare the structure contents.
+ * Then repeat from a different offset in the buffer and compare.
+ */
+ do {
+ unsigned char buf[H5FD_MIRROR_XMIT_WRITE_SIZE+8];
+ unsigned char expected[H5FD_MIRROR_XMIT_WRITE_SIZE+8];
+ H5FD_mirror_xmit_write_t xmit_in;
+ H5FD_mirror_xmit_write_t xmit_out;
+ size_t i = 0;
+
+ /* sanity check */
+ if ((14+17) != H5FD_MIRROR_XMIT_WRITE_SIZE) {
+ FAIL_PUTS_ERROR("Header size definition does not match test\n");
+ }
+ if (xmit_mock.op != 0x0D) {
+ FAIL_PUTS_ERROR("shared header structure is not in expected state");
+ }
+
+ /* Populate the expected buffer; expect end padding of 0xFF
+ */
+ HDmemset(expected, 0xFF, H5FD_MIRROR_XMIT_WRITE_SIZE+8);
+ for (i=0; i < H5FD_MIRROR_XMIT_WRITE_SIZE; i++) {
+ expected[i+2] = (unsigned char)i;
+ }
+
+ /* Set xmit_in
+ */
+ xmit_in.pub = xmit_mock; /* shared/common */
+ xmit_in.type = 0x0E;
+ xmit_in.offset = 0x0F10111213141516;
+ xmit_in.size = 0x1718191A1B1C1D1E;
+
+ /* Encode, and compare buffer contents
+ * Initial buffer is filled with 0xFF to match expected padding
+ */
+ HDmemset(buf, 0xFF, H5FD_MIRROR_XMIT_WRITE_SIZE+8);
+ if (H5FD_mirror_xmit_encode_write((buf+2), &xmit_in)
+ != H5FD_MIRROR_XMIT_WRITE_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (HDmemcmp(buf, expected, H5FD_MIRROR_XMIT_WRITE_SIZE+8) != 0) {
+ PRINT_BUFFER_DIFF(buf, expected, H5FD_MIRROR_XMIT_WRITE_SIZE+8);
+ TEST_ERROR;
+ }
+
+ /* Decode from buffer
+ */
+ if (H5FD_mirror_xmit_decode_write(&xmit_out, (buf+2))
+ != H5FD_MIRROR_XMIT_WRITE_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != xmit_mock.magic) TEST_ERROR;
+ if (xmit_out.pub.version != xmit_mock.version) TEST_ERROR;
+ if (xmit_out.pub.session_token != xmit_mock.session_token) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != xmit_mock.xmit_count) TEST_ERROR;
+ if (xmit_out.pub.op != xmit_mock.op) TEST_ERROR;
+ if (xmit_out.type != 0x0E) TEST_ERROR;
+ if (xmit_out.offset != 0x0F10111213141516) TEST_ERROR;
+ if (xmit_out.size != 0x1718191A1B1C1D1E) TEST_ERROR;
+
+ /* Decode from different offset in buffer
+ * Observe changes when ingesting the padding
+ */
+ if (H5FD_mirror_xmit_decode_write(&xmit_out, (buf))
+ != H5FD_MIRROR_XMIT_WRITE_SIZE)
+ {
+ TEST_ERROR;
+ }
+ if (xmit_out.pub.magic != 0xFFFF0001) TEST_ERROR;
+ if (xmit_out.pub.version != 0x02) TEST_ERROR;
+ if (xmit_out.pub.session_token != 0x03040506) TEST_ERROR;
+ if (xmit_out.pub.xmit_count != 0x0708090A) TEST_ERROR;
+ if (xmit_out.pub.op != 0x0B) TEST_ERROR;
+ if (xmit_out.type != 0x0C) TEST_ERROR;
+ if (xmit_out.offset != 0x0D0E0F1011121314) TEST_ERROR;
+ if (xmit_out.size != 0x15161718191A1B1C) TEST_ERROR;
+
+ } while (0); /* end xmit write en/decode */
+
+ PASSED();
+ return 0;
+
+error:
+ return -1;
+} /* end test_xmit_encode_decode */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: create_mirroring_split_fapl
+ *
+ * Purpose: Create and populate a mirroring FAPL ID.
+ * Creates target files with the given base name -- ideally the
+ * test name -- and creates mirroring/split FAPL set to use the
+ * global mirroring info and a sec2 R/W channel driver.
+ *
+ * TODO: receive target IP from caller?
+ *
+ * Return: Success: HID of the top-level (splitter) FAPL, a non-negative
+ * value.
+ * Failure: H5I_INVALID_HID, a negative value.
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static hid_t
+create_mirroring_split_fapl(const char *_basename,
+ struct mirrortest_filenames *names)
+{
+ H5FD_splitter_vfd_config_t splitter_config;
+ H5FD_mirror_fapl_t mirror_conf;
+ hid_t ret_value = H5I_INVALID_HID;
+
+ if (_basename == NULL || *_basename == '\0') {
+ TEST_ERROR;
+ }
+
+ splitter_config.magic = H5FD_SPLITTER_MAGIC;
+ splitter_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ splitter_config.ignore_wo_errs = FALSE;
+
+ /* Create Splitter R/W channel driver (sec2)
+ */
+ splitter_config.rw_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5I_INVALID_HID == splitter_config.rw_fapl_id) {
+ TEST_ERROR;
+ }
+ if (H5Pset_fapl_sec2(splitter_config.rw_fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* Create Splitter W/O channel driver (mirror)
+ */
+ mirror_conf.magic = H5FD_MIRROR_FAPL_MAGIC;
+ mirror_conf.version = H5FD_MIRROR_CURR_FAPL_T_VERSION;
+ mirror_conf.handshake_port = SERVER_HANDSHAKE_PORT;
+ if (HDstrncpy(mirror_conf.remote_ip, SERVER_IP_ADDRESS,
+ H5FD_MIRROR_MAX_IP_LEN)
+ == NULL)
+ {
+ TEST_ERROR;
+ }
+ splitter_config.wo_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5I_INVALID_HID == splitter_config.wo_fapl_id) {
+ TEST_ERROR;
+ }
+ if (H5Pset_fapl_mirror(splitter_config.wo_fapl_id, &mirror_conf) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* Build r/w, w/o, and log file paths
+ */
+ if (build_paths(_basename, &splitter_config, names) < 0) {
+ TEST_ERROR;
+ }
+
+ /* Set file paths for w/o and logfile
+ */
+ if (HDstrncpy(splitter_config.wo_path, (const char *)names->wo,
+ H5FD_SPLITTER_PATH_MAX)
+ == NULL)
+ {
+ TEST_ERROR;
+ }
+ if (HDstrncpy(splitter_config.log_file_path, (const char *)names->log,
+ H5FD_SPLITTER_PATH_MAX)
+ == NULL)
+ {
+ TEST_ERROR;
+ }
+
+ /* Create Splitter FAPL
+ */
+ ret_value = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5I_INVALID_HID == ret_value) {
+ TEST_ERROR;
+ }
+ if (H5Pset_fapl_splitter(ret_value, &splitter_config) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* Close FAPLs created for child channels
+ */
+ if (H5Pclose(splitter_config.rw_fapl_id) < 0) {
+ TEST_ERROR;
+ }
+ splitter_config.rw_fapl_id = H5I_INVALID_HID;
+ if (H5Pclose(splitter_config.wo_fapl_id) < 0) {
+ TEST_ERROR;
+ }
+ splitter_config.wo_fapl_id = H5I_INVALID_HID;
+
+ return ret_value;
+
+error:
+ if (splitter_config.wo_fapl_id >= 0) {
+ (void)H5Pclose(splitter_config.wo_fapl_id);
+ }
+ if (splitter_config.rw_fapl_id >= 0) {
+ (void)H5Pclose(splitter_config.rw_fapl_id);
+ }
+ if (ret_value >= 0) {
+ (void)H5Pclose(ret_value);
+ }
+ return H5I_INVALID_HID;
+} /* end create_mirroring_split_fapl() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_create_and_close
+ *
+ * Purpose: Test/demonstrate a do-nothing file open and close.
+ *
+ * Verifying file existence and contents is part of other tests.
+ *
+ * TODO: receive target IP from caller?
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2019-12-17
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_create_and_close(void)
+{
+ struct mirrortest_filenames names;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5P_DEFAULT;
+
+ TESTING("File creation and immediate close");
+
+ /* Create FAPL for Splitter[sec2|mirror]
+ */
+ fapl_id = create_mirroring_split_fapl("basic_create", &names);
+ if (H5I_INVALID_HID == fapl_id) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* TEST: Create and Close */
+
+ file_id = H5Fcreate(names.rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* Standard cleanup */
+
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (fapl_id != H5P_DEFAULT && fapl_id >= 0) {
+ if (H5Pclose(fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY{
+ (void)H5Fclose(file_id);
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ return -1;
+} /* end test_create_and_close() */
+
+
+/* ----------------------------------------------------------------------------
+ * Function: create_datasets
+ *
+ * Purpose: Given a file ID and least and greateset dataset indices, create
+ * populated chunked datasets in the target file from min_dset to
+ * (and including) max_dset.
+ * Uses #defined constants to determine chunk and dataset sizes
+ * and values.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2019-08-14
+ * ----------------------------------------------------------------------------
+ */
+static herr_t
+create_datasets(hid_t file_id,
+ unsigned min_dset,
+ unsigned max_dset)
+{
+ hid_t dataspace_ids[MAX_DSET_COUNT + 1];
+ hid_t dataset_ids[MAX_DSET_COUNT + 1];
+ hid_t filespace_ids[MAX_DSET_COUNT + 1];
+ int data_chunk[CHUNK_DIM][CHUNK_DIM];
+ unsigned int i, j, k, l, m;
+ hsize_t offset[2];
+ hid_t memspace_id = H5I_INVALID_HID;
+ hsize_t a_size[2] = {CHUNK_DIM, CHUNK_DIM};
+ hsize_t chunk_dims[2] = {CHUNK_DIM, CHUNK_DIM};
+ hsize_t dset_dims[2] = {DSET_DIM, DSET_DIM};
+
+ HDassert(file_id >= 0);
+ HDassert(min_dset <= max_dset);
+ HDassert(max_dset <= MAX_DSET_COUNT);
+
+ LOGPRINT(2, "create_dataset()\n");
+
+ /* ---------------------------------
+ * "Clear" ID arrays
+ */
+
+ for (i = 0; i < MAX_DSET_COUNT; i++) {
+ LOGPRINT(3, "clearing IDs [%d]\n", i);
+ dataspace_ids[i] = H5I_INVALID_HID;
+ dataset_ids[i] = H5I_INVALID_HID;
+ filespace_ids[i] = H5I_INVALID_HID;
+ }
+
+ /* ---------------------------------
+ * Generate dataspace, dataset, and 'filespace' IDs
+ */
+
+ if (_create_chunking_ids(file_id, min_dset, max_dset, chunk_dims,
+ dset_dims, dataspace_ids, filespace_ids, dataset_ids, &memspace_id)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ /* ---------------------------------
+ * Initialize (write) all datasets in a "round robin"...
+ * for a given chunk 'location', write chunk data to each dataset.
+ */
+
+ for (i = 0; i < DSET_DIM; i += CHUNK_DIM)
+ {
+ LOGPRINT(3, "i: %d\n", i);
+ for (j = 0; j < DSET_DIM; j += CHUNK_DIM)
+ {
+ LOGPRINT(3, " j: %d\n", j);
+ for (m = min_dset; m <= max_dset; m++)
+ {
+ LOGPRINT(3, " m: %d\n", m);
+ for (k = 0; k < CHUNK_DIM; k++)
+ {
+ for (l = 0; l < CHUNK_DIM; l++)
+ {
+ data_chunk[k][l] = (int)((DSET_DIM * DSET_DIM * m) +
+ (DSET_DIM * (i + k)) + j + l);
+ LOGPRINT(3, " data_chunk[%d][%d]: %d\n",
+ k, l, data_chunk[k][l]);
+ }
+ }
+
+ /* select on disk hyperslab */
+ offset[0] = (hsize_t)i;
+ offset[1] = (hsize_t)j;
+ LOGPRINT(3, " H5Sselect_hyperslab()\n");
+ if (H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
+ offset, NULL, a_size, NULL)
+ < 0)
+ {
+ TEST_ERROR;
+ }
+
+ LOGPRINT(3, " H5Dwrite()\n");
+ if (H5Dwrite(dataset_ids[m], H5T_NATIVE_INT, memspace_id,
+ filespace_ids[m], H5P_DEFAULT, data_chunk)
+ < 0)
+ {
+ TEST_ERROR;
+ }
+
+ }
+ }
+ }
+
+ /* ---------------------------------
+ * Read and verify data from datasets
+ */
+
+ if (_verify_datasets(min_dset, max_dset, filespace_ids, dataset_ids,
+ memspace_id)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ /* ---------------------------------
+ * Cleanup
+ */
+
+ if (_close_chunking_ids(min_dset, max_dset, dataspace_ids, filespace_ids,
+ dataset_ids, &memspace_id)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ return SUCCEED;
+
+error:
+ (void)_close_chunking_ids(min_dset, max_dset, dataspace_ids,
+ filespace_ids, dataset_ids, &memspace_id);
+ LOGPRINT(1, "create_datasets() FAILED\n");
+ return FAIL;
+} /* end create_datasets() */
+
+
+/* ----------------------------------------------------------------------------
+ * Function: _create_chunking_ids
+ *
+ * Purpose: Create new IDs to be used with the associated file.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programer: Jacob Smith
+ * 2019
+ * ----------------------------------------------------------------------------
+ */
+static herr_t
+_create_chunking_ids(hid_t file_id,
+ unsigned min_dset,
+ unsigned max_dset,
+ hsize_t *chunk_dims,
+ hsize_t *dset_dims,
+ hid_t *dataspace_ids,
+ hid_t *filespace_ids,
+ hid_t *dataset_ids,
+ hid_t *memspace_id)
+{
+ char dset_name[DSET_NAME_LEN + 1];
+ unsigned m = 0;
+ hid_t dcpl_id = H5I_INVALID_HID;
+
+ LOGPRINT(2, "_create_chunking_ids()\n");
+
+ /* --------------------
+ * Create chunking DCPL
+ */
+
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ if (dcpl_id < 0) {
+ TEST_ERROR;
+ }
+ if (H5Pset_chunk(dcpl_id, 2, chunk_dims) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* --------------------
+ * Create dataspace IDs
+ */
+
+ for (m = min_dset; m <= max_dset; m++) {
+ dataspace_ids[m] = H5Screate_simple(2, dset_dims, NULL);
+ if (dataspace_ids[m] < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to create dataspace ID %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+
+ /* --------------------
+ * Create dataset IDs
+ */
+
+ for (m = min_dset; m <= max_dset; m++) {
+ if (HDsnprintf(dset_name, DSET_NAME_LEN, "/dset%03d", m)
+ > DSET_NAME_LEN)
+ {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to compose dset name %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+
+ dataset_ids[m] = H5Dcreate(file_id, dset_name, H5T_STD_I32BE,
+ dataspace_ids[m], H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ if (dataset_ids[m] < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to create dset ID %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+
+ /* --------------------
+ * Get file space IDs
+ */
+
+ for (m = min_dset; m <= max_dset; m++) {
+ filespace_ids[m] = H5Dget_space(dataset_ids[m]);
+ if (filespace_ids[m] < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to create filespace ID %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+
+ /* --------------------
+ * Create mem space to be used to read and write chunks
+ */
+
+ *memspace_id = H5Screate_simple(2, chunk_dims, NULL);
+ if (*memspace_id < 0) {
+ TEST_ERROR;
+ }
+
+ /* --------------------
+ * Clean up the DCPL, even if there were errors before
+ */
+
+ if (dcpl_id != H5P_DEFAULT && dcpl_id != H5I_INVALID_HID) {
+ if (H5Pclose(dcpl_id) == FAIL) {
+ TEST_ERROR;
+ }
+ }
+
+ return SUCCEED;
+
+error:
+ if (dcpl_id != H5P_DEFAULT && dcpl_id != H5I_INVALID_HID) {
+ (void)H5Pclose(dcpl_id);
+ }
+ LOGPRINT(1, "_create_chunking_ids() FAILED\n");
+ return FAIL;
+} /* end _create_chunking_ids() */
+
+
+/* ----------------------------------------------------------------------------
+ * Function: _open_chunking_ids
+ *
+ * Purpose: Open/access IDs from the given file.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ----------------------------------------------------------------------------
+ */
+static herr_t
+_open_chunking_ids(
+ hid_t file_id,
+ unsigned min_dset,
+ unsigned max_dset,
+ hsize_t *chunk_dims,
+ hid_t *filespace_ids,
+ hid_t *dataset_ids,
+ hid_t *memspace_id)
+{
+ char dset_name[DSET_NAME_LEN+1];
+ unsigned m = 0;
+
+ LOGPRINT(2, "_open_chunking_ids()\n");
+
+ /* --------------------
+ * Open dataset IDs
+ */
+
+ for (m = min_dset; m <= max_dset; m++) {
+ if (HDsnprintf(dset_name, DSET_NAME_LEN, "/dset%03d", m)
+ > DSET_NAME_LEN)
+ {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to compose dset name %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+
+ dataset_ids[m] = H5Dopen2(file_id, dset_name, H5P_DEFAULT);
+ if (dataset_ids[m] < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE, "unable to open dset ID %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+
+ /* --------------------
+ * Open filespace IDs
+ */
+
+ for (m = min_dset; m <= max_dset; m++) {
+ filespace_ids[m] = H5Dget_space(dataset_ids[m]);
+ if (filespace_ids[m] < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to get filespace ID %d\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+
+ /* --------------------
+ * Create mem space to be used to read and write chunks
+ */
+
+ *memspace_id = H5Screate_simple(2, chunk_dims, NULL);
+ if (*memspace_id < 0) {
+ TEST_ERROR;
+ }
+
+ return SUCCEED;
+
+error:
+ LOGPRINT(1, "_open_chunking_ids() FAILED\n");
+ return FAIL;
+} /* end _open_chunking_ids() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: _close_chunking_ids
+ *
+ * Purpose: Close IDs that were created or opened.
+ * Pass NULL into `dataspace_ids` when closing items opened with
+ * _open_chunking_ids(). (as opposed to created IDs)
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static herr_t
+_close_chunking_ids(unsigned min_dset,
+ unsigned max_dset,
+ hid_t *dataspace_ids,
+ hid_t *filespace_ids,
+ hid_t *dataset_ids,
+ hid_t *memspace_id)
+{
+ unsigned m;
+
+ LOGPRINT(2, "_close_chunking_ids()\n");
+
+ for (m = min_dset; m <= max_dset; m++) {
+ LOGPRINT(3, "closing ids[%d]\n", m);
+ if (dataspace_ids) {
+ if (H5Sclose(dataspace_ids[m]) < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to close dataspace_id[%d]\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+ if (H5Dclose(dataset_ids[m]) < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to close dataset_id[%d]\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ if (H5Sclose(filespace_ids[m]) < 0) {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ "unable to close filespace_id[%d]\n", m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+
+ if ( (*memspace_id != H5I_INVALID_HID) &&
+ (H5Sclose(*memspace_id) < 0) )
+ {
+ TEST_ERROR;
+ }
+
+ return SUCCEED;
+
+error:
+ LOGPRINT(1, "_close_chunking_ids() FAILED\n");
+ return FAIL;
+} /* end _close_chunking_ids() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: _verify_datasets
+ *
+ * Purpose: Check that each chunk's contents are as expected, as pertaining
+ * to create_datasets().
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static herr_t
+_verify_datasets(unsigned min_dset,
+ unsigned max_dset,
+ hid_t *filespace_ids,
+ hid_t *dataset_ids,
+ hid_t memspace_id)
+{
+ unsigned i, j, k, l, m;
+ int data_chunk[CHUNK_DIM][CHUNK_DIM];
+ hsize_t offset[2];
+ hsize_t a_size[2] = {CHUNK_DIM, CHUNK_DIM};
+
+ LOGPRINT(2, "_verify_datasets()\n");
+
+ for (i = 0; i < DSET_DIM; i += CHUNK_DIM)
+ {
+ LOGPRINT(3, "i: %d\n", i);
+ for (j = 0; j < DSET_DIM; j += CHUNK_DIM)
+ {
+ LOGPRINT(3, " j: %d\n", j);
+ for (m = min_dset; m <= max_dset; m++)
+ {
+ LOGPRINT(3, " m: %d\n", m);
+
+ /* select on disk hyperslab */
+ offset[0] = (hsize_t)i;
+ offset[1] = (hsize_t)j;
+ if (H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
+ offset, NULL, a_size, NULL)
+ < 0)
+ {
+ TEST_ERROR;
+ }
+
+ if (H5Dread(dataset_ids[m], H5T_NATIVE_INT, memspace_id,
+ filespace_ids[m], H5P_DEFAULT, data_chunk)
+ < 0)
+ {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ " H5Dread() [%d][%d][%d]\n",
+ i, j, m);
+ FAIL_PUTS_ERROR(mesg);
+ }
+
+ for (k = 0; k < CHUNK_DIM; k++) {
+ for (l = 0; l < CHUNK_DIM; l++) {
+ if ((unsigned)data_chunk[k][l]
+ !=
+ ((DSET_DIM * DSET_DIM * m) +
+ (DSET_DIM * (i + k)) + j + l))
+ {
+ HDsnprintf(mesg, MIRR_MESG_SIZE,
+ " MISMATCH [%d][%d][%d][%d][%d]\n",
+ i, j, m, k, l);
+ FAIL_PUTS_ERROR(mesg);
+ }
+ }
+ }
+
+ }
+ }
+ }
+
+ return SUCCEED;
+
+error:
+ LOGPRINT(1, "_verify_datasets() FAILED\n");
+ return FAIL;
+} /* end _verify_datasets() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: verify_datasets
+ *
+ * Purpose: Inspect the datasets in the file created by create_datasets().
+ * Wrapper for _verify_datasets() -- this function sets up and
+ * tears down accessor information.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static herr_t
+verify_datasets(hid_t file_id,
+ unsigned min_dset,
+ unsigned max_dset)
+{
+ hid_t dataset_ids[MAX_DSET_COUNT + 1];
+ hid_t filespace_ids[MAX_DSET_COUNT + 1];
+ unsigned i;
+ hid_t memspace_id = H5I_INVALID_HID;
+ hsize_t chunk_dims[2] = {CHUNK_DIM, CHUNK_DIM};
+
+ HDassert(file_id >= 0);
+ HDassert(min_dset <= max_dset);
+ HDassert(max_dset <= MAX_DSET_COUNT);
+
+ LOGPRINT(2, "verify_datasets()\n");
+
+ /* ---------------------------------
+ * "Clear" ID arrays
+ */
+
+ for (i = 0; i < MAX_DSET_COUNT; i++) {
+ LOGPRINT(3, "clearing IDs [%d]\n", i);
+ dataset_ids[i] = H5I_INVALID_HID;
+ filespace_ids[i] = H5I_INVALID_HID;
+ }
+
+ /* ---------------------------------
+ * Generate dataspace, dataset, and 'filespace' IDs
+ */
+
+ if (_open_chunking_ids(file_id, min_dset, max_dset, chunk_dims,
+ filespace_ids, dataset_ids, &memspace_id)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ /* ---------------------------------
+ * Read and verify data from datasets
+ */
+
+ if (_verify_datasets(min_dset, max_dset, filespace_ids, dataset_ids,
+ memspace_id)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ /* ---------------------------------
+ * Cleanup
+ */
+
+ if (_close_chunking_ids(min_dset, max_dset, NULL, filespace_ids,
+ dataset_ids, &memspace_id)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ return SUCCEED;
+
+error:
+ LOGPRINT(1, "verify_datasets() FAILED\n");
+ (void)_close_chunking_ids(min_dset, max_dset, NULL, filespace_ids,
+ dataset_ids, &memspace_id);
+ return FAIL;
+
+} /* end verify_datasets() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_basic_dataset_write
+ *
+ * Purpose: Create and close files; repoen files and write a dataset,
+ * close; compare files.
+ *
+ * TODO: receive target IP from caller?
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_basic_dataset_write(void)
+{
+ struct mirrortest_filenames names;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5P_DEFAULT;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t dspace_id = H5I_INVALID_HID;
+ hid_t dtype_id = H5T_NATIVE_INT;
+ hsize_t dims[2] = { DATABUFFER_SIZE, DATABUFFER_SIZE };
+ int *buf = NULL;
+ int i = 0;
+ int j = 0;
+
+ TESTING("Mirror open and dataset writing");
+
+ /* Create FAPL for Splitter[sec2|mirror]
+ */
+ fapl_id = create_mirroring_split_fapl("basic_write", &names);
+ if (H5I_INVALID_HID == fapl_id) {
+ TEST_ERROR;
+ }
+
+ /* Prepare data to be written
+ */
+ buf = (int *)HDmalloc(DATABUFFER_SIZE * DATABUFFER_SIZE * sizeof(int));
+ if (NULL == buf) {
+ TEST_ERROR;
+ }
+ for (i = 0; i < DATABUFFER_SIZE; i++) {
+ for (j = 0; j < DATABUFFER_SIZE; j++) {
+ int k = i * DATABUFFER_SIZE + j;
+ buf[k] = k;
+ }
+ }
+
+ /* -------------------- */
+ /* TEST: Create and Close */
+
+ file_id = H5Fcreate(names.rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ file_id = H5I_INVALID_HID;
+
+
+ /* -------------------- */
+ /* TEST: Repoen and Write */
+
+ file_id = H5Fopen(names.rw, H5F_ACC_RDWR, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+
+ dspace_id = H5Screate_simple(2, dims, NULL);
+ if (H5I_INVALID_HID == dspace_id) {
+ TEST_ERROR;
+ }
+ dset_id = H5Dcreate2(file_id, "dataset", dtype_id, dspace_id, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
+ if (H5I_INVALID_HID == dset_id) {
+ TEST_ERROR;
+ }
+
+ if (H5Dwrite(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* Standard cleanup */
+
+ HDfree(buf);
+ buf = NULL;
+ if (H5Dclose(dset_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (H5Sclose(dspace_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (fapl_id != H5P_DEFAULT && fapl_id > 0) {
+ if (H5Pclose(fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+ }
+
+ /* -------------------- */
+ /* TEST: Verify that the R/W and W/O files are identical */
+
+ if (h5_compare_file_bytes(names.rw, names.wo) < 0) {
+ TEST_ERROR;
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY{
+ (void)H5Fclose(file_id);
+ if (buf) {
+ HDfree(buf);
+ }
+ (void)H5Dclose(dset_id);
+ (void)H5Sclose(dspace_id);
+ if (fapl_id != H5P_DEFAULT && fapl_id > 0) {
+ (void)H5Pclose(fapl_id);
+ }
+ } H5E_END_TRY;
+ return -1;
+} /* end test_basic_dataset_write() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_chunked_dataset_write
+ *
+ * Purpose: Create and close files; repoen files and write a dataset,
+ * close; compare files.
+ *
+ * TODO: receive target IP from caller?
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_chunked_dataset_write(void)
+{
+ struct mirrortest_filenames names;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5P_DEFAULT;
+
+ TESTING("Mirror open and dataset writing (chunked)");
+
+ /* Create FAPL for Splitter[sec2|mirror]
+ */
+ fapl_id = create_mirroring_split_fapl("chunked_write", &names);
+ if (H5I_INVALID_HID == fapl_id) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* TEST: Create and Close */
+
+ file_id = H5Fcreate(names.rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ file_id = H5I_INVALID_HID;
+
+ /* -------------------- */
+ /* TEST: Reopen and Write */
+
+ file_id = H5Fopen(names.rw, H5F_ACC_RDWR, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+
+ /* Write datasets to file
+ */
+ if (create_datasets(file_id, 0, MAX_DSET_COUNT) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* Close to 'flush to disk', and reopen file
+ */
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ file_id = H5I_INVALID_HID;
+
+ /* Reopen file
+ */
+ file_id = H5Fopen(names.rw, H5F_ACC_RDWR, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+
+ /* Verify written data integrity
+ */
+ if (verify_datasets(file_id, 0, MAX_DSET_COUNT) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* Standard cleanup */
+
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ file_id = H5I_INVALID_HID;
+ if (fapl_id != H5P_DEFAULT && fapl_id > 0) {
+ if (H5Pclose(fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+ fapl_id = H5I_INVALID_HID;
+ }
+
+ /* -------------------- */
+ /* TEST: Verify that the R/W and W/O files are identical */
+
+ if (h5_compare_file_bytes(names.rw, names.wo) < 0) {
+ TEST_ERROR;
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Fclose(file_id);
+ if (fapl_id != H5P_DEFAULT && fapl_id > 0) {
+ (void)H5Pclose(fapl_id);
+ }
+ } H5E_END_TRY;
+ return -1;
+} /* end test_chunked_dataset_write() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_on_disk_zoo
+ *
+ * Purpose: Verify that the mirror can handle the passing of all the
+ * various on-disk data structures over the wire, as implemented
+ * in genall5.c:create_zoo().
+ *
+ * TODO: receive target IP from caller?
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_on_disk_zoo(void)
+{
+ const char grp_name[] = "/only";
+ struct mirrortest_filenames names;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t grp_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5P_DEFAULT;
+
+ TESTING("'Zoo' of on-disk structures");
+
+ /* Create FAPL for Splitter[sec2|mirror]
+ */
+ fapl_id = create_mirroring_split_fapl("zoo", &names);
+ if (H5I_INVALID_HID == fapl_id) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* TEST: Create file */
+ file_id = H5Fcreate(names.rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+
+ grp_id = H5Gcreate2(file_id, grp_name, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (grp_id == H5I_INVALID_HID) {
+ TEST_ERROR;
+ }
+
+ /* Create datasets in file, close (flush) and reopen, validate.
+ * Use of ( pass ) a conceit required for using create_ and validate_zoo()
+ * from cache_common and/or genall5.
+ */
+
+ if ( pass ) {
+ create_zoo(file_id, grp_name, 0);
+ }
+ if ( pass ) {
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ file_id = H5Fopen(names.rw, H5F_ACC_RDWR, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+ }
+ if ( pass ) {
+ validate_zoo(file_id, grp_name, 0); /* sanity-check */
+ }
+ if ( !pass ) {
+ HDprintf(failure_mssg);
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* Standard cleanup */
+
+ if (fapl_id != H5P_DEFAULT && fapl_id >= 0) {
+ if (H5Pclose(fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+ }
+ if (H5Gclose(grp_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (H5Fclose(file_id) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* TEST: Verify that the R/W and W/O files are identical */
+
+ if (h5_compare_file_bytes(names.rw, names.wo) < 0) {
+ TEST_ERROR;
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Fclose(file_id);
+ (void)H5Gclose(grp_id);
+ if (fapl_id != H5P_DEFAULT && fapl_id > 0) {
+ (void)H5Pclose(fapl_id);
+ }
+ } H5E_END_TRY;
+ return -1;
+} /* end test_on_disk_zoo() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_vanishing_datasets
+ *
+ * Purpose: Verify behavior when writing to a file where data is deleted.
+ *
+ * Each dataset is populated with the value of its suffix
+ * (dset5 is all fives).
+ *
+ * Opens 0..15 create one new dataset each, '/dset[i]'.
+ * Opens 3..18 delete '/dset[1-3]'
+ *
+ * Should end with no data in file.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_vanishing_datasets(void)
+{
+ struct mirrortest_filenames names;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t dspace_id = H5I_INVALID_HID;
+ hid_t mirror_fapl_id = H5I_INVALID_HID;
+ hsize_t dims[2] = {DATABUFFER_SIZE, DATABUFFER_SIZE};
+ uint32_t buf[DATABUFFER_SIZE][DATABUFFER_SIZE]; /* consider malloc? */
+ H5G_info_t group_info;
+ unsigned int i, j, k;
+ const unsigned int max_loops = 20;
+ const unsigned int max_at_one_time = 3;
+
+ TESTING("Vanishing Datasets");
+
+ /* -------------------- */
+ /* Set up recurrent data (FAPL, dataspace) */
+
+ /* Create FAPL for Splitter[sec2|mirror]
+ */
+ fapl_id = create_mirroring_split_fapl("vanishing", &names);
+ if (H5I_INVALID_HID == fapl_id) {
+ TEST_ERROR;
+ }
+
+ dspace_id = H5Screate_simple(2, dims, NULL);
+ if (dspace_id < 0) {
+ TEST_ERROR;
+ }
+
+ /* create file */
+ file_id = H5Fcreate(names.rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (H5I_INVALID_HID == file_id) {
+ TEST_ERROR;
+ }
+
+ for (i=0; i < max_loops; i++) {
+ char namebuf[DSET_NAME_LEN + 1];
+
+ /* deleting datasets */
+ if (i >= max_at_one_time) {
+ if (HDsnprintf(namebuf, DSET_NAME_LEN, "/dset%02d",
+ (i - max_at_one_time) )
+ > DSET_NAME_LEN)
+ {
+ TEST_ERROR;
+ }
+ if (H5Ldelete(file_id, namebuf, H5P_DEFAULT) < 0) {
+ TEST_ERROR;
+ }
+ } /* end if deleting a dataset */
+
+ /* writing datasets */
+ if (i < (max_loops - max_at_one_time)) {
+ if (HDsnprintf(namebuf, DSET_NAME_LEN, "/dset%02d", i)
+ > DSET_NAME_LEN)
+ {
+ TEST_ERROR;
+ }
+ dset_id = H5Dcreate2(file_id, namebuf, H5T_STD_U32LE, dspace_id,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (H5I_INVALID_HID == dset_id) {
+ TEST_ERROR;
+ }
+
+ for (j=0; j < DATABUFFER_SIZE; j++) {
+ for (k=0; k < DATABUFFER_SIZE; k++) {
+ buf[j][k] = (uint32_t)i;
+ }
+ }
+
+ if (H5Dwrite(dset_id, H5T_STD_U32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ buf)
+ < 0)
+ {
+ TEST_ERROR;
+ }
+
+ if (H5Dclose(dset_id) < 0) {
+ TEST_ERROR;
+ }
+ dset_id = H5I_INVALID_HID;
+ } /* end if writing a dataset */
+
+ } /* end for dataset create-destroy cycles */
+
+ if (H5Fclose(file_id) < 0) {
+ TEST_ERROR;
+ }
+ file_id = H5I_INVALID_HID;
+
+ /* verify there are no datasets in file */
+ file_id = H5Fopen(names.rw, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file_id < 0) {
+ TEST_ERROR;
+ }
+ if (H5Gget_info(file_id, &group_info) < 0) {
+ TEST_ERROR;
+ }
+ if (group_info.nlinks > 0) {
+ HDfprintf(stderr, "links in rw file: %d\n", group_info.nlinks);
+ HDfflush(stderr);
+ TEST_ERROR;
+ }
+ if (H5Fclose(file_id) < 0) {
+ TEST_ERROR;
+ }
+ file_id = H5Fopen(names.wo, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file_id < 0) {
+ TEST_ERROR;
+ }
+ if (H5Gget_info(file_id, &group_info) < 0) {
+ TEST_ERROR;
+ }
+ if (group_info.nlinks > 0) {
+ HDfprintf(stderr, "links in wo file: %d\n", group_info.nlinks);
+ HDfflush(stderr);
+ TEST_ERROR;
+ }
+ if (H5Fclose(file_id) < 0) {
+ TEST_ERROR;
+ }
+ file_id = H5I_INVALID_HID;
+
+ if (h5_compare_file_bytes(names.rw, names.wo) < 0)
+ TEST_ERROR;
+
+ /* -------------------- */
+ /* Teardown */
+
+ if (H5Sclose(dspace_id) < 0) {
+ TEST_ERROR;
+ }
+ if (H5Pclose(fapl_id) < 0) {
+ TEST_ERROR;
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ if (mirror_fapl_id != H5I_INVALID_HID) {
+ H5Pclose(mirror_fapl_id);
+ }
+ if (fapl_id != H5I_INVALID_HID) {
+ H5Pclose(fapl_id);
+ }
+ if (file_id != H5I_INVALID_HID) {
+ H5Fclose(file_id);
+ }
+ if (dset_id != H5I_INVALID_HID) {
+ H5Dclose(dset_id);
+ }
+ if (dspace_id != H5I_INVALID_HID) {
+ H5Sclose(dspace_id);
+ }
+ } H5E_END_TRY;
+ return -1;
+} /* test_vanishing_datasets() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: test_concurrent_access
+ *
+ * Purpose: Verify that more than one file may be opened at a time.
+ *
+ * TODO: receive target IP from caller?
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Jacob Smith
+ * 2020-03-09
+ * ---------------------------------------------------------------------------
+ */
+static int
+test_concurrent_access(void)
+{
+ struct file_bundle {
+ struct mirrortest_filenames names;
+ hid_t dset_id;
+ hid_t fapl_id;
+ hid_t file_id;
+ } bundle[CONCURRENT_COUNT];
+ hid_t dspace_id = H5I_INVALID_HID;
+ hid_t dtype_id = H5T_NATIVE_INT;
+ hsize_t dims[2] = { DATABUFFER_SIZE, DATABUFFER_SIZE };
+ int *buf = NULL;
+ int i = 0;
+ int j = 0;
+
+ TESTING("Concurrent opened mirrored files");
+
+ /* blank bundle */
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ bundle[i].dset_id = H5I_INVALID_HID;
+ bundle[i].fapl_id = H5I_INVALID_HID;
+ bundle[i].file_id = H5I_INVALID_HID;
+ *bundle[i].names.rw = '\0';
+ *bundle[i].names.wo = '\0';
+ *bundle[i].names.log = '\0';
+ }
+
+ /* Create FAPL for Splitter[sec2|mirror]
+ */
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ char _name[16] = "";
+ hid_t _fapl_id = H5I_INVALID_HID;
+ HDsnprintf(_name, 15, "concurrent%d", i);
+ _fapl_id = create_mirroring_split_fapl(_name, &bundle[i].names);
+ if (H5I_INVALID_HID == _fapl_id) {
+ TEST_ERROR;
+ }
+ bundle[i].fapl_id = _fapl_id;
+ }
+
+ /* Prepare data to be written
+ */
+ buf = (int *)HDmalloc(DATABUFFER_SIZE * DATABUFFER_SIZE * sizeof(int));
+ if (NULL == buf) {
+ TEST_ERROR;
+ }
+ for (i = 0; i < DATABUFFER_SIZE; i++) {
+ for (j = 0; j < DATABUFFER_SIZE; j++) {
+ int k = i * DATABUFFER_SIZE + j;
+ buf[k] = k;
+ }
+ }
+
+ /* Prepare generic dataspace
+ */
+ dspace_id = H5Screate_simple(2, dims, NULL);
+ if (H5I_INVALID_HID == dspace_id) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* TEST: Create file and open elements */
+
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ hid_t _file_id = H5I_INVALID_HID;
+ hid_t _dset_id = H5I_INVALID_HID;
+
+ _file_id = H5Fcreate(bundle[i].names.rw, H5F_ACC_TRUNC, H5P_DEFAULT,
+ bundle[i].fapl_id);
+ if (H5I_INVALID_HID == _file_id) {
+ TEST_ERROR;
+ }
+
+ bundle[i].file_id = _file_id;
+
+ _dset_id = H5Dcreate2(_file_id, "dataset", dtype_id, dspace_id,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (H5I_INVALID_HID == _dset_id) {
+ TEST_ERROR;
+ }
+ bundle[i].dset_id = _dset_id;
+ }
+
+ /* -------------------- */
+ /* TEST: Write to files */
+
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ if (H5Dwrite(bundle[i].dset_id, dtype_id, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, buf)
+ == FAIL)
+ {
+ TEST_ERROR;
+ }
+ }
+
+ /* -------------------- */
+ /* TEST: Close elements */
+
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ if (H5Dclose(bundle[i].dset_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (H5Fclose(bundle[i].file_id) == FAIL) {
+ TEST_ERROR;
+ }
+ if (H5Pclose(bundle[i].fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+ }
+
+ /* -------------------- */
+ /* Standard cleanup */
+
+ HDfree(buf);
+ buf = NULL;
+ if (H5Sclose(dspace_id) == FAIL) {
+ TEST_ERROR;
+ }
+
+ /* -------------------- */
+ /* TEST: Verify that the R/W and W/O files are identical */
+
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ if (h5_compare_file_bytes(bundle[i].names.rw, bundle[i].names.wo) < 0) {
+ TEST_ERROR;
+ }
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY{
+ if (buf) {
+ HDfree(buf);
+ }
+ (void)H5Sclose(dspace_id);
+ for (i = 0; i < CONCURRENT_COUNT; i++) {
+ (void)H5Dclose(bundle[i].dset_id);
+ (void)H5Fclose(bundle[i].file_id);
+ (void)H5Pclose(bundle[i].fapl_id);
+ }
+ } H5E_END_TRY;
+ return -1;
+} /* end test_concurrent_access() */
+
+
+/* ---------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Run tests.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Jacob Smith
+ * 2019
+ * ---------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+
+ h5_reset();
+
+ g_log_stream = stdout; /* default debug/logging output stream */
+
+ HDprintf("Testing Mirror VFD functionality.\n");
+
+ /* -------------------- */
+ /* SETUP */
+
+ /* Create directories for test-generated .h5 files
+ */
+ if (nerrors == 0) {
+ if ((HDmkdir(MIRROR_RW_DIR, (mode_t)0755) < 0) && (errno != EEXIST)) {
+ nerrors++;
+ }
+ }
+ if (nerrors == 0) {
+ if ((HDmkdir(MIRROR_WO_DIR, (mode_t)0755) < 0) && (errno != EEXIST)) {
+ nerrors++;
+ }
+ }
+
+ /* -------------------- */
+ /* TESTS */
+ /* Tests return negative values; `-=' increments nerrors count */
+
+ if (nerrors == 0) {
+ nerrors -= test_fapl_configuration();
+ nerrors -= test_xmit_encode_decode();
+ nerrors -= test_create_and_close();
+ nerrors -= test_basic_dataset_write();
+ nerrors -= test_chunked_dataset_write();
+ nerrors -= test_on_disk_zoo();
+ nerrors -= test_vanishing_datasets();
+ nerrors -= test_concurrent_access();
+ }
+
+ if (nerrors) {
+ HDprintf("***** %d Mirror VFD TEST%s FAILED! *****\n",
+ nerrors, nerrors > 1 ? "S" : "");
+ return EXIT_FAILURE;
+ }
+
+ HDprintf("All Mirror Virtual File Driver tests passed.\n");
+ return EXIT_SUCCESS;
+} /* end main() */
+
+#else /* H5_HAVE_MIRROR_VFD */
+
+int
+main(void)
+{
+ h5_reset();
+ HDprintf("Testing Mirror VFD functionality.\n");
+ HDprintf("SKIPPED - Mirror VFD not built.\n");
+ return EXIT_SUCCESS;
+}
+
+#endif /* H5_HAVE_MIRROR_VFD */
+
+
diff --git a/test/mount.c b/test/mount.c
index d2c0d21..3abe084 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -192,7 +192,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting a file on itself should have failed.");
+ HDputs(" Mounting a file on itself should have failed.");
TEST_ERROR
} /* end if */
@@ -208,7 +208,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting two files at one mount point should have failed.");
+ HDputs(" Mounting two files at one mount point should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -227,7 +227,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Mounting same file opened twice at one mount point should have failed.");
+ HDputs(" Mounting same file opened twice at one mount point should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -240,7 +240,7 @@ test_illegal(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Creating a cycle with mount points should have failed.");
+ HDputs(" Creating a cycle with mount points should have failed.");
TEST_ERROR
} /* end if */
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
@@ -400,43 +400,60 @@ static int
test_hide(hid_t fapl)
{
hid_t file1 = -1, file2 = -1, grp = -1;
- H5O_info_t oi1, oi2;
+ H5O_info2_t oi1, oi2;
char filename1[1024], filename2[1024];
+ hbool_t same_obj;
TESTING("name hiding under mount point");
- h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1);
- h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2);
+ h5_fixname(FILENAME[0], fapl, filename1, sizeof(filename1));
+ h5_fixname(FILENAME[1], fapl, filename2, sizeof(filename2));
if((file1 = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0 ||
(file2 = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0)
FAIL_STACK_ERROR
/* Get information about file1:/mnt1/file1 for later */
- if(H5Oget_info_by_name(file1, "/mnt1/file1", &oi1, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt1/file1", &oi1, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Build the virtual file */
- if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Original names under file1:/mnt1 should not be accessible */
H5E_BEGIN_TRY {
- grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT);
+ grp = H5Gopen2(file1, "/mnt1/file1", H5P_DEFAULT);
} H5E_END_TRY;
if(grp >= 0) {
- H5_FAILED();
- puts(" Name is still accessible under mount point.");
- TEST_ERROR
- } /* end if */
+ H5_FAILED();
+ HDputs(" Name is still accessible under mount point.");
+ TEST_ERROR
+ }
/*
* The original objects under file1:/mnt1 are still accessible by their
* other names. This is a rather stupid test but demonstrates a point.
*/
- if(H5Oget_info_by_name(file1, "/file1", &oi2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
- H5_FAILED();
- puts(" Hard link failed for hidden object.");
- TEST_ERROR
- } /* end if */
+ if(H5Oget_info_by_name3(file1, "/file1", &oi2, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+
+ same_obj = TRUE;
+ if(oi1.fileno == oi2.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(file1, &oi1.token, &oi2.token, &token_cmp) < 0)
+ FAIL_STACK_ERROR
+ if(token_cmp)
+ same_obj = FALSE;
+ }
+ else
+ same_obj = FALSE;
+
+ if(!same_obj) {
+ H5_FAILED();
+ HDputs(" Hard link failed for hidden object.");
+ TEST_ERROR
+ }
/* Unmount and close objects */
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
@@ -448,9 +465,9 @@ test_hide(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Gclose(grp);
- H5Fclose(file1);
- H5Fclose(file2);
+ H5Gclose(grp);
+ H5Fclose(file1);
+ H5Fclose(file2);
} H5E_END_TRY;
return 1;
} /* end test_hide() */
@@ -477,8 +494,9 @@ static int
test_assoc(hid_t fapl)
{
hid_t file1 = -1, file2 = -1;
- H5O_info_t oi1, oi2;
+ H5O_info2_t oi1, oi2;
char filename1[1024], filename2[1024];
+ hbool_t same_obj;
TESTING("mount point open");
h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1);
@@ -490,20 +508,35 @@ test_assoc(hid_t fapl)
FAIL_STACK_ERROR
/* Get information about the root of file2 */
- if(H5Oget_info(file2, &oi1) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info3(file2, &oi1, H5O_INFO_BASIC) < 0)
+ FAIL_STACK_ERROR
/* Create the virtual file */
- if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/*
* Get info about the mount point -- should be the same as the root group
* of file2.
*/
- if(H5Oget_info_by_name(file1, "/mnt1", &oi2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt1", &oi2, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
- if(oi1.fileno != oi2.fileno || H5F_addr_ne(oi1.addr, oi2.addr)) {
- H5_FAILED();
- puts(" Association failed.");
+ same_obj = TRUE;
+ if(oi1.fileno == oi2.fileno) {
+ int token_cmp;
+
+ if(H5Otoken_cmp(file1, &oi1.token, &oi2.token, &token_cmp) < 0)
+ FAIL_STACK_ERROR
+ if(token_cmp)
+ same_obj = FALSE;
+ }
+ else
+ same_obj = FALSE;
+
+ if(!same_obj) {
+ H5_FAILED();
+ HDputs(" Association failed.");
TEST_ERROR
} /* end if */
@@ -517,8 +550,8 @@ test_assoc(hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Fclose(file2);
- H5Fclose(file1);
+ H5Fclose(file2);
+ H5Fclose(file1);
} H5E_END_TRY;
return 1;
} /* end test_assoc() */
@@ -628,7 +661,7 @@ test_move(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Moving an object across files should't have been possible");
+ HDputs(" Moving an object across files should't have been possible");
TEST_ERROR
} /* end if */
@@ -670,7 +703,7 @@ static int
test_preopen(hid_t fapl)
{
hid_t file1 = -1, file2 = -1, grp = -1;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024], filename2[1024];
TESTING("preopening objects under the mount point");
@@ -688,7 +721,7 @@ test_preopen(hid_t fapl)
if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Now access the thing we previously opened */
- if(H5Oget_info(grp, &oinfo) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info3(grp, &oinfo, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR
/* Shut down */
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
@@ -732,7 +765,7 @@ test_postopen(hid_t fapl)
{
hid_t file1 = -1, file2 = -1, grp = -1;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024], filename2[1024];
TESTING("open object access after unmount");
@@ -752,10 +785,10 @@ test_postopen(hid_t fapl)
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
/* Now access the thing we previously opened */
- if(H5Oget_info(grp, &oinfo) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info3(grp, &oinfo, H5O_INFO_BASIC) < 0) FAIL_STACK_ERROR
/* Try accessing it from the file */
- if(H5Oget_info_by_name(file2, "/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file2, "/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Shut down */
if(H5Gclose(grp) < 0) FAIL_STACK_ERROR
@@ -797,7 +830,7 @@ static int
test_unlink(hid_t fapl)
{
hid_t file1 = -1, file2 = -1, mnt = -1, root = -1;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024], filename2[1024];
herr_t status;
@@ -825,16 +858,16 @@ test_unlink(hid_t fapl)
* before the H5Fmount() and thus refers to the mount point itself rather
* than the group mounted there.
*/
- if(H5Oget_info_by_name(file1, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(mnt, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(root, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(root, "file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt_unlink/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(mnt, "/mnt_unlink/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(root, "/mnt_unlink/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(root, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
- status = H5Oget_info_by_name(mnt, "file2", &oinfo, H5P_DEFAULT);
+ status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Incorrect traversal from mount point!");
+ HDputs(" Incorrect traversal from mount point!");
TEST_ERROR
} /* end if */
@@ -845,21 +878,21 @@ test_unlink(hid_t fapl)
* We should still be able to get to "/file2" of file2 by starting at
* `root' which is still open, but not by name.
*/
- if(H5Oget_info_by_name(root, "file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(root, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
- status = H5Oget_info_by_name(mnt, "file2", &oinfo, H5P_DEFAULT);
+ status = H5Oget_info_by_name3(mnt, "file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Traversal through mount point should not have worked!");
+ HDputs(" Traversal through mount point should not have worked!");
TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
- status = H5Oget_info_by_name(file2, "/mnt_unlink/file2", &oinfo, H5P_DEFAULT);
+ status = H5Oget_info_by_name3(file2, "/mnt_unlink/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Traversal through mount point should not have worked!");
+ HDputs(" Traversal through mount point should not have worked!");
TEST_ERROR
} /* end if */
@@ -873,7 +906,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- printf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
+ HDprintf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
TEST_ERROR
} /* end if */
H5E_BEGIN_TRY {
@@ -881,7 +914,7 @@ test_unlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- printf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
+ HDprintf(" %d: Unmount by name should not have been allowed!\n",__LINE__);
TEST_ERROR
} /* end if */
if(H5Funmount(mnt, ".") < 0) FAIL_STACK_ERROR
@@ -926,7 +959,7 @@ static int
test_mvmpt(hid_t fapl)
{
hid_t file1 = -1, file2 = -1;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024], filename2[1024];
TESTING("mount point renaming");
@@ -943,7 +976,7 @@ test_mvmpt(hid_t fapl)
if(H5Lmove(file1, "/mnt_move_a", H5L_SAME_LOC, "/mnt_move_b", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Access something under the new name */
- if(H5Oget_info_by_name(file1, "/mnt_move_b/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt_move_b/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Shut down */
if(H5Funmount(file1, "/mnt_move_b") < 0) FAIL_STACK_ERROR
@@ -1005,7 +1038,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Interfile hard link should not have been allowed!");
+ HDputs(" Interfile hard link should not have been allowed!");
TEST_ERROR
} /* end if */
@@ -1015,7 +1048,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(status >= 0) {
H5_FAILED();
- puts(" Interfile renaming should not have been allowed!");
+ HDputs(" Interfile renaming should not have been allowed!");
TEST_ERROR
} /* end if */
@@ -1033,7 +1066,7 @@ test_interlink(hid_t fapl)
} H5E_END_TRY;
if(dset >= 0) {
H5_FAILED();
- puts(" Dataset and shared type must be in the same file!");
+ HDputs(" Dataset and shared type must be in the same file!");
TEST_ERROR
} /* end if */
@@ -1088,7 +1121,7 @@ static int
test_uniformity(hid_t fapl)
{
hid_t file1 = -1, file2 = -1;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024], filename2[1024];
TESTING("file handle uniformity");
@@ -1102,18 +1135,18 @@ test_uniformity(hid_t fapl)
if(H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Access some things from the file1 handle */
- if(H5Oget_info_by_name(file1, "/", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file1, "/mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file1, "mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file1, "/mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file1, "mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt1/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "mnt1/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Access the same things from the file2 handle */
- if(H5Oget_info_by_name(file2, "/", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file2, "/mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file2, "mnt1", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file2, "/mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file2, "mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file2, "/", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file2, "/mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file2, "mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file2, "/mnt1/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file2, "mnt1/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
/* Shut down */
if(H5Funmount(file1, "/mnt1") < 0) FAIL_STACK_ERROR
@@ -1152,7 +1185,7 @@ static int
test_close(hid_t fapl)
{
hid_t file1 = -1, file2 = -1;
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024], filename2[1024];
TESTING("file handle close");
@@ -1170,9 +1203,9 @@ test_close(hid_t fapl)
* still accessible through the file2 handle.
*/
if(H5Fclose(file1) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file2, "/mnt1", &oinfo, H5P_DEFAULT) < 0) {
+ if(H5Oget_info_by_name3(file2, "/mnt1", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) {
H5_FAILED();
- puts(" File1 contents are not accessible!");
+ HDputs(" File1 contents are not accessible!");
TEST_ERROR
} /* end if */
if(H5Fclose(file2) < 0) FAIL_STACK_ERROR
@@ -1191,7 +1224,7 @@ test_close(hid_t fapl)
* Close file2. It is not actually closed because it's a child of file1.
*/
if(H5Fclose(file2) < 0) FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file1, "/mnt1/file2", &oinfo, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Oget_info_by_name3(file1, "/mnt1/file2", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(H5Fclose(file1) < 0) FAIL_STACK_ERROR
/* Check that all file IDs have been closed */
@@ -2426,7 +2459,7 @@ test_fcdegree_strong(hid_t fapl)
hid_t fid1 = -1, fid2 = -1; /* File IDs */
hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */
hid_t fapl_id = -1; /* FAPL IDs */
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
char filename1[1024],
filename2[1024]; /* Name of files to mount */
herr_t ret; /* Generic return value */
@@ -2495,9 +2528,9 @@ test_fcdegree_strong(hid_t fapl)
TEST_ERROR
/* Check that objects are still open */
- if(H5Oget_info(gidA, &oinfo) < 0)
+ if(H5Oget_info3(gidA, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
- if(H5Oget_info(gidAM, &oinfo) < 0)
+ if(H5Oget_info3(gidAM, &oinfo, H5O_INFO_BASIC) < 0)
TEST_ERROR
/* Close file #2 (should close open objects also) */
@@ -2506,12 +2539,12 @@ test_fcdegree_strong(hid_t fapl)
/* Check that objects are closed */
H5E_BEGIN_TRY {
- ret = H5Oget_info(gidA, &oinfo);
+ ret = H5Oget_info3(gidA, &oinfo, H5O_INFO_BASIC);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
H5E_BEGIN_TRY {
- ret = H5Oget_info(gidAM, &oinfo);
+ ret = H5Oget_info3(gidAM, &oinfo, H5O_INFO_BASIC);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
@@ -4379,13 +4412,13 @@ main(void)
if (nerrors) goto error;
- puts("All mount tests passed.");
+ HDputs("All mount tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
error:
- puts("***** MOUNT ERRORS *****");
+ HDputs("***** MOUNT ERRORS *****");
return 1;
}
diff --git a/test/mtime.c b/test/mtime.c
index 38e3960..81a20db 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,15 @@ const char *FILENAME[] = {
#define TESTFILE2 "tmtimen.h5"
#define MTIME2 1041606478
-
+
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: H5O_mtime_decode() test.
+ * Function: main
*
- * Return: Success:
+ * Purpose: H5O_mtime_decode() test.
*
- * Failure:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Thursday, July 30, 1998
*
* Modifications:
@@ -58,13 +56,14 @@ 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_info2_t oi1, oi2;
+ signed char buf1[32], buf2[32];
+ char filename[1024];
+ int token_cmp;
h5_reset();
fapl = h5_fileaccess();
@@ -90,27 +89,28 @@ main(void)
*/
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR;
- if(H5Oget_info_by_name(file, "dset", &oi1, H5P_DEFAULT) < 0) TEST_ERROR;
+ if(H5Oget_info_by_name3(file, "dset", &oi1, H5O_INFO_BASIC|H5O_INFO_TIME, H5P_DEFAULT) < 0) TEST_ERROR;
if((dset = H5Dopen2(file, "dset", H5P_DEFAULT)) < 0) TEST_ERROR;
- if(H5Oget_info(dset, &oi2) < 0) TEST_ERROR;
+ if(H5Oget_info3(dset, &oi2, H5O_INFO_BASIC|H5O_INFO_TIME) < 0) TEST_ERROR;
+ if(H5Otoken_cmp(file, &oi1.token, &oi2.token, &token_cmp) < 0)TEST_ERROR;
if(H5Dclose(dset) < 0) TEST_ERROR;
if(H5Fclose(file) < 0) TEST_ERROR;
- /* Compare addresses & times from the two ways of calling H5Oget_info() */
- if(oi1.addr != oi2.addr || oi1.ctime != oi2.ctime) {
+ /* Compare object tokens & times from the two ways of calling H5Oget_info() */
+ if(token_cmp || 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();
@@ -134,12 +134,12 @@ main(void)
file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
if(file >= 0){
- if(H5Oget_info_by_name(file, "/Dataset1", &oi1, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(file, "/Dataset1", &oi1, H5O_INFO_TIME, H5P_DEFAULT) < 0)
TEST_ERROR;
if(oi1.ctime != MTIME1) {
H5_FAILED();
/* If this fails, examine H5Omtime.c. Modification time is very
- * system dependant (e.g., on Windows DST must be hardcoded). */
+ * system dependent (e.g., on Windows DST must be hardcoded). */
puts(" Old modification time incorrect");
goto error;
}
@@ -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 */
@@ -164,18 +164,18 @@ main(void)
file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
if(file >= 0){
- if(H5Oget_info_by_name(file, "/Dataset1", &oi2, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(file, "/Dataset1", &oi2, H5O_INFO_TIME, H5P_DEFAULT) < 0)
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,12 +186,12 @@ 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;
+ return EXIT_SUCCESS;
/* Something broke */
error:
- return 1;
-}
+ return EXIT_FAILURE;
+} /* end main() */
diff --git a/test/ntypes.c b/test/ntypes.c
index b6f4de7..f1d2449 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 */
@@ -1779,10 +1779,10 @@ test_vl_dtype(hid_t file)
} /* end for */
/* Reclaim the read VL data */
- if(H5Dvlen_reclaim(native_type, space, H5P_DEFAULT, rdata) < 0) TEST_ERROR;
+ if(H5Treclaim(native_type, space, H5P_DEFAULT, rdata) < 0) TEST_ERROR;
/* Reclaim the write VL data */
- if(H5Dvlen_reclaim(native_type, space, H5P_DEFAULT, wdata) < 0) TEST_ERROR;
+ if(H5Treclaim(native_type, space, H5P_DEFAULT, wdata) < 0) TEST_ERROR;
/* Close Dataset */
if(H5Dclose(dataset) < 0) TEST_ERROR;
@@ -1808,8 +1808,8 @@ error:
H5E_BEGIN_TRY {
if(native_type > 0) {
- H5Dvlen_reclaim(native_type, space, H5P_DEFAULT, rdata);
- H5Dvlen_reclaim(native_type, space, H5P_DEFAULT, wdata);
+ H5Treclaim(native_type, space, H5P_DEFAULT, rdata);
+ H5Treclaim(native_type, space, H5P_DEFAULT, wdata);
} /* end if */
H5Sclose(space);
H5Dclose(dataset);
@@ -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 */
@@ -2484,7 +2484,7 @@ test_opaque_dtype(hid_t file)
TEST_ERROR;
for(i = 0; i < sizeof(wbuf); i++)
- wbuf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ wbuf[i] = (unsigned char)(0xff ^ i);
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR;
if(H5Sclose(space) < 0) TEST_ERROR;
@@ -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/null_vol_connector.c b/test/null_vol_connector.c
new file mode 100644
index 0000000..ef76fe6
--- /dev/null
+++ b/test/null_vol_connector.c
@@ -0,0 +1,143 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Purpose: A simple virtual object layer (VOL) connector with almost no
+ * functionality that is used for testing basic plugin handling
+ * (registration, etc.).
+ */
+
+
+/* Public HDF5 header */
+#include "hdf5.h"
+
+/* For HDF5 plugin functionality */
+#include "H5PLextern.h"
+
+
+/* This connector's header */
+#include "null_vol_connector.h"
+
+/* The VOL class struct */
+static const H5VL_class_t null_vol_g = {
+ 0, /* version */
+ NULL_VOL_CONNECTOR_VALUE, /* value */
+ NULL_VOL_CONNECTOR_NAME, /* name */
+ 0, /* capability flags */
+ NULL, /* initialize */
+ NULL, /* terminate */
+ { /* info_cls */
+ (size_t)0, /* size */
+ NULL, /* copy */
+ NULL, /* compare */
+ NULL, /* free */
+ NULL, /* to_str */
+ NULL, /* from_str */
+ },
+ { /* wrap_cls */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* unwrap_object */
+ NULL, /* free_wrap_ctx */
+ },
+ { /* attribute_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* dataset_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* datatype_cls */
+ NULL, /* commit */
+ NULL, /* open */
+ NULL, /* get_size */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* file_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* group_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* link_cls */
+ NULL, /* create */
+ NULL, /* copy */
+ NULL, /* move */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* object_cls */
+ NULL, /* open */
+ NULL, /* copy */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* introspect_cls */
+ NULL, /* get_conn_cls */
+ NULL, /* opt_query */
+ },
+ { /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
+ },
+ { /* blob_cls */
+ NULL, /* put */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* token_cls */
+ NULL, /* cmp */
+ NULL, /* to_str */
+ NULL /* from_str */
+ },
+ NULL /* optional */
+};
+
+/* These two functions are necessary to load this plugin using
+ * the HDF5 library.
+ */
+
+H5PL_type_t H5PLget_plugin_type(void) {return H5PL_TYPE_VOL;}
+const void *H5PLget_plugin_info(void) {return &null_vol_g;}
+
diff --git a/test/null_vol_connector.h b/test/null_vol_connector.h
new file mode 100644
index 0000000..11c8826
--- /dev/null
+++ b/test/null_vol_connector.h
@@ -0,0 +1,25 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Purpose: A simple virtual object layer (VOL) connector with almost no
+ * functionality that is used for testing basic plugin handling
+ * (registration, etc.).
+ */
+
+#ifndef _null_vol_connector_H
+#define _null_vol_connector_H
+
+#define NULL_VOL_CONNECTOR_VALUE ((H5VL_class_value_t)160)
+#define NULL_VOL_CONNECTOR_NAME "null_vol_connector"
+
+#endif /* _null_vol_connector_H */
+
diff --git a/test/objcopy.c b/test/objcopy.c
index 216d111..5174700 100644
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -12,38 +12,54 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Peter X. Cao
- * May 01, 2005
+ * Programmer: Peter X. Cao
+ * May 01, 2005
*
- * Purpose: Test H5Ocopy().
+ * Purpose: Test H5Ocopy().
*/
#include "testhdf5.h"
#include "H5srcdir.h"
+#include "H5Iprivate.h"
+#include "H5Pprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
+
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
/*
* This file needs to access private information from the H5S package.
* This file also needs to access the dataspace testing code.
*/
-#define H5S_FRIEND /*suppress error about including H5Spkg */
+#define H5S_FRIEND /*suppress error about including H5Spkg */
#define H5S_TESTING
-#include "H5Spkg.h" /* Dataspaces */
+#include "H5Spkg.h" /* Dataspaces */
/*
* This file needs to access private information from the H5P package.
* This file also needs to access the property list testing code.
*/
-#define H5P_FRIEND /*suppress error about including H5Ppkg */
+#define H5P_FRIEND /*suppress error about including H5Ppkg */
#define H5P_TESTING
-#include "H5Ppkg.h" /* Property Lists */
+#include "H5Ppkg.h" /* Property Lists */
/*
* This file needs to access private information from the H5D package.
* This file also needs to access the dataset testing code.
*/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
#define H5D_TESTING
-#include "H5Dpkg.h" /* Datasets */
+#include "H5Dpkg.h" /* Datasets */
+
+/*
+ * This file needs to access private information from the H5O package.
+ * This file also needs to access the dataspace testing code.
+ */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_TESTING
+#include "H5Opkg.h" /* Object header */
const char *FILENAME[] = {
@@ -51,6 +67,8 @@ const char *FILENAME[] = {
"objcopy_dst",
"objcopy_ext",
"objcopy_src2",
+ "verbound_src",
+ "verbound_dst",
NULL
};
@@ -64,81 +82,82 @@ const char *FILENAME[] = {
#define CONFIG_DENSE 16
#define MAX_CONFIGURATION 31
-#define FILE_EXT "objcopy_ext.dat"
+#define FILE_EXT "objcopy_ext.dat"
/* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory
* 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_OLD_LAYOUT "fill_old.h5"
-#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT"
-#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2"
-#define NAME_DATATYPE_VL "vlen of int"
-#define NAME_DATATYPE_VL_VL "vlen of vlen of int"
-#define NAME_DATASET_SIMPLE "dataset_simple"
+#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT"
+#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2"
+#define NAME_DATATYPE_VL "vlen of int"
+#define NAME_DATATYPE_VL_VL "vlen of vlen of int"
+#define NAME_DATASET_SIMPLE "dataset_simple"
#define NAME_DATASET_SIMPLE2 "dataset_simple_copy"
#define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy"
-#define NAME_DATASET_COMPOUND "dataset_compound"
-#define NAME_DATASET_CHUNKED "dataset_chunked"
-#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single"
-#define NAME_DATASET_CHUNKED2 "dataset_chunked2"
-#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single"
-#define NAME_DATASET_CHUNKED3 "dataset_chunked3"
-#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single"
-#define NAME_DATASET_CHUNKED4 "dataset_chunked4"
-#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single"
-#define NAME_DATASET_COMPACT "dataset_compact"
-#define NAME_DATASET_EXTERNAL "dataset_ext"
-#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype"
-#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2"
-#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr"
-#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2"
-#define NAME_DATASET_VL "dataset_vl"
-#define NAME_DATASET_VL2 "dataset_vl2"
-#define NAME_DATASET_VL_VL "dataset_vl_vl"
-#define NAME_DATASET_VL_VL2 "dataset_vl_vl2"
-#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl"
-#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple"
-#define NAME_GROUP_UNCOPIED "/uncopied"
-#define NAME_GROUP_EMPTY "/empty"
-#define NAME_GROUP_TOP "/g0"
+#define NAME_DATASET_COMPOUND "dataset_compound"
+#define NAME_DATASET_CHUNKED "dataset_chunked"
+#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single"
+#define NAME_DATASET_CHUNKED2 "dataset_chunked2"
+#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single"
+#define NAME_DATASET_CHUNKED3 "dataset_chunked3"
+#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single"
+#define NAME_DATASET_CHUNKED4 "dataset_chunked4"
+#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single"
+#define NAME_DATASET_COMPACT "dataset_compact"
+#define NAME_DATASET_EXTERNAL "dataset_ext"
+#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype"
+#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2"
+#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr"
+#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2"
+#define NAME_DATASET_VL "dataset_vl"
+#define NAME_DATASET_VL2 "dataset_vl2"
+#define NAME_DATASET_VL_VL "dataset_vl_vl"
+#define NAME_DATASET_VL_VL2 "dataset_vl_vl2"
+#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl"
+#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple"
+#define NAME_GROUP_UNCOPIED "/uncopied"
+#define NAME_GROUP_EMPTY "/empty"
+#define NAME_GROUP_TOP "/g0"
#define NAME_GROUP_TOP2 "/g1"
#define NAME_GROUP_TOP3 "/g2"
#define NAME_GROUP_TOP4 "/g3"
-#define NAME_GROUP_SUB "/g0/g00"
-#define NAME_GROUP_SUB_2 "/g0/g01"
-#define NAME_GROUP_SUB_SUB "/g0/g00/g000"
-#define NAME_GROUP_SUB_SUB2 "g000"
-#define NAME_GROUP_DATASET "/g0/dataset_simple"
-#define NAME_GROUP_LINK "/g_links"
-#define NAME_GROUP_LINK2 "/g_links2"
-#define NAME_GROUP_LOOP "g_loop"
-#define NAME_GROUP_LOOP2 "g_loop2"
-#define NAME_GROUP_LOOP3 "g_loop3"
-#define NAME_GROUP_REF "ref_grp"
-#define NAME_LINK_DATASET "/g_links/dataset_simple"
-#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple"
-#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple"
-#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple"
-#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple"
+#define NAME_GROUP_SUB "/g0/g00"
+#define NAME_GROUP_SUB_2 "/g0/g01"
+#define NAME_GROUP_SUB_SUB "/g0/g00/g000"
+#define NAME_GROUP_SUB_SUB2 "g000"
+#define NAME_GROUP_DATASET "/g0/dataset_simple"
+#define NAME_GROUP_LINK "/g_links"
+#define NAME_GROUP_LINK2 "/g_links2"
+#define NAME_GROUP_LOOP "g_loop"
+#define NAME_GROUP_LOOP2 "g_loop2"
+#define NAME_GROUP_LOOP3 "g_loop3"
+#define NAME_GROUP_REF "ref_grp"
+#define NAME_LINK_DATASET "/g_links/dataset_simple"
+#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple"
+#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple"
+#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple"
+#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple"
#define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple"
-#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere"
-#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere"
+#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere"
+#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere"
#define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere"
#define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere"
-#define NAME_OLD_FORMAT "/dset1"
+#define NAME_OLD_FORMAT "/dset1"
#define NAME_BUF_SIZE 1024
#define ATTR_NAME_LEN 80
#define DIM_SIZE_1 12
#define DIM_SIZE_2 6
-#define MAX_DIM_SIZE_1 100
-#define MAX_DIM_SIZE_2 80
+#define MAX_DIM_SIZE_1 100
+#define MAX_DIM_SIZE_2 80
#define CHUNK_SIZE_1 5 /* Not an even fraction of dimension sizes, so we test copying partial chunks */
#define CHUNK_SIZE_2 5
#define NUM_SUB_GROUPS 20
#define NUM_WIDE_LOOP_GROUPS 10
#define NUM_DATASETS 10
+#define ATTR_CMPD_STRING "ThisIsAString"
char src_obj_full_name[215]; /* the full path + name of the object to be copied */
@@ -149,7 +168,7 @@ unsigned num_attributes_g; /* Number of attributes created */
static struct {
size_t nalloc; /* number of slots allocated */
size_t nobjs; /* number of objects */
- haddr_t *obj; /* Addresses of objects seen */
+ H5O_token_t *obj; /* Tokens of objects seen */
} idtab_g;
/* Local function prototypes */
@@ -160,7 +179,7 @@ static int
compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf);
static int
compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags);
-static int
+static int
compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type);
static int
@@ -170,21 +189,21 @@ attach_attribute_compound_vlstr(hid_t loc_id);
static int
compare_attribute_compound_vlstr(hid_t loc, hid_t loc2);
-
+
/*-------------------------------------------------------------------------
- * Function: addr_insert
+ * Function: token_insert
*
- * Purpose: Add an address to the table.
+ * Purpose: Add a token to the table.
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 5, 2005
*
*-------------------------------------------------------------------------
*/
static void
-addr_insert(H5O_info_t *oi)
+token_insert(H5O_info2_t *oi)
{
size_t n;
@@ -196,66 +215,69 @@ addr_insert(H5O_info_t *oi)
/* Extend the table */
if(idtab_g.nobjs >= idtab_g.nalloc) {
idtab_g.nalloc = MAX(256, 2*idtab_g.nalloc);
- idtab_g.obj = (haddr_t *)HDrealloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0]));
+ idtab_g.obj = (H5O_token_t *)HDrealloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0]));
} /* end if */
/* Insert the entry */
n = idtab_g.nobjs++;
- idtab_g.obj[n] = oi->addr;
-} /* end addr_insert() */
+ idtab_g.obj[n] = oi->token;
+} /* end token_insert() */
+
-
/*-------------------------------------------------------------------------
- * Function: addr_lookup
+ * Function: token_lookup
*
- * Purpose: Check if address has already been encountered
+ * Purpose: Check if a token has already been encountered
*
- * Return: Success: TRUE/FALSE
+ * Return: Success: TRUE/FALSE
+ * Failure: (can't fail)
*
- * Failure: (can't fail)
- *
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 5, 2005
*
*-------------------------------------------------------------------------
*/
static H5_ATTR_PURE hbool_t
-addr_lookup(H5O_info_t *oi)
+token_lookup(hid_t loc_id, H5O_info2_t *oi)
{
- size_t n;
+ size_t n;
+ int token_cmp;
if(oi->rc < 2) return FALSE; /*only one link possible*/
- for(n = 0; n < idtab_g.nobjs; n++)
- if(H5F_addr_eq(idtab_g.obj[n], oi->addr))
+ for(n = 0; n < idtab_g.nobjs; n++) {
+ if(H5Otoken_cmp(loc_id, &idtab_g.obj[n], &oi->token, &token_cmp) < 0)
+ return FALSE;
+ if(!token_cmp)
return TRUE;
+ }
return FALSE;
-} /* end addr_lookup() */
+} /* end token_lookup() */
+
-
/*-------------------------------------------------------------------------
- * Function: addr_reset
+ * Function: token_reset
*
- * Purpose: Reset the address tracking data structures
+ * Purpose: Reset the token tracking data structures
*
- * Return: void
+ * Return: void
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, November 5, 2005
*
*-------------------------------------------------------------------------
*/
static void
-addr_reset(void)
+token_reset(void)
{
if(idtab_g.obj)
HDfree(idtab_g.obj);
idtab_g.obj = NULL;
idtab_g.nalloc = idtab_g.nobjs = 0;
-} /* end addr_reset() */
+} /* end token_reset() */
+
-
/*-------------------------------------------------------------------------
* Function: attach_ref_attr
*
@@ -266,8 +288,6 @@ addr_reset(void)
* Programmer: Peter Cao
* Friday, August 4, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -316,7 +336,7 @@ error:
return(-1);
}
-
+
/*-------------------------------------------------------------------------
* Function: attach_reg_ref_attr
*
@@ -327,8 +347,6 @@ error:
* Programmer: Peter Cao
* Monday, March 5, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -393,7 +411,7 @@ error:
return(-1);
}
-
+
/*-------------------------------------------------------------------------
* Function: create_reg_ref_dataset
*
@@ -404,8 +422,6 @@ error:
* Programmer: Peter Cao
* Friday, August 4, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -488,7 +504,7 @@ error:
return(-1);
}
-
+
/*-------------------------------------------------------------------------
* Function: attach_attribute_vl
*
@@ -499,8 +515,6 @@ error:
* Programmer: Peter Cao
* Saturday, December 17, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -537,7 +551,7 @@ done:
if(tid >0 && sid > 0) {
hid_t dxpl_id = H5Pcreate(H5P_DATASET_XFER);
H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL);
- H5Dvlen_reclaim(tid, sid, dxpl_id, buf);
+ H5Treclaim(tid, sid, dxpl_id, buf);
H5Pclose(dxpl_id);
}
if(sid > 0)
@@ -550,19 +564,17 @@ done:
} /* end of attach_attribute_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attach_attributes
*
* Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -584,7 +596,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);
@@ -624,13 +636,13 @@ done:
return ret_value;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attach_paired_attributes
*
* Purpose: Attach NUM_ATTRIBUTES attributes to a pair of objects to be copied
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
* Tuesday, November 1, 2005
@@ -653,7 +665,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);
@@ -693,7 +705,7 @@ done:
return -1;
} /* end test_copy_attach_paired_attributes() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_attribute
*
@@ -786,9 +798,9 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_
/* Reclaim vlen data, if necessary */
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE)
- if(H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE)
- if(H5Dvlen_reclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
+ if(H5Treclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
/* Release raw data buffers */
HDfree(rbuf);
@@ -824,31 +836,27 @@ error:
return FALSE;
} /* end compare_attribute() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_std_attributes
*
* Purpose: Compare "standard" attributes on two objects to check that they are equal
*
- * Return: TRUE if objects have same attributes/FALSE if they are different
+ * Return: TRUE if objects have same attributes/FALSE if they are different
*
* Programmer: Quincey Koziol
* Monday, October 31, 2005
*
- * Note: This isn't very general, the attributes are assumed to be
+ * 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
compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid)
{
hid_t aid = -1, aid2 = -1; /* Attribute IDs */
- H5O_info_t oinfo1, oinfo2; /* Object info */
+ H5O_info2_t oinfo1, oinfo2; /* Object info */
unsigned cpy_flags; /* Object copy flags */
/* Retrieve the object copy flags from the property list, if it's non-DEFAULT */
@@ -859,10 +867,10 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid)
cpy_flags = 0;
/* Check the number of attributes on source dataset */
- if(H5Oget_info(oid, &oinfo1) < 0) TEST_ERROR
+ if(H5Oget_info3(oid, &oinfo1, H5O_INFO_NUM_ATTRS) < 0) TEST_ERROR
/* Check the number of attributes on destination dataset */
- if(H5Oget_info(oid2, &oinfo2) < 0) TEST_ERROR
+ if(H5Oget_info3(oid2, &oinfo2, H5O_INFO_NUM_ATTRS) < 0) TEST_ERROR
if(cpy_flags & H5O_COPY_WITHOUT_ATTR_FLAG) {
/* Check that the destination has no attributes */
@@ -896,19 +904,19 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid)
error:
H5E_BEGIN_TRY {
- H5Aclose(aid2);
- H5Aclose(aid);
+ H5Aclose(aid2);
+ H5Aclose(aid);
} H5E_END_TRY;
return FALSE;
} /* end compare_std_attributes() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_data
*
* Purpose: Compare two buffers of data to check that they are equal
*
- * Return: TRUE if buffer are equal/FALSE if they are different
+ * Return: TRUE if buffer are equal/FALSE if they are different
*
* Programmer: Quincey Koziol
* Monday, November 21, 2005
@@ -968,15 +976,15 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
* for each */
for(elmt=0; elmt<nelmts; elmt++) {
/* Check vlen lengths */
- if(((const hvl_t *)memb1)->len
- != ((const hvl_t *)memb2)->len)
+ if(((const hvl_t *)((const void *)memb1))->len
+ != ((const hvl_t *)((const void *)memb2))->len)
TEST_ERROR
/* Check vlen data */
if(!compare_data(parent1, parent2, pid, base_id,
- ((const hvl_t *)memb1)->len,
- ((const hvl_t *)memb1)->p,
- ((const hvl_t *)memb2)->p, obj_owner))
+ ((const hvl_t *)((const void *)memb1))->len,
+ ((const hvl_t *)((const void *)memb1))->p,
+ ((const hvl_t *)((const void *)memb2))->p, obj_owner))
TEST_ERROR
/* Update member pointers */
@@ -1051,11 +1059,13 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
/* break the infinite loop when the ref_object points to itself */
if(obj_owner > 0) {
- H5O_info_t oinfo1, oinfo2;
+ H5O_info2_t oinfo1, oinfo2;
+ int token_cmp;
- if(H5Oget_info(obj_owner, &oinfo1) < 0) TEST_ERROR
- if(H5Oget_info(obj1_id, &oinfo2) < 0) TEST_ERROR
- if(H5F_addr_eq(oinfo1.addr, oinfo2.addr)) {
+ if(H5Oget_info3(obj_owner, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Oget_info3(obj1_id, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(obj1_id, &oinfo1.token, &oinfo2.token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) {
if(H5Oclose(obj1_id) < 0) TEST_ERROR
if(H5Oclose(obj2_id) < 0) TEST_ERROR
return TRUE;
@@ -1076,6 +1086,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:
@@ -1109,11 +1122,13 @@ compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
/* break the infinite loop when the ref_object points to itself */
if(obj_owner > 0) {
- H5O_info_t oinfo1, oinfo2;
+ H5O_info2_t oinfo1, oinfo2;
+ int token_cmp;
- if(H5Oget_info(obj_owner, &oinfo1) < 0) TEST_ERROR
- if(H5Oget_info(obj1_id, &oinfo2) < 0) TEST_ERROR
- if(H5F_addr_eq(oinfo1.addr, oinfo2.addr)) {
+ if(H5Oget_info3(obj_owner, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Oget_info3(obj1_id, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(obj1_id, &oinfo1.token, &oinfo2.token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) {
if(H5Oclose(obj1_id) < 0) TEST_ERROR
if(H5Oclose(obj2_id) < 0) TEST_ERROR
return TRUE;
@@ -1134,6 +1149,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:
@@ -1149,7 +1167,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
@@ -1169,13 +1187,13 @@ error:
return FALSE;
} /* end compare_data() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_datasets
*
* Purpose: Compare two datasets to check that they are equal
*
- * Return: TRUE if datasets are equal/FALSE if they are different
+ * Return: TRUE if datasets are equal/FALSE if they are different
*
* Programmer: Quincey Koziol
* Tuesday, October 25, 2005
@@ -1195,8 +1213,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 */
@@ -1263,7 +1281,7 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
/* Check that the space used is the same */
/* (Don't check if the dataset is filtered (i.e. compressed, etc.) and
- * the datatype is VLEN, since the addresses for the vlen
+ * the datatype is VLEN, since the tokens for the vlen
* data in each dataset will (probably) be different and the storage
* size will thus vary)
*/
@@ -1296,9 +1314,9 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
/* Reclaim vlen data, if necessary */
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE)
- if(H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE)
- if(H5Dvlen_reclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
+ if(H5Treclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
/* Release raw data buffers */
HDfree(rbuf);
@@ -1332,23 +1350,23 @@ error:
HDfree(rbuf);
if(rbuf2)
HDfree(rbuf2);
- H5Pclose(dcpl2);
- H5Pclose(dcpl);
- H5Sclose(sid2);
- H5Sclose(sid);
- H5Tclose(tid2);
- H5Tclose(tid);
+ H5Pclose(dcpl2);
+ H5Pclose(dcpl);
+ H5Sclose(sid2);
+ H5Sclose(sid);
+ H5Tclose(tid2);
+ H5Tclose(tid);
} H5E_END_TRY;
return FALSE;
} /* end compare_datasets() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_groups
*
* Purpose: Compare two groups to check that they are "equal"
*
- * Return: TRUE if group are equal/FALSE if they are different
+ * Return: TRUE if group are equal/FALSE if they are different
*
* Programmer: Quincey Koziol
* Monday, October 31, 2005
@@ -1384,8 +1402,8 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
if(ginfo2.nlinks > 0) {
char objname[NAME_BUF_SIZE]; /* Name of object in group */
char objname2[NAME_BUF_SIZE]; /* Name of object in group */
- H5L_info_t linfo; /* Link information */
- H5L_info_t linfo2; /* Link information */
+ H5L_info2_t linfo; /* Link information */
+ H5L_info2_t linfo2; /* Link information */
/* Loop over contents of groups */
for(idx = 0; idx < ginfo.nlinks; idx++) {
@@ -1395,18 +1413,24 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
if(HDstrcmp(objname, objname2)) TEST_ERROR
/* Get link info */
- if(H5Lget_info(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Lget_info(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.type != linfo2.type) TEST_ERROR
/* Extra checks for "real" objects */
if(linfo.type == H5L_TYPE_HARD) {
- hid_t oid, oid2; /* IDs of objects within group */
- H5O_info_t oinfo, oinfo2; /* Object info */
+ hid_t oid, oid2; /* IDs of objects within group */
+ H5O_info2_t oinfo, oinfo2; /* Data model object info */
+ H5O_native_info_t ninfo, ninfo2; /* Native file format object info */
/* Compare some pieces of the object info */
- if(H5Oget_info_by_name(gid, objname, &oinfo, H5P_DEFAULT) < 0) TEST_ERROR
- if(H5Oget_info_by_name(gid2, objname2, &oinfo2, H5P_DEFAULT) < 0) TEST_ERROR
+ /* Get data model object info */
+ if(H5Oget_info_by_name3(gid, objname, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(gid2, objname2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Get native object info */
+ if(H5Oget_native_info_by_name(gid, objname, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_native_info_by_name(gid2, objname2, &ninfo2, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
if(oinfo.type != oinfo2.type) TEST_ERROR
if(oinfo.rc != oinfo2.rc) TEST_ERROR
@@ -1417,17 +1441,17 @@ compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
* of messages hasn't increased.
*/
if(H5O_COPY_PRESERVE_NULL_FLAG & copy_flags) {
- if(oinfo.hdr.nmesgs != oinfo2.hdr.nmesgs)
+ if(ninfo.hdr.nmesgs != ninfo2.hdr.nmesgs)
;
else
- if(oinfo.hdr.nmesgs < oinfo2.hdr.nmesgs) TEST_ERROR
+ if(ninfo.hdr.nmesgs < ninfo2.hdr.nmesgs) TEST_ERROR
}
/* Check for object already having been compared */
- if(addr_lookup(&oinfo))
+ if(token_lookup(gid, &oinfo))
continue;
else
- addr_insert(&oinfo);
+ token_insert(&oinfo);
/* Open objects */
if((oid = H5Oopen(gid, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -1450,10 +1474,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 */
@@ -1498,48 +1525,48 @@ error:
return FALSE;
} /* end compare_groups() */
-
+
/*-------------------------------------------------------------------------
* Function: compare_idx_type
*
* Purpose: If using new format, the index array type should be NEW_TYPE
- * If not, the index array type should be OLD_TYPE
+ * If not, the index array type should be OLD_TYPE
*
- * Return: TRUE if the index type retrieved for the dataset DID is
- * as expected
- * FALSE if not
+ * Return: TRUE if the index type retrieved for the dataset DID is
+ * as expected
+ * FALSE if not
*
* Programmer: Vailin Choi; August 2009
*
*-------------------------------------------------------------------------
*/
-static int
+static int
compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type)
{
H5D_chunk_index_t idx_type; /* Dataset chunk index type */
H5F_libver_t low; /* File format low bound */
/* Get the chunk index type */
- if(H5D__layout_idx_type_test(did, &idx_type) < 0)
- FAIL_STACK_ERROR
+ if(H5D__layout_idx_type_test(did, &idx_type) < 0)
+ FAIL_STACK_ERROR
/* Check if we are using the latest version of the format */
- if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
- FAIL_STACK_ERROR
+ if(H5Pget_libver_bounds(fapl, &low, NULL) < 0)
+ FAIL_STACK_ERROR
/* Verify index type */
if(low == H5F_LIBVER_LATEST) {
- if(idx_type != new_type)
- TEST_ERROR
- } else if(idx_type != old_type)
- TEST_ERROR
+ if(idx_type != new_type)
+ TEST_ERROR
+ } else if(idx_type != old_type)
+ TEST_ERROR
return TRUE;
error:
return FALSE;
} /* compare_idx_type() */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype
*
@@ -1551,8 +1578,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1560,8 +1585,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named datatype");
@@ -1569,8 +1594,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -1594,7 +1619,7 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datatype from SRC to DST */
@@ -1626,15 +1651,15 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_named_datatype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype_vl
*
@@ -1653,8 +1678,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named vlen datatype");
@@ -1662,8 +1687,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -1687,7 +1712,7 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datatype from SRC to DST */
@@ -1719,15 +1744,15 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_named_datatype_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype_vl_vl
*
@@ -1746,8 +1771,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named nested vlen datatype");
@@ -1755,8 +1780,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -1786,7 +1811,7 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datatype from SRC to DST */
@@ -1818,15 +1843,15 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_named_datatype_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_named_datatype_attr_self
*
@@ -1840,8 +1865,6 @@ error:
* Programmer: Neil
* Friday, March 11, 2011
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -1852,10 +1875,11 @@ test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
hid_t aid = -1; /* Attribute ID */
hid_t sid = -1; /* Dataspace ID */
hsize_t dims[2] = {3, 4}; /* Dataspace dimensions */
- H5O_info_t oinfo, oinfo2; /* Object info */
+ H5O_info2_t oinfo, oinfo2; /* Object info */
H5G_info_t ginfo; /* Group info */
- char src_filename[NAME_BUF_SIZE];
- char dst_filename[NAME_BUF_SIZE];
+ hbool_t same_type;
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
TESTING("H5Ocopy(): named datatype with self-referential attribute");
@@ -1863,8 +1887,8 @@ test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -1903,7 +1927,7 @@ test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datatype from SRC to DST */
@@ -1930,10 +1954,20 @@ test_copy_named_datatype_attr_self(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* verify that the attribute's datatype is committed */
if(H5Tcommitted(tid) != TRUE) TEST_ERROR
- /* verify that the addresses of the datatypes are the same */
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(H5Oget_info(tid2, &oinfo2) < 0) TEST_ERROR
- if(oinfo.fileno != oinfo2.fileno || oinfo.addr != oinfo2.addr)
+ /* verify that the tokens of the datatypes are the same */
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Oget_info3(tid2, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
+
+ same_type = TRUE;
+ if(oinfo.fileno == oinfo2.fileno) {
+ int token_cmp;
+ if(H5Otoken_cmp(tid2, &oinfo.token, &oinfo2.token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) same_type = FALSE;
+ }
+ else
+ same_type = FALSE;
+
+ if(!same_type)
FAIL_PUTS_ERROR("destination attribute does not use the same committed datatype")
/* Verify that there are only 2 links int he destination root group */
@@ -1969,7 +2003,7 @@ error:
return 1;
} /* end test_copy_named_datatype_attr_self */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_simple
*
@@ -1981,8 +2015,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2008,8 +2040,8 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -2046,7 +2078,7 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -2078,16 +2110,193 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple */
-
+
+/*-------------------------------------------------------------------------
+ * Function: test_copy_dataset_versionbounds
+ *
+ * Purpose: Verify copying dataset works as expected in various version
+ * bound combination.
+ *
+ * Description:
+ * Create a simple dataset in SRC file using default versions.
+ * For each valid version bound combination, create a DST file,
+ * and attempt to copy the SRC dataset to the DST file.
+ * When copying fails, verify that the failure is a result of
+ * the invalid bounds, that is, DST has lower bounds than SRC.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src)
+{
+ hid_t fid_src = -1, fid_dst = -1; /* Source and destination file IDs */
+ hid_t fapl_dst = -1; /* File access plist for dest file */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t did_src = -1, did_dst = -1; /* Source and destination dataset IDs */
+ int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */
+ hsize_t dim2d[2]; /* Dataset dimensions */
+ char src_fname[NAME_BUF_SIZE]; /* Name of source file */
+ char dst_fname[NAME_BUF_SIZE]; /* Name of destination file */
+ H5F_libver_t low, high; /* File format bounds */
+ unsigned srcdset_layoutversion; /* Layout version of source dataset */
+ int i, j; /* Local index variables */
+ H5D_t *dsetp = NULL; /* Pointer to internal dset structure */
+ herr_t ret; /* Generic return value */
+
+ TESTING("H5Ocopy(): simple dataset with version bounds");
+
+ /* Initialize write buffer */
+ for (i=0; i<DIM_SIZE_1; i++)
+ for (j=0; j<DIM_SIZE_2; j++)
+ buf[i][j] = 10000 + 100*i+j;
+
+ /* Create a file access property list for destination file */
+ if ((fapl_dst = h5_fileaccess()) < 0) TEST_ERROR
+
+ /* Initialize the filenames */
+ h5_fixname(FILENAME[4], fapl_src, src_fname, sizeof src_fname);
+ h5_fixname(FILENAME[5], fapl_dst, dst_fname, sizeof dst_fname);
+
+ /* Reset file token checking info */
+ token_reset();
+
+ /* Create source file */
+ fid_src = H5Fcreate(src_fname, H5F_ACC_TRUNC, fcpl_src, fapl_src);
+ if (fid_src < 0) TEST_ERROR
+
+ /* Set dataspace dimensions */
+ dim2d[0] = DIM_SIZE_1;
+ dim2d[1] = DIM_SIZE_2;
+
+ /* Create 2D dataspace */
+ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
+
+ /* Create 2D int dataset in SRC file */
+ did_src = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (did_src < 0) TEST_ERROR
+
+ /* Write data into SRC file */
+ ret = H5Dwrite(did_src, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ if (ret < 0) TEST_ERROR
+
+ /* Get the internal dset ptr to get the fill version for verifying later */
+ if ((dsetp = (H5D_t *)H5VL_object(did_src)) == NULL) TEST_ERROR
+
+ srcdset_layoutversion = dsetp->shared->layout.version;
+
+ /* Close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* Close the dataset */
+ if(H5Dclose(did_src) < 0) TEST_ERROR
+
+ /* Close the SRC file */
+ if(H5Fclose(fid_src) < 0) TEST_ERROR
+
+ /* Open the source file with read-only */
+ fid_src = H5Fopen(src_fname, H5F_ACC_RDONLY, fapl_src);
+ if (fid_src < 0) TEST_ERROR
+
+ /* Loop through all the combinations of low/high library format bounds,
+ skipping invalid combinations. Create a destination file and copy the
+ source dataset to it, then verify */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl_dst, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create destination file */
+ fid_dst = H5Fcreate(dst_fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_dst);
+ if (fid_dst < 0) TEST_ERROR
+
+ /* Create an uncopied object in destination file so that tokens
+ in source and destination files aren't the same */
+ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Try to copy the dataset */
+ H5E_BEGIN_TRY {
+ ret = H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ /* If copy failed, check if the failure is expected */
+ if (ret < 0)
+ {
+ /* Failure is valid if layout version of source dataset is
+ greater than destination */
+ if (srcdset_layoutversion <= H5O_layout_ver_bounds[high])
+ TEST_ERROR
+
+ /* Close the DST file before continue */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+ continue;
+ }
+
+ /* Close the DST file */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+
+ /* Open destination file */
+ fid_dst = H5Fopen(dst_fname, H5F_ACC_RDWR, fapl_dst);
+ if (fid_dst < 0) TEST_ERROR
+
+ /* Open the datasets to compare */
+ did_src = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT);
+ if (did_src < 0) TEST_ERROR
+ did_dst = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT);
+ if (did_dst < 0) TEST_ERROR
+
+ /* Check if the datasets are equal */
+ if (compare_datasets(did_src, did_dst, H5P_DEFAULT, buf) != TRUE)
+ TEST_ERROR
+
+ /* Close the datasets */
+ if(H5Dclose(did_dst) < 0) TEST_ERROR
+ if(H5Dclose(did_src) < 0) TEST_ERROR
+
+ /* Close the DST file */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+
+ } /* for high */
+ } /* for low */
+
+ /* Close property list and source file */
+ if (H5Pclose(fapl_dst) < 0) TEST_ERROR
+ if (H5Fclose(fid_src) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose(did_dst);
+ H5Dclose(did_src);
+ H5Sclose(sid);
+ H5Pclose(fapl_dst);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ } H5E_END_TRY;
+
+ return 1;
+} /* end test_copy_dataset_versionbounds */
+
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_simple_samefile
*
@@ -2099,8 +2308,6 @@ error:
* Programmer: Neil Fortner
* Thursday, January 15, 2009
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2124,8 +2331,8 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl)
/* Initialize the filenames */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
@@ -2185,22 +2392,22 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple_samefile */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_simple_empty
*
* Purpose: Create a simple dataset in SRC file and copy it to DST file
* (Note: dataset has no data)
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -2231,8 +2438,8 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -2269,7 +2476,7 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -2303,16 +2510,16 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple_empty */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compound
*
@@ -2324,8 +2531,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2357,8 +2562,8 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -2402,7 +2607,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -2434,17 +2639,17 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compound */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked
*
@@ -2456,8 +2661,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -2491,8 +2694,8 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -2526,10 +2729,10 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* Create 1-D dataset: chunked, non-filterd, with data
- * dims=max dims=chunk dims
- * H5D_ALLOC_TIME_INC (default)
+ * dims=max dims=chunk dims
+ * H5D_ALLOC_TIME_INC (default)
*/
/* create 1-D dataspace */
if((sid = H5Screate_simple(1, dim1d, dim1d)) < 0) TEST_ERROR
@@ -2601,9 +2804,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims,
- * H5D_ALLOC_TIME_INC (default)
+ * H5D_ALLOC_TIME_INC (default)
*/
/* create 2-D dataspace */
@@ -2625,9 +2828,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims,
- * H5D_ALLOC_TIME_EARLY
+ * H5D_ALLOC_TIME_EARLY
*/
if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
@@ -2649,9 +2852,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
- /*
+ /*
* Create 2-D dataset: chunked, non-filterd, with data, dims=max dims=chunk dims,
- * H5D_ALLOC_TIME_LATE
+ * H5D_ALLOC_TIME_LATE
*/
/* create 2-D dataspace */
if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR
@@ -2689,7 +2892,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datasets from SRC to DST */
@@ -2710,7 +2913,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR
@@ -2730,7 +2933,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR
@@ -2749,7 +2952,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2769,7 +2972,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2788,7 +2991,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2807,7 +3010,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2826,7 +3029,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR
@@ -2848,17 +3051,17 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_empty
*
@@ -2894,8 +3097,8 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -2926,9 +3129,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 1-D dataset: chunked, empty, non-filtered,
- * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
+ * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
*/
/* Set 1-D dataspace dimensions */
@@ -2996,9 +3199,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, empty, non-filtered,
- * dims=chunk dims, H5D_ALLOC_TIME_INC (default)
+ * dims=chunk dims, H5D_ALLOC_TIME_INC (default)
*/
/* Set 2-D dataspace dimensions */
@@ -3021,9 +3224,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, empty, non-filtered, dims=chunk dims
- * H5D_ALLOC_TIME_EARLY
+ * H5D_ALLOC_TIME_EARLY
*/
/* Set allocation time to early */
if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
@@ -3043,9 +3246,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
- * create 2-D dataset: chunked, empty, non-filtered,
- * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE
+ /*
+ * create 2-D dataset: chunked, empty, non-filtered,
+ * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE
*/
/* Set 2-D dataspace dimensions */
@@ -3087,7 +3290,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datasets from SRC to DST */
@@ -3107,7 +3310,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3126,7 +3329,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3145,7 +3348,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3164,7 +3367,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3184,7 +3387,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3204,7 +3407,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3223,7 +3426,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3245,17 +3448,17 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_empty */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_sparse
*
@@ -3304,8 +3507,8 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -3462,7 +3665,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the datasets from SRC to DST */
@@ -3479,7 +3682,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3499,7 +3702,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3519,7 +3722,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3539,7 +3742,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Check if the array index type is correct */
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3562,17 +3765,17 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_sparse */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed
*
@@ -3617,8 +3820,8 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -3669,9 +3872,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, filtered, with data
- * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
+ * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default)
*/
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR
@@ -3693,9 +3896,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, filtered, with data
- * dims=chunk dims, H5D_ALLOC_TIME_EARLY
+ * dims=chunk dims, H5D_ALLOC_TIME_EARLY
*/
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
@@ -3721,9 +3924,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* close the dataset */
if(H5Dclose(did) < 0) TEST_ERROR
- /*
+ /*
* create 2-D dataset: chunked, filtered, with data
- * dims=chunk dims, H5D_ALLOC_TIME_LATE
+ * dims=chunk dims, H5D_ALLOC_TIME_LATE
*/
/* create dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
@@ -3764,7 +3967,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -3788,7 +3991,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3807,7 +4010,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3825,7 +4028,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3843,7 +4046,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3861,7 +4064,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED4_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR
if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE)
- TEST_ERROR
+ TEST_ERROR
/* Check if the datasets are equal */
if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR
@@ -3885,24 +4088,24 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
#ifdef H5_HAVE_FILTER_DEFLATE
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
#endif /* H5_HAVE_FILTER_DEFLATE */
} /* end test_copy_dataset_compressed */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_no_edge_filt
*
* Purpose: Create a compressed, chunked dataset in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -3951,8 +4154,8 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4002,7 +4205,7 @@ test_copy_dataset_no_edge_filt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4053,13 +4256,13 @@ error:
#endif /* H5_HAVE_FILTER_DEFLATE */
} /* end test_copy_dataset_no_edge_filt */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact
*
* Purpose: Create a compact dataset in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -4098,8 +4301,8 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4145,7 +4348,7 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4179,17 +4382,17 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_external
*
@@ -4201,8 +4404,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -4232,8 +4433,8 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4274,7 +4475,7 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4306,17 +4507,17 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_external */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_named_dtype
*
@@ -4354,8 +4555,8 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4395,7 +4596,7 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4427,17 +4628,17 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_named_dtype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_named_dtype_hier
*
@@ -4476,8 +4677,8 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4532,7 +4733,7 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4564,18 +4765,18 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_named_dtype_hier */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_named_dtype_hier_outside
*
@@ -4615,8 +4816,8 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4671,7 +4872,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4703,18 +4904,18 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_named_dtype_hier_outside */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_multi_ohdr_chunks
*
@@ -4760,8 +4961,8 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4815,7 +5016,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4825,7 +5026,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa
/* close the second dataset */
if(H5Dclose(did2) < 0) TEST_ERROR
- } else
+ } else
/* open the group for copy */
if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -4852,18 +5053,18 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_multi_ohdr_chunks */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_attr_named_dtype
*
@@ -4902,8 +5103,8 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -4961,7 +5162,7 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -4993,19 +5194,19 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_attr_named_dtype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_vl
*
@@ -5048,8 +5249,8 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -5082,7 +5283,7 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -5114,7 +5315,7 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -5129,19 +5330,19 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_vl
*
@@ -5186,8 +5387,8 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -5241,7 +5442,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -5297,7 +5498,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -5312,20 +5513,20 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_vl
*
@@ -5369,8 +5570,8 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -5410,7 +5611,7 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -5442,7 +5643,7 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -5457,19 +5658,19 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attribute_vl
*
@@ -5501,8 +5702,8 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -5536,7 +5737,7 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -5575,11 +5776,11 @@ error:
H5E_BEGIN_TRY {
H5Aclose(aid2);
H5Aclose(aid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_simple_empty */
@@ -5598,18 +5799,19 @@ error:
static int
attach_attribute_compound_vlstr(hid_t loc_id)
{
- hid_t aid = -1; /* Attribute ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t tid = -1; /* Datatype ID */
- hid_t vl_str_tid = -1; /* Variable length string datatype ID */
- hid_t cmpd_tid = -1; /* Compound datatype ID */
- hsize_t dim1 = 1; /* Dimension size */
- typedef struct { /* Compound structure for the attribute */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t vl_str_tid = -1; /* Variable length string datatype ID */
+ hid_t cmpd_tid = -1; /* Compound datatype ID */
+ hsize_t dim1 = 1; /* Dimension size */
+ typedef struct { /* Compound structure for the attribute */
int i;
char *v;
} s1;
- s1 buf; /* Buffer */
- int ret_value = -1; /* Return value */
+ size_t len;
+ s1 buf = {0, NULL}; /* Buffer */
+ int ret_value = -1; /* Return value */
/* Create dataspace */
if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 )
@@ -5638,8 +5840,11 @@ attach_attribute_compound_vlstr(hid_t loc_id)
goto done;
/* Write to the attribute */
+ len = HDstrlen(ATTR_CMPD_STRING) + 1;
buf.i = 9;
- buf.v = "ThisIsAString";
+ if(NULL == (buf.v = (char *)HDcalloc(len, sizeof(char))))
+ goto done;
+ HDstrncpy(buf.v, ATTR_CMPD_STRING, len);
if(H5Awrite(aid, cmpd_tid, &buf) < 0)
goto done;
@@ -5656,6 +5861,9 @@ done:
H5Tclose(cmpd_tid);
if(aid > 0)
H5Aclose(aid);
+
+ HDfree(buf.v);
+
return ret_value;
} /* attach_attribute_compound_vlstr */
@@ -5663,7 +5871,7 @@ done:
* Function: compare_attribute_compound_vlstr
*
* Purpose: Compare data of the attributes attached to the two objects.
- * The attribute is a compound datatype with a variable length string.
+ * The attribute is a compound datatype with a variable length string.
*
* Return: Non-negative on success/Negative on failure
*
@@ -5674,54 +5882,80 @@ done:
static int
compare_attribute_compound_vlstr(hid_t loc, hid_t loc2)
{
- hid_t aid = -1, aid2 = -1; /* Attribute IDs */
- hid_t tid = -1, tid2 = -1; /* Datatype IDs */
- typedef struct { /* Compound structure for the attribute */
- int i;
- char *v;
+ hid_t aid = -1, aid2 = -1; /* Attribute IDs */
+ hid_t tid = -1, tid2 = -1; /* Datatype IDs */
+ hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t dxpl_id = -1;
+ typedef struct { /* Compound structure for the attribute */
+ int i;
+ char *v;
} s1;
- s1 rbuf; /* Buffer for data read */
- s1 rbuf2; /* Buffer for data read */
-
+ s1 rbuf; /* Buffer for data read */
+ s1 rbuf2; /* Buffer for data read */
+
/* Open the attributes attached to the objects */
if((aid = H5Aopen_by_idx(loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if((aid2 = H5Aopen_by_idx(loc2, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Get the attributes' datatypes */
- if((tid = H5Aget_type(aid)) < 0)
- FAIL_STACK_ERROR
+ if((tid = H5Aget_type(aid)) < 0)
+ FAIL_STACK_ERROR
if((tid2 = H5Aget_type(aid2)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
+
+ /* Get the attributes' dataspaces */
+ if((sid = H5Aget_space(aid)) < 0)
+ FAIL_STACK_ERROR
+ if((sid2 = H5Aget_space(aid2)) < 0)
+ FAIL_STACK_ERROR
/* Read the attributes */
if(H5Aread(aid, tid, &rbuf) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Aread(aid2, tid2, &rbuf2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Compare the attributes' data */
if(rbuf.i != rbuf2.i)
- FAIL_STACK_ERROR
- if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v))
- FAIL_STACK_ERROR
- if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)))
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
+ if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v))
+ FAIL_STACK_ERROR
+ if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v)))
+ FAIL_STACK_ERROR
+
+ /* Reclaim vlen buffer */
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
+ if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, &rbuf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, &rbuf2) < 0) TEST_ERROR
+ if(H5Pclose(dxpl_id) < 0) TEST_ERROR
+
+ /* Close the dataspaces */
+ if(H5Sclose(sid) < 0)
+ FAIL_STACK_ERROR
+ if(H5Sclose(sid2) < 0)
+ FAIL_STACK_ERROR
/* Close the attributes */
if(H5Aclose(aid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Aclose(aid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
return TRUE;
error:
H5E_BEGIN_TRY {
H5Aclose(aid);
H5Aclose(aid2);
+ H5Treclaim(tid, sid, H5P_DEFAULT, &rbuf);
+ H5Treclaim(tid, sid, H5P_DEFAULT, &rbuf2);
+ H5Sclose(sid);
+ H5Sclose(sid2);
H5Tclose(tid);
H5Tclose(tid2);
+ H5Pclose(dxpl_id);
} H5E_END_TRY;
return FALSE;
@@ -5731,15 +5965,15 @@ error:
* Function: test_copy_attribute_compound_vlstr
*
* Purpose: Create a simple dataset and a group in SRC file.
- * Both has an attribute with a compound datatype consisting
+ * Both has an attribute with a compound datatype consisting
* of a variable length string
* Copy the dataset and the group to DST file
- * This is for HDFFV-7991
+ * This is for HDFFV-7991
*
* Return: Success: 0
* Failure: number of errors
*
- * Programmer:
+ * Programmer:
*
*-------------------------------------------------------------------------
*/
@@ -5750,10 +5984,10 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
hid_t aid = -1, aid2 = -1; /* Attribute IDs */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
hsize_t dim2d[2]; /* Dataset dimensions */
- char src_filename[NAME_BUF_SIZE]; /* Source file name */
- char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ char src_filename[NAME_BUF_SIZE]; /* Source file name */
+ char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
TESTING("H5Ocopy(): attribute with compound datatype consisting of variable length string");
@@ -5761,12 +5995,12 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* set dataspace dimensions */
dim2d[0] = DIM_SIZE_1;
@@ -5774,103 +6008,103 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create 2D dataspace */
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* create 2D int dataset at SRC file */
if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close dataspace */
if(H5Sclose(sid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* attach an attribute to the dataset */
if(attach_attribute_compound_vlstr(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the dataset */
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* create a group */
if((gid = H5Gcreate2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* attach attribute to the group */
if(attach_attribute_compound_vlstr(gid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the group */
if(H5Gclose(gid) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the SRC file */
if(H5Fclose(fid_src) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* copy the dataset from SRC to DST */
if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* open the src dataset */
if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* open the destination dataset */
if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* compare the data of the attributes attached to the two datasets */
if(compare_attribute_compound_vlstr(did, did2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the datasets */
if(H5Dclose(did2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Dclose(did) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Copy the group */
if(H5Ocopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Open the src group */
if((gid = H5Gopen2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Open the destination group */
if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* compare the data of the attributes attached to the two groups */
if(compare_attribute_compound_vlstr(gid, gid2) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the groups */
- if(H5Gclose(gid) < 0)
- FAIL_STACK_ERROR
- if(H5Gclose(gid2) < 0)
- FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0)
+ FAIL_STACK_ERROR
+ if(H5Gclose(gid2) < 0)
+ FAIL_STACK_ERROR
/* close the SRC file */
if(H5Fclose(fid_src) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
PASSED();
return 0;
@@ -5879,18 +6113,18 @@ error:
H5E_BEGIN_TRY {
H5Aclose(aid2);
H5Aclose(aid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid);
- H5Gclose(gid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Gclose(gid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_attribute_compound_vlstr() */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed_vl
*
@@ -5943,8 +6177,8 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -5986,7 +6220,7 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -6017,7 +6251,7 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -6034,21 +6268,21 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
#ifdef H5_HAVE_FILTER_DEFLATE
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Pclose(pid);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Pclose(pid);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
#endif /* H5_HAVE_FILTER_DEFLATE */
} /* end test_copy_dataset_compressed_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_empty
*
@@ -6060,8 +6294,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6078,8 +6310,8 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6103,7 +6335,7 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6135,15 +6367,15 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
error:
H5E_BEGIN_TRY {
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_empty */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_root_group
*
@@ -6155,8 +6387,6 @@ error:
* Programmer: Peter Cao
* August 8, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6184,8 +6414,8 @@ test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6233,7 +6463,7 @@ test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6276,7 +6506,7 @@ error:
return 1;
} /* end test_copy_root_group */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group
*
@@ -6288,8 +6518,6 @@ error:
* Programmer: Peter Cao
* Friday, September 30, 2005
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -6317,8 +6545,8 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6367,7 +6595,7 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6399,18 +6627,18 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_deep
*
@@ -6450,8 +6678,8 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6471,15 +6699,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
@@ -6509,7 +6737,7 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6541,18 +6769,18 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_deep */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_loop
*
@@ -6581,8 +6809,8 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6620,7 +6848,7 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6652,17 +6880,17 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f
error:
H5E_BEGIN_TRY {
- H5Gclose(gid_sub2);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Gclose(gid_sub2);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_loop */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_wide_loop
*
@@ -6698,8 +6926,8 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6712,11 +6940,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 */
@@ -6749,7 +6977,7 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6781,17 +7009,17 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t
error:
H5E_BEGIN_TRY {
- H5Gclose(gid_sub2);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Gclose(gid_sub2);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_wide_loop */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_group_links
*
@@ -6803,12 +7031,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
@@ -6821,7 +7043,7 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
hid_t plid = -1; /* Object copy plist ID */
hsize_t dim2d[2];
hsize_t dim1d[1];
- H5L_info_t linfo;
+ H5L_info2_t linfo;
int buf[DIM_SIZE_1][DIM_SIZE_2];
int i, j;
unsigned expand_soft;
@@ -6843,8 +7065,8 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
h5_fixname(FILENAME[1], src_fapl, dst_filename, sizeof dst_filename);
h5_fixname(FILENAME[2], dst_fapl, ext_filename, sizeof ext_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -6938,7 +7160,7 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the group from SRC to DST */
@@ -6955,7 +7177,7 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
* re-add it as a soft link so compare_groups() works */
if(expand_soft) {
/* Check link type */
- if(H5Lget_info(fid_dst, NAME_LINK_SOFT, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid_dst, NAME_LINK_SOFT, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.type != H5L_TYPE_HARD)
FAIL_PUTS_ERROR("Soft link was not expanded to a hard link")
@@ -6978,7 +7200,7 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
* and re-add it as an external link so compare_groups() works */
if(expand_ext) {
/* Check link type */
- if(H5Lget_info(fid_dst, NAME_LINK_EXTERN, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(fid_dst, NAME_LINK_EXTERN, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
if(linfo.type != H5L_TYPE_HARD)
FAIL_PUTS_ERROR("External link was not expanded to a hard link")
@@ -7039,20 +7261,20 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_ext);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
- H5Pclose(plid);
+ H5Sclose(sid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_ext);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ H5Pclose(plid);
} H5E_END_TRY;
return 1;
} /* end test_copy_group_links */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_soft_link
*
@@ -7098,8 +7320,8 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -7144,7 +7366,7 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -7178,17 +7400,17 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_soft_link */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_ext_link
*
@@ -7228,8 +7450,8 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
h5_fixname(FILENAME[1], src_fapl, dst_filename, sizeof dst_filename);
h5_fixname(FILENAME[2], dst_fapl, ext_filename, sizeof ext_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -7277,7 +7499,7 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -7312,17 +7534,17 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
error:
H5E_BEGIN_TRY {
- H5Sclose(sid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Sclose(sid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_ext_link */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_exist
*
@@ -7361,8 +7583,8 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -7399,7 +7621,7 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -7422,15 +7644,15 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_exist */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_path
*
@@ -7470,8 +7692,8 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -7508,7 +7730,7 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST (should fail - intermediate groups not there) */
@@ -7556,17 +7778,17 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Sclose(sid);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_path */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_same_file_named_datatype
*
@@ -7592,8 +7814,8 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl)
/* Initialize the filenames */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR
@@ -7628,21 +7850,21 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl)
error:
H5E_BEGIN_TRY {
- H5Tclose(tid2);
- H5Tclose(tid);
- H5Fclose(fid);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
} /* end test_copy_same_file_named_datatype */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_old_layout
*
* Purpose: Copy dataset that uses the "old" layout version (pre version 3)
* format.
*
- * Note: This test uses the "fill_old.h5" file for convenience, since it
+ * Note: This test uses the "fill_old.h5" file for convenience, since it
* has a dataset with the old layout format.
*
* Return: Success: 0
@@ -7658,6 +7880,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t did = -1, did2 = -1; /* Dataset IDs */
+ hid_t src_fapl = -1; /* Source file FAPL ID */
const char *src_filename = H5_get_srcdir_filename(FILE_OLD_LAYOUT); /* Corrected test file name */
char dst_filename[NAME_BUF_SIZE];
@@ -7670,16 +7893,22 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
/* Initialize the destination filename */
h5_fixname(FILENAME[1], fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
+
+ /* Setup */
+ if((src_fapl = h5_fileaccess_flags(H5_FILEACCESS_LIBVER)) < 0) TEST_ERROR
/* open source file (read-only) */
- if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
+
+ /* Close source FAPL */
+ if(H5Pclose(src_fapl) < 0) TEST_ERROR
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(test_open) {
@@ -7718,15 +7947,16 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open)
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(src_fapl);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_old_layout */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_named_vl
*
@@ -7770,8 +8000,8 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -7788,7 +8018,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 */
@@ -7820,7 +8050,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -7852,7 +8082,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
if(H5Tdetect_class(tid_copy, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -7867,21 +8097,21 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid_copy, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_named_vl
*
@@ -7924,8 +8154,8 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -7942,7 +8172,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 */
@@ -7967,7 +8197,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -7999,7 +8229,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
if(H5Tdetect_class(tid_copy, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -8014,27 +8244,27 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid_copy, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_named_vl
*
* Purpose: Create a dataset that uses a named variable length datatype
* in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -8079,8 +8309,8 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -8097,7 +8327,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 */
@@ -8132,7 +8362,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -8166,7 +8396,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
if(H5Tdetect_class(tid_copy, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -8181,21 +8411,21 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid_copy, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed_named_vl
*
@@ -8240,8 +8470,8 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -8258,7 +8488,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 */
@@ -8291,7 +8521,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -8323,7 +8553,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
if(H5Tdetect_class(tid_copy, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid_copy, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -8338,21 +8568,21 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid_copy);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid_copy, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_copy);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compressed_named_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_vl_vl
*
@@ -8410,8 +8640,8 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -8454,7 +8684,7 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -8485,7 +8715,7 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -8501,28 +8731,28 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid2, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_vl_vl
*
* Purpose: Create a compact dataset w/nested VLEN datatype
* in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -8580,8 +8810,8 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -8625,7 +8855,7 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -8658,7 +8888,7 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -8674,21 +8904,21 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid2, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_vl_vl
*
@@ -8707,7 +8937,7 @@ static int
test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl)
{
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
- hid_t tid = -1, tid2=-1; /* Datatype ID */
+ hid_t tid = -1, tid2=-1; /* Datatype ID */
hid_t sid = -1; /* Dataspace ID */
hid_t pid = -1; /* Dataset creation property list ID */
hid_t did = -1, did2 = -1; /* Dataset IDs */
@@ -8746,8 +8976,8 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -8859,7 +9089,7 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -8875,28 +9105,28 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid2, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_vl_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compressed_vl_vl
*
* Purpose: Create a dataset that uses a named variable length datatype
* in SRC file and copy it to DST file
*
- * Note: The parameter "test_open" is added to test for H5Ocopy when
+ * Note: The parameter "test_open" is added to test for H5Ocopy when
* the dataset is open in the file (HDFFV-7853).
*
* Return: Success: 0
@@ -8954,8 +9184,8 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -8998,7 +9228,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
}
-
+
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
@@ -9035,7 +9265,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid2, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -9051,16 +9281,16 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
error:
H5E_BEGIN_TRY {
- H5Pclose(pid);
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Tclose(tid);
- H5Tclose(tid2);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid2, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Tclose(tid);
+ H5Tclose(tid2);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compressed_vl_vl */
@@ -9074,7 +9304,7 @@ typedef struct cmpd_vl_t {
double c;
} cmpd_vl_t;
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_contig_cmpd_vl
*
@@ -9121,8 +9351,8 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -9159,7 +9389,7 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -9191,7 +9421,7 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -9207,20 +9437,20 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
H5Pclose(dxpl_id);
H5Tclose(tid2);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_contig_cmpd_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_chunked_cmpd_vl
*
@@ -9267,8 +9497,8 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -9312,7 +9542,7 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -9344,7 +9574,7 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -9360,21 +9590,21 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
H5Pclose(dxpl_id);
H5Pclose(pid);
H5Tclose(tid2);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_chunked_cmpd_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_compact_cmpd_vl
*
@@ -9420,8 +9650,8 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -9465,7 +9695,7 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy the dataset from SRC to DST */
@@ -9497,7 +9727,7 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
if(H5Pset_vlen_mem_manager(dxpl_id, NULL, NULL, NULL, NULL) < 0) TEST_ERROR
- if(H5Dvlen_reclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
+ if(H5Treclaim(tid, sid, dxpl_id, buf) < 0) TEST_ERROR
if(H5Pclose(dxpl_id) < 0) TEST_ERROR
} /* end if */
@@ -9513,21 +9743,21 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
error:
H5E_BEGIN_TRY {
- H5Dclose(did2);
- H5Dclose(did);
- H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf);
- H5Pclose(dxpl_id);
- H5Pclose(pid);
+ H5Dclose(did2);
+ H5Dclose(did);
+ H5Treclaim(tid, sid, H5P_DEFAULT, buf);
+ H5Pclose(dxpl_id);
+ H5Pclose(pid);
H5Tclose(tid2);
- H5Tclose(tid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_compact_cmpd_vl */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_null_ref
*
@@ -9571,8 +9801,8 @@ test_copy_null_ref(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap
h5_fixname(FILENAME[1], src_fapl, mid_filename, sizeof mid_filename);
h5_fixname(FILENAME[2], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* Create source file */
if((fid1 = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0)
@@ -9689,7 +9919,7 @@ error:
return 1;
} /* end test_copy_null_ref */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_null_ref_open
*
@@ -9740,8 +9970,8 @@ test_copy_null_ref_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
h5_fixname(FILENAME[1], src_fapl, mid_filename, sizeof mid_filename);
h5_fixname(FILENAME[2], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* Create source file */
if((fid1 = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0)
@@ -9872,7 +10102,7 @@ error:
return 1;
} /* end test_copy_null_ref_open */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_attr_crt_order
*
@@ -9902,8 +10132,8 @@ test_copy_attr_crt_order(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], src_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* Create source file */
if((fid1 = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0)
@@ -9994,7 +10224,7 @@ error:
return 1;
} /* end test_copy_attr_crt_order */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_datatype_merge
*
@@ -10020,11 +10250,12 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
unsigned int i; /* Local index variables */
hsize_t dim1d[1]; /* Dataset dimensions */
int buf[DIM_SIZE_1]; /* Buffer for writing data */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char src1_filename[NAME_BUF_SIZE];
char src2_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
+ int token_cmp;
if(reopen) {
TESTING("H5Ocopy(): merging committed datatypes with reopen")
@@ -10041,8 +10272,8 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
h5_fixname(FILENAME[3], src_fapl, src2_filename, sizeof src2_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source files */
if((fid_src1 = H5Fcreate(src1_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -10060,7 +10291,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 */
@@ -10084,7 +10315,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 */
@@ -10118,7 +10349,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy SRC1 to DST */
@@ -10133,31 +10364,34 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open SRC1 committed dtype, get address */
+ /* Open SRC1 committed dtype, get token */
if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open SRC1 dset dtype, check address */
+ /* Open SRC1 dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open SRC2 committed dtype, check address */
+ /* Open SRC2 committed dtype, check token */
if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open SRC2 dset dtype, check address */
+ /* Open SRC2 dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10171,7 +10405,7 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
/* recreate destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* copy SRC1 to DST */
@@ -10186,19 +10420,20 @@ test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open SRC1 dset dtype, get address */
+ /* Open SRC1 dset dtype, get token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open SRC2 dset dtype, check address */
+ /* Open SRC2 dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10231,7 +10466,7 @@ error:
return 1;
} /* end test_copy_committed_datatype_merge */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_datatype_merge_same_file
*
@@ -10258,9 +10493,10 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
unsigned int i; /* Local index variables */
hsize_t dim1d[1]; /* Dataset dimensions */
int buf[DIM_SIZE_1]; /* Buffer for writing data */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char filename[NAME_BUF_SIZE];
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): merging committed datatypes to the source file with reopen")
@@ -10274,8 +10510,8 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/* Initialize the filename */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create file */
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR
@@ -10295,7 +10531,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 */
@@ -10322,7 +10558,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 */
@@ -10348,7 +10584,7 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
/*
* First copy each group to the destination group 3 (each with their own
* group), and verify the committed datatypes are merged as expected. All
- * datatypes copied should reference (share an address with) the
+ * datatypes copied should reference (share a token with) the
* corresponding source datatype.
*/
/* Create destination group */
@@ -10367,61 +10603,68 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open group 1 source committed dtype, get address */
+ /* Open group 1 source committed dtype, get token */
if((tid = H5Topen2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open group 1 source dset dtype, check address */
+ /* Open group 1 source dset dtype, check token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open group 1 committed dtype, check address */
+ /* Open group 1 committed dtype, check token */
if((tid = H5Topen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open group 1 dset dtype, check address */
+ /* Open group 1 dset dtype, check token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open group 2 source committed dtype, get address and make sure it is
+ /* Open group 2 source committed dtype, get token and make sure it is
* different from group 1 source committed dtype */
if((tid = H5Topen2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr == exp_addr) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open group 2 source dset dtype, check address */
+ /* Open group 2 source dset dtype, check token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open group 2 committed dtype, check address */
+ /* Open group 2 committed dtype, check token */
if((tid = H5Topen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open group 2 dset dtype, check address */
+ /* Open group 2 dset dtype, check token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10445,37 +10688,40 @@ test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reo
if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open group 1 source dset dtype, get address */
+ /* Open group 1 source dset dtype, get token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open group 1 dset dtype, check address */
+ /* Open group 1 dset dtype, check token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open group 2 source dset dtype, get address and make sure it is
+ /* Open group 2 source dset dtype, get token and make sure it is
* different from group 1 source dset dtype */
if((did = H5Dopen2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr == exp_addr) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open group 2 dset dtype, check address */
+ /* Open group 2 dset dtype, check token */
if((did = H5Dopen2(fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10503,7 +10749,7 @@ error:
} /* end test_copy_committed_datatype_merge_same_file */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_dt_merge_sugg
*
@@ -10531,10 +10777,11 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
unsigned int i; /* Local index variables */
hsize_t dim1d[1]; /* Dataset dimensions */
int buf[DIM_SIZE_1]; /* Buffer for writing data */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): merging committed datatypes with suggestions and reopen")
@@ -10549,8 +10796,8 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -10567,7 +10814,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 */
@@ -10594,7 +10841,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 */
@@ -10603,7 +10850,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 */
@@ -10639,17 +10886,18 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "b", get address */
+ /* Open committed dtype "b", get token */
if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open dset dtype, check address */
+ /* Open dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10677,31 +10925,33 @@ test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "a", get address */
+ /* Open committed dtype "a", get token */
if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open dset 2 dtype, check address */
+ /* Open dset 2 dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open committed dtype "b", get address */
+ /* Open committed dtype "b", get token */
if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open dset dtype, check address */
+ /* Open dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10732,7 +10982,7 @@ error:
return 1;
} /* end test_copy_committed_dt_merge_sugg */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_committed_dt_merge_attr
*
@@ -10762,10 +11012,11 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
unsigned int i; /* Local index variables */
hsize_t dim1d[1]; /* Dataset dimensions */
int buf[DIM_SIZE_1]; /* Buffer for writing data */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): merging committed datatypes with attributes and reopen")
@@ -10780,8 +11031,8 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -10798,7 +11049,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 */
@@ -10828,7 +11079,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 */
@@ -10873,19 +11124,20 @@ test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open attribute dtype, get address */
+ /* Open attribute dtype, get token */
if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_TOP, "attr", H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Aclose(aid) < 0) TEST_ERROR
- /* Open dset dtype, check address */
+ /* Open dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -10925,27 +11177,27 @@ error:
#define ROOT_NDT_INT "root_ndt_int"
#define GROUP_NDT_SHORT "group_ndt_short"
-#define SRC_GRP "src_grp"
-#define DST_GRP "dst_grp"
-#define DST_GRP2 "dst_grp2"
+#define SRC_GRP "src_grp"
+#define DST_GRP "dst_grp"
+#define DST_GRP2 "dst_grp2"
-#define SRC_NDT_SHORT "src_ndt_short"
-#define SRC_NDT_INT "src_ndt_int"
-#define SRC_NDT_INT2 "src_ndt_int2"
-#define SRC_NDT_FLOAT "src_ndt_float"
-#define SRC_NDT_DOUBLE "src_ndt_double"
+#define SRC_NDT_SHORT "src_ndt_short"
+#define SRC_NDT_INT "src_ndt_int"
+#define SRC_NDT_INT2 "src_ndt_int2"
+#define SRC_NDT_FLOAT "src_ndt_float"
+#define SRC_NDT_DOUBLE "src_ndt_double"
-#define DST_NDT_SHORT "dst_ndt_short"
-#define DST_NDT_INT "dst_ndt_int"
-#define DST_NDT_FLOAT "dst_ndt_float"
-#define DST_NDT_DOUBLE "dst_ndt_double"
+#define DST_NDT_SHORT "dst_ndt_short"
+#define DST_NDT_INT "dst_ndt_int"
+#define DST_NDT_FLOAT "dst_ndt_float"
+#define DST_NDT_DOUBLE "dst_ndt_double"
-#define SRC_NDT_DSET "src_ndt_dset"
-#define SRC_NDT_DSET2 "src_ndt_dset2"
-#define SRC_NDT_DSET3 "src_ndt_dset3"
+#define SRC_NDT_DSET "src_ndt_dset"
+#define SRC_NDT_DSET2 "src_ndt_dset2"
+#define SRC_NDT_DSET3 "src_ndt_dset3"
-#define SRC_DSET "src_dset"
-#define SRC_DSET1 "src_dset1"
+#define SRC_DSET "src_dset"
+#define SRC_DSET1 "src_dset1"
#define SRC_ATTR "src_attr"
@@ -10954,21 +11206,21 @@ error:
#define DST_ATTR "dst_attr"
#define DST_ATTR2 "dst_attr2"
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_hier_merge
*
* Purpose: Tests the "merge committed datatypes" feature of H5Ocopy:
- * SRC file:
- * Create committed datatypes at / and /g0
- * Create datasets with native type and committed datatypes at /g0
- * DST file:
- * Create attributes with anonymous committed datatypes at /uncopied
+ * SRC file:
+ * Create committed datatypes at / and /g0
+ * Create datasets with native type and committed datatypes at /g0
+ * DST file:
+ * Create attributes with anonymous committed datatypes at /uncopied
*
- * Copy / at SRC to DST
- * Copy /g0 at SRC to DST
- * Copy the datasets in /g0 at SRC to DST /uncopied
- * Verify that committed datatypes are copied and merged correctly
+ * Copy / at SRC to DST
+ * Copy /g0 at SRC to DST
+ * Copy the datasets in /g0 at SRC to DST /uncopied
+ * Verify that committed datatypes are copied and merged correctly
*
* Return: Success: 0
* Failure: number of errors
@@ -10984,19 +11236,20 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
hid_t tid = -1; /* Datatype ID */
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1; /* Dataset ID */
- hid_t gid = -1; /* Group IDs */
- hid_t f_tid = -1; /* Datatype ID for root group */
- hid_t g_tid = -1; /* Datatype ID for group */
- hid_t anon_tid = -1; /* Anonymous datatype */
- hid_t aid = -1; /* Attribute ID */
+ hid_t gid = -1; /* Group IDs */
+ hid_t f_tid = -1; /* Datatype ID for root group */
+ hid_t g_tid = -1; /* Datatype ID for group */
+ hid_t anon_tid = -1; /* Anonymous datatype */
+ hid_t aid = -1; /* Attribute ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
- int i; /* Local index variable */
- hsize_t dim1d[1]; /* dimension sizes */
- int buf[DIM_SIZE_1]; /* Buffer for data */
- haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */
- H5O_info_t oinfo; /* Object info */
- char src_filename[NAME_BUF_SIZE]; /* Source file name */
- char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ int i; /* Local index variable */
+ hsize_t dim1d[1]; /* dimension sizes */
+ int buf[DIM_SIZE_1]; /* Buffer for data */
+ H5O_token_t exp_token_int, exp_token_short; /* Expected object tokenes */
+ H5O_info2_t oinfo; /* Object info */
+ char src_filename[NAME_BUF_SIZE]; /* Source file name */
+ char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): hier. of committed datatypes and merging with reopen")
@@ -11011,11 +11264,11 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
- /*
- * Populate source file
+ /*
+ * Populate source file
*/
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -11073,8 +11326,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
- /*
- * Populate destination file
+ /*
+ * Populate destination file
*/
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
@@ -11087,7 +11340,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* create attribute of anon ndt (short) in /uncopied */
if((aid = H5Acreate2(gid, DST_ATTR_ANON_SHORT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* close the attribute */
if(H5Aclose(aid) < 0) TEST_ERROR
@@ -11101,7 +11354,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
/* create attribute of anon ndt (int) in /uncopied */
if((aid = H5Acreate2(gid, DST_ATTR_ANON_INT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ TEST_ERROR
/* close the attribute */
if(H5Aclose(aid) < 0) TEST_ERROR
@@ -11133,16 +11386,16 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
*/
if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
- /* get address of committed datatype at root group */
+ /* get token of committed datatype at root group */
if((tid = H5Topen2(fid_dst, SRC_ROOT_GROUP "/" ROOT_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr_int = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token_int, &oinfo.token, sizeof(exp_token_int));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype at /g0 */
+ /* get token of committed datatype at /g0 */
if((tid = H5Topen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" GROUP_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr_short = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token_short, &oinfo.token, sizeof(exp_token_short));
if(H5Tclose(tid) < 0) TEST_ERROR
/* verify the datatype of first dataset is not committed */
@@ -11152,19 +11405,21 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for second dataset */
+ /* check token of datatype for second dataset */
if((did = H5Dopen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_short) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_short, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for third dataset */
+ /* check token of datatype for third dataset */
if((did = H5Dopen2(fid_dst, SRC_ROOT_GROUP NAME_GROUP_TOP "/" SRC_NDT_DSET3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_int) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_int, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -11173,10 +11428,11 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
*/
if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
- /* get address of committed datatype at /g0 */
+ /* get token of committed datatype at /g0 */
if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP "/" GROUP_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_short) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_short, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
/* verify the datatype of first dataset is not committed */
@@ -11186,19 +11442,21 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for second dataset */
+ /* check token of datatype for second dataset */
if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_short) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_short, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for third dataset */
+ /* check token of datatype for third dataset */
if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" SRC_NDT_DSET3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_int) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_int, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -11209,19 +11467,21 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
if(H5Ocopy(fid_src, NAME_GROUP_TOP "/" SRC_NDT_DSET2, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Ocopy(fid_src, NAME_GROUP_TOP "/" SRC_NDT_DSET3, fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET3, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
- /* Open attribute with anon ndt (short), get address */
+ /* Open attribute with anon ndt (short), get token */
if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_UNCOPIED, DST_ATTR_ANON_SHORT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_short) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_short, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Aclose(aid) < 0) TEST_ERROR
- /* Open attribute with anon ndt (int), get address */
+ /* Open attribute with anon ndt (int), get token */
if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_UNCOPIED, DST_ATTR_ANON_INT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_int) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_int, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Aclose(aid) < 0) TEST_ERROR
@@ -11232,19 +11492,21 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for second dataset */
+ /* check token of datatype for second dataset */
if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_short) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_short, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for third dataset */
+ /* check token of datatype for third dataset */
if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr_int) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token_int, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -11262,17 +11524,17 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d
error:
H5E_BEGIN_TRY {
- H5Tclose(tid);
- H5Tclose(f_tid);
- H5Tclose(g_tid);
- H5Tclose(anon_tid);
- H5Pclose(ocpypl_id);
- H5Aclose(aid);
- H5Dclose(did);
- H5Sclose(sid);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Tclose(tid);
+ H5Tclose(f_tid);
+ H5Tclose(g_tid);
+ H5Tclose(anon_tid);
+ H5Pclose(ocpypl_id);
+ H5Aclose(aid);
+ H5Dclose(did);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_cdt_hier_merge */
@@ -11282,22 +11544,22 @@ error:
* Function: test_copy_cdt_merge_cdt
*
* Purpose: Tests the "merge committed datatypes" feature of H5Ocopy:
- * SRC file:
- * Create committed datatype (short)
- * Create committed datatype (float)
- * Create committed datatype (int), with attribute of ndt int
- * Create committed datatype (double), with attribute of anon ndt short
- * DST file:
- * Create committed datatype (int)
- * Create committed datatype (float), with attribute of native int
- * Create committed datatype (double), with attribute of anon ndt short
- *
- * Copy / at SRC to DST
- * Verify that committed datatypes are copied and merged correctly
- *
- * NOTE:
- * Comparison of attributes are not implemented yet.
- * Further tests will be added in the future.
+ * SRC file:
+ * Create committed datatype (short)
+ * Create committed datatype (float)
+ * Create committed datatype (int), with attribute of ndt int
+ * Create committed datatype (double), with attribute of anon ndt short
+ * DST file:
+ * Create committed datatype (int)
+ * Create committed datatype (float), with attribute of native int
+ * Create committed datatype (double), with attribute of anon ndt short
+ *
+ * Copy / at SRC to DST
+ * Verify that committed datatypes are copied and merged correctly
+ *
+ * NOTE:
+ * Comparison of attributes are not implemented yet.
+ * Further tests will be added in the future.
*
* Return: Success: 0
* Failure: number of errors
@@ -11312,15 +11574,16 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
hid_t tid3 = -1, tid4 = -1; /* Datatype IDs */
- hid_t tid5 = -1, tid = -1; /* Datatype IDs */
+ hid_t tid5 = -1, tid = -1; /* Datatype IDs */
hid_t sid = -1; /* Dataspace ID */
- hid_t aid = -1; /* Attribute ID */
+ hid_t aid = -1; /* Attribute ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
- hsize_t dim1d[1]; /* dimension sizes */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object addresses */
- char src_filename[NAME_BUF_SIZE]; /* Source file name */
- char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ hsize_t dim1d[1]; /* dimension sizes */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
+ char src_filename[NAME_BUF_SIZE]; /* Source file name */
+ char dst_filename[NAME_BUF_SIZE]; /* Destination file name */
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): merging various committed datatypes with reopen")
@@ -11331,11 +11594,11 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
- /*
- * Populate source file
+ /*
+ * Populate source file
*/
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -11385,8 +11648,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
/* close the SRC file */
if(H5Fclose(fid_src) < 0) TEST_ERROR
- /*
- * Populate destination file
+ /*
+ * Populate destination file
*/
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
@@ -11441,56 +11704,60 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
/* copy everything in SRC to DST */
if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
- /*
- * Verification
+ /*
+ * Verification
*/
- /* get address of committed datatype: /src_root/src_ndt_double */
+ /* get token of committed datatype: /src_root/src_ndt_double */
if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype: /dst_ndt_double */
+ /* get token of committed datatype: /dst_ndt_double */
if((tid = H5Topen2(fid_dst, "/" DST_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype: /src_root/src_ndt_float */
+ /* get token of committed datatype: /src_root/src_ndt_float */
if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_FLOAT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype: /dst_ndt_float */
+ /* get token of committed datatype: /dst_ndt_float */
if((tid = H5Topen2(fid_dst, "/" DST_NDT_FLOAT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype: /src_root/src_ndt_int */
+ /* get token of committed datatype: /src_root/src_ndt_int */
if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype: /dst_ndt_int */
+ /* get token of committed datatype: /dst_ndt_int */
if((tid = H5Topen2(fid_dst, "/" DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
- /* get address of committed datatype: /src_root/src_ndt_short */
+ /* get token of committed datatype: /src_root/src_ndt_short */
if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* open attribute; get its dtype; get dtype's address: /src_root/src_ndt_double/dst_attr */
+ /* open attribute; get its dtype; get dtype's token: /src_root/src_ndt_double/dst_attr */
if((aid = H5Aopen_by_name(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, DST_ATTR, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Aclose(aid) < 0) TEST_ERROR
@@ -11506,29 +11773,29 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds
error:
H5E_BEGIN_TRY {
- H5Pclose(ocpypl_id);
- H5Tclose(tid);
- H5Tclose(tid1);
- H5Tclose(tid2);
- H5Tclose(tid3);
- H5Tclose(tid4);
- H5Tclose(tid5);
- H5Aclose(aid);
- H5Sclose(sid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Pclose(ocpypl_id);
+ H5Tclose(tid);
+ H5Tclose(tid1);
+ H5Tclose(tid2);
+ H5Tclose(tid3);
+ H5Tclose(tid4);
+ H5Tclose(tid5);
+ H5Aclose(aid);
+ H5Sclose(sid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_cdt_merge_cdt */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_merge_suggs
*
* Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path)
- * is correctly applied in merging the committed datatypes.
- *
+ * is correctly applied in merging the committed datatypes.
+ *
* Return: Success: 0
* Failure: number of errors
*
@@ -11543,10 +11810,11 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
hid_t fid_src = -1, fid_dst = -1; /* File IDs */
hid_t tid = -1; /* Datatype ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): merging committed datatypes with suggestions and reopen")
@@ -11557,8 +11825,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/*
* Populate source file
@@ -11597,7 +11865,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Fclose(fid_dst) < 0) TEST_ERROR
/*
- * Test 1
+ * Test 1
*/
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
@@ -11618,23 +11886,24 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* open committed dtype "/dst_ndt_int", get its address */
+ /* open committed dtype "/dst_ndt_int", get its token */
if((tid = H5Topen2(fid_dst, DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* check address of "/uncopied/src_ndt_int" */
+ /* check token of "/uncopied/src_ndt_int" */
if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 2
+ /*
+ * Test 2
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11651,29 +11920,30 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* open committed dtype "/uncopied/src_ndt_int", get its address */
+ /* open committed dtype "/uncopied/src_ndt_int", get its token */
if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* check address of "/src_ndt_int" */
+ /* check token of "/src_ndt_int" */
if((tid = H5Topen2(fid_dst, SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 3
+ /*
+ * Test 3
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
/* remove "/uncopied/src_ndt_int" from DST file */
- if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR
/* copy "/src_ndt_int" from SRC file to "/uncopied/src_ndt_int" at DST file */
/* use default ocpypl_id -- without merging and suggestion */
@@ -11682,30 +11952,31 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* copy "/src_ndt_int" from SRC file to "/src_ndt_int2" at DST file */
/* copy with merging and search suggestion: "/uncopied/src_ndt_int" */
if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
-
+
if(reopen) {
/* Reopen file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "/uncopied/src_ndt_int", get its address */
+ /* Open committed dtype "/uncopied/src_ndt_int", get its token */
if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* check address of "/src_ndt_int2" */
+ /* check token of "/src_ndt_int2" */
if((tid = H5Topen2(fid_dst, SRC_NDT_INT2, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 4
+ /*
+ * Test 4
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11723,16 +11994,17 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "/dst_dt_int", get its address */
+ /* Open committed dtype "/dst_dt_int", get its token */
if((tid = H5Topen2(fid_dst, DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* check address of "/uncopied/src_ndt_int2" */
+ /* check token of "/uncopied/src_ndt_int2" */
if((tid = H5Topen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT2, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
/* close the DST file */
@@ -11757,13 +12029,13 @@ error:
return 1;
} /* end test_copy_cdt_merge_suggs */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_merge_dset_suggs
*
* Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path)
- * is correctly applied in merging the committed datatypes of datasets.
- *
+ * is correctly applied in merging the committed datatypes of datasets.
+ *
* Return: Success: 0
* Failure: number of errors
*
@@ -11783,10 +12055,11 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
unsigned int i; /* Local index variables */
hsize_t dim1d[1]; /* Dataset dimensions */
int buf[DIM_SIZE_1]; /* Buffer for writing data */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): merging committed datatypes of datasets with suggestions and reopen")
@@ -11801,8 +12074,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/*
* Populate source file
@@ -11858,7 +12131,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Sclose(sid) < 0) TEST_ERROR
/*
- * Test 1
+ * Test 1
*/
/* open the source file with read-only */
if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
@@ -11879,25 +12152,26 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "/dst_ndt_int", get its address */
+ /* Open committed dtype "/dst_ndt_int", get its token */
if((tid = H5Topen2(fid_dst, DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* check address of datatype for the copied dataset: "/uncopied/src_ndt_dset" */
+ /* check token of datatype for the copied dataset: "/uncopied/src_ndt_dset" */
if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 2
+ /*
+ * Test 2
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11914,33 +12188,34 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype dataset "/uncopied/src_ndt_dset", get its datatype address */
+ /* Open committed dtype dataset "/uncopied/src_ndt_dset", get its datatype token */
if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for the copied dataset: "/src_ndt_dset" */
+ /* check token of datatype for the copied dataset: "/src_ndt_dset" */
if((did = H5Dopen2(fid_dst, SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 3
+ /*
+ * Test 3
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
/* remove "/uncopied/src_ndt_dset" */
- if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR
/* copy "src_ndt_dset" from SRC file to "/uncopied/src_ndt_dset" at DST file */
/* use default ocpypl_id -- without merging and suggestion */
@@ -11949,34 +12224,35 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* copy "src_ndt_dset" from SRC file to "/src_ndt_dset2" at DST file */
/* use merging and suggested searching path: "/uncopied/src_ndt_dset" */
if(H5Ocopy(fid_src, SRC_NDT_DSET, fid_dst, SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR
-
+
if(reopen) {
/* Reopen file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* open the copied dataset: /uncopied/src_ndt_dset", get its address */
+ /* open the copied dataset: /uncopied/src_ndt_dset", get its token */
if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for the copied dataset: "/src_ndt_dset2" */
+ /* check token of datatype for the copied dataset: "/src_ndt_dset2" */
if((did = H5Dopen2(fid_dst, SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
- * Test 4
+ /*
+ * Test 4
*/
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -11994,19 +12270,20 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* open the copied dataset: "/src_ndt_dset", get its datatype address */
+ /* open the copied dataset: "/src_ndt_dset", get its datatype token */
if((did = H5Dopen2(fid_dst, SRC_NDT_DSET, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* check address of datatype for the copied dataset: /uncopied/src_ndt_dset2 */
+ /* check token of datatype for the copied dataset: /uncopied/src_ndt_dset2 */
if((did = H5Dopen2(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -12034,12 +12311,12 @@ error:
return 1;
} /* end test_copy_cdt_merge_dset_suggs */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_cdt_merge_all_suggs
*
* Purpose: Tests the merging committed datatype + search suggestion feature.
- *
+ *
* Return: Success: 0
* Failure: number of errors
*
@@ -12058,8 +12335,8 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
hid_t aid = -1; /* Attribute ID */
hid_t did = -1; /* Dataset ID */
hid_t exp_did = -1; /* Dataset ID */
- hid_t tid_short = -1; /* Datatype ID */
- hid_t exp_tid = -1; /* Expected datatype ID */
+ hid_t tid_short = -1; /* Datatype ID */
+ hid_t exp_tid = -1; /* Expected datatype ID */
hid_t ocpypl_id = -1; /* Object copy plist ID */
hsize_t dim1d[1]; /* Dataset dimensions */
char src_filename[NAME_BUF_SIZE];
@@ -12074,8 +12351,8 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/*
* Populate source file
@@ -12115,7 +12392,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* create third dataset in group */
if((did = H5Dcreate2(gid, SRC_DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
+
/* get datatype */
if((tid_short = H5Topen2(fid_src, "/" SRC_GRP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -12244,7 +12521,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 1
*/
/* open the source file with read-only */
@@ -12285,7 +12562,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 2
*/
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12322,7 +12599,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 3
*/
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12339,7 +12616,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* open committed dtype "/dst_grp/dst_dt_int", get its address */
+ /* open committed dtype "/dst_grp/dst_dt_int", get its token */
if((exp_tid = H5Topen2(fid_dst, "/" DST_GRP "/" DST_NDT_INT, H5P_DEFAULT)) < 0) TEST_ERROR
/* open datatype of dataset */
@@ -12357,7 +12634,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 4
*/
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12410,7 +12687,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 5
*/
/* open destination file */
@@ -12432,7 +12709,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((aid = H5Aopen_by_name(fid_dst, DST_NDT_DOUBLE, DST_ATTR, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if((exp_tid = H5Aget_type(aid)) < 0) TEST_ERROR
- /* Open datatype of dataset, check address */
+ /* Open datatype of dataset, check token */
if((did = H5Dopen2(fid_dst, "A_src_dset", H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
@@ -12448,7 +12725,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* close the DST file */
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Test 6
*/
/* open destination file */
@@ -12469,7 +12746,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* open committed dtype "/dst_ndt_short" */
if((exp_tid = H5Topen2(fid_dst, "/" DST_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR
- /* open datatype of dataset, check address */
+ /* open datatype of dataset, check token */
if((did = H5Dopen2(fid_dst, "B_src_dset", H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
@@ -12509,7 +12786,7 @@ error:
return 1;
} /* end test_copy_cdt_merge_all_suggs */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_set_mcdt_search_cb
*
@@ -12551,11 +12828,12 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
unsigned int i; /* Local index variables */
hsize_t dim1d[1]; /* Dataset dimensions */
int buf[DIM_SIZE_1]; /* Buffer for writing data */
- H5O_info_t oinfo; /* Object info */
- haddr_t exp_addr; /* Expected object address */
+ H5O_info2_t oinfo; /* Object info */
+ H5O_token_t exp_token; /* Expected object token */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
mcdt_search_cb_ud cb_udata; /* User data for callback */
+ int token_cmp;
if(reopen)
TESTING("H5Ocopy(): H5Pset_mcdt_search_cb and reopen")
@@ -12570,8 +12848,8 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -12588,7 +12866,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 */
@@ -12618,7 +12896,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 */
@@ -12627,7 +12905,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 */
@@ -12663,17 +12941,18 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "b", get address */
+ /* Open committed dtype "b", get token */
if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open dset dtype, check address */
+ /* Open dset dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -12694,7 +12973,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Continue the global search */
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &cb_udata) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -12711,17 +12990,18 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "a", get address */
+ /* Open committed dtype "a", get token */
if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open copied dataset and its dtype, check address */
+ /* Open copied dataset and its dtype, check token */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr != exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -12729,7 +13009,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Fclose(fid_dst) < 0) TEST_ERROR
- /*
+ /*
* Stop the search, default action is to create an anonymous committed datatype
*/
cb_udata.search_action = H5O_MCDT_SEARCH_STOP;
@@ -12750,31 +13030,33 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "a", get address */
+ /* Open committed dtype "a", get token */
if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open the copied dataset and get its dtype, addresses should not be equal */
+ /* Open the copied dataset and get its dtype, tokens should not be equal */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr == exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open committed dtype "b", get address */
+ /* Open committed dtype "b", get token */
if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open the copied dataset and get its dtype, addresses should not be equal */
+ /* Open the copied dataset and get its dtype, tokens should not be equal */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr == exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -12810,31 +13092,33 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR
} /* end if */
- /* Open committed dtype "a", get address */
+ /* Open committed dtype "a", get token */
if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open the copied dataset and get its dtype, addresses should not be equal */
+ /* Open the copied dataset and get its dtype, tokens should not be equal */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr == exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
- /* Open committed dtype "b", get address */
+ /* Open committed dtype "b", get token */
if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- exp_addr = oinfo.addr;
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ HDmemcpy(&exp_token, &oinfo.token, sizeof(exp_token));
if(H5Tclose(tid) < 0) TEST_ERROR
- /* Open the copied dataset and get its dtype, addresses should not be equal */
+ /* Open the copied dataset and get its dtype, tokens should not be equal */
if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR
if((tid = H5Dget_type(did)) < 0) TEST_ERROR
- if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR
- if(oinfo.addr == exp_addr) TEST_ERROR
+ if(H5Oget_info3(tid, &oinfo, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(tid, &oinfo.token, &exp_token, &token_cmp) < 0) TEST_ERROR
+ if(!token_cmp) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -12865,7 +13149,7 @@ error:
return 1;
} /* end test_copy_set_mcdt_search_cb */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_set_get_mcdt_cb
*
@@ -12911,10 +13195,10 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
int buf[DIM_SIZE_1]; /* Buffer for writing data */
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
- H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */
- H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */
- H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */
- H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */
+ H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */
+ H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */
+ H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */
+ H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */
if(reopen)
TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb and reopen")
@@ -12929,8 +13213,8 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -12947,7 +13231,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 */
@@ -12977,7 +13261,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 */
@@ -12986,7 +13270,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 */
@@ -13044,7 +13328,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
/* Continue the global search */
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataA) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open the destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -13077,7 +13361,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
mcdt_udataB = H5O_MCDT_SEARCH_STOP;
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataB) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -13107,7 +13391,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl,
if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR
if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbB, &mcdt_udataB) < 0)
- TEST_ERROR
+ TEST_ERROR
/* open destination file */
if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR
@@ -13160,7 +13444,7 @@ error:
return 1;
} /* end test_copy_set_get_mcdt_search_cb */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_iterate
*
@@ -13177,7 +13461,7 @@ error:
*/
static herr_t
test_copy_iterate_cb(hid_t loc_id, const char *name,
- const H5L_info_t H5_ATTR_UNUSED *link_info, void *op_data)
+ const H5L_info2_t H5_ATTR_UNUSED *link_info, void *op_data)
{
hid_t dst_loc_id = *((hid_t *)op_data);
@@ -13196,7 +13480,7 @@ test_copy_iterate(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl
hid_t fid1 = -1, fid2 = -1; /* File IDs */
hid_t gid = -1; /* Group ID */
int i;
- char grp_name[8];
+ char grp_name[16];
char src_filename[NAME_BUF_SIZE];
char dst_filename[NAME_BUF_SIZE];
@@ -13206,8 +13490,8 @@ test_copy_iterate(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], src_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* Create source file */
if((fid1 = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0)
@@ -13237,8 +13521,7 @@ test_copy_iterate(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl
/* Iterate over links in the root group, copying each object */
if((gid = H5Gopen2(fid1, "/", H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Literate(gid, H5_INDEX_NAME, H5_ITER_INC, NULL, test_copy_iterate_cb,
- &fid2) < 0)
+ if(H5Literate2(gid, H5_INDEX_NAME, H5_ITER_INC, NULL, test_copy_iterate_cb, &fid2) < 0)
TEST_ERROR
/* Close */
@@ -13258,7 +13541,7 @@ error:
return 1;
} /* end test_copy_iterate */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_option
*
@@ -13270,8 +13553,6 @@ error:
* Programmer: Peter Cao
* March 11, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -13283,7 +13564,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
hid_t did = -1; /* Dataset ID */
hid_t gid=-1, gid2=-1, gid_ref=-1; /* Group IDs */
hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */
- hid_t pid=-1, lcpl_id=-1; /* Property IDs */
+ hid_t pid=-1, lcpl_id=-1; /* Property IDs */
unsigned cpy_flags; /* Object copy flags */
int depth = -1; /* Copy depth */
hsize_t dim2d[2];
@@ -13303,8 +13584,8 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -13438,7 +13719,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination
+ /* Create an uncopied object in destination file so that tokens in source and destination
files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13536,51 +13817,51 @@ error:
H5E_BEGIN_TRY {
H5Pclose(lcpl_id);
H5Pclose(pid);
- H5Sclose(sid);
- H5Dclose(did);
- H5Gclose(gid_ref);
- H5Gclose(gid_sub);
- H5Gclose(gid2);
- H5Gclose(gid);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
- H5Fclose(fid_ext);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_ref);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ H5Fclose(fid_ext);
} H5E_END_TRY;
return 1;
} /* end test_copy_option */
-
+
/*-------------------------------------------------------------------------
* Function: test_copy_dataset_open
*
* Purpose: To ensure that H5Ocopy() copies data of opened dataset correctly.
- * This is for bug fix HDFFV-7853.
- *
- * Test Case 1:
- * Create a dataset with attributes in SRC file
- * Copy the opened dataset to another location in the same file
- * Copy the opened dataset to DST file
- * Close the dataset
- *
- * Test Case 2:
- * Reopen the dataset, write new data to the dataset
- * Copy the opened dataset to another location in the same file
- * Copy the opened dataset to to DST file
- * Close the dataset
- *
- * Test Case 3:
- * Create a committed datatype
- * Create a dataset with the committed datatype in SRC file
- * Open the committed datatype
- * Copy the opened dataset (with the opened committed datatype) to another location in the same file
- * Copy the opened dataset (with the opened committed datatype) to DST file
- * Close the dataset and the committed datatype
- *
- * Test Case 4:
- * Create a group with attributes, create a dataset in the group
- * Copy the opened group (together with the opened dataset) to another location in the same file
- * Copy the opened group (together with the opened dataset) to DST file
- * Close the group and the dataset
+ * This is for bug fix HDFFV-7853.
+ *
+ * Test Case 1:
+ * Create a dataset with attributes in SRC file
+ * Copy the opened dataset to another location in the same file
+ * Copy the opened dataset to DST file
+ * Close the dataset
+ *
+ * Test Case 2:
+ * Reopen the dataset, write new data to the dataset
+ * Copy the opened dataset to another location in the same file
+ * Copy the opened dataset to to DST file
+ * Close the dataset
+ *
+ * Test Case 3:
+ * Create a committed datatype
+ * Create a dataset with the committed datatype in SRC file
+ * Open the committed datatype
+ * Copy the opened dataset (with the opened committed datatype) to another location in the same file
+ * Copy the opened dataset (with the opened committed datatype) to DST file
+ * Close the dataset and the committed datatype
+ *
+ * Test Case 4:
+ * Create a group with attributes, create a dataset in the group
+ * Copy the opened group (together with the opened dataset) to another location in the same file
+ * Copy the opened group (together with the opened dataset) to DST file
+ * Close the group and the dataset
*
* Return: Success: 0
* Failure: number of errors
@@ -13588,8 +13869,6 @@ error:
* Programmer: Vailin Choi
* Feb 7, 2012
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -13626,8 +13905,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* create source file */
if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
@@ -13635,7 +13914,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* create destination file */
if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
- /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */
+ /* Create an uncopied object in destination file so that tokens in source and destination files aren't the same */
if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Set dataspace dimensions */
@@ -13658,16 +13937,16 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* write data to the dataset */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
-
+
/* attach attributes to the dataset */
if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR
if(test_copy_attach_attributes(did2, H5T_NATIVE_INT) < 0) TEST_ERROR
- /*
- * Test case 1
+ /*
+ * Test case 1
*/
- /*
+ /*
* Copy within the same file
*/
/* copy the opened dataset to another location in SRC file */
@@ -13686,7 +13965,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dclose(did3) < 0) TEST_ERROR
if(H5Dclose(did4) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened dataset from SRC to DST */
@@ -13709,8 +13988,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Dclose(did2) < 0) TEST_ERROR
- /*
- * Test case 2
+ /*
+ * Test case 2
*/
/* reopen the dataset in SRC file */
if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13720,7 +13999,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR
- /*
+ /*
* Copy within the same file
*/
/* copy the opened dataset to another location in SRC file */
@@ -13738,7 +14017,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the copied dataset in SRC file */
if(H5Dclose(did3) < 0) TEST_ERROR
if(H5Dclose(did4) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened dataset from SRC to DST */
@@ -13761,8 +14040,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Dclose(did2) < 0) TEST_ERROR
- /*
- * Test case 3
+ /*
+ * Test case 3
*/
/* make a copy of the datatype */
@@ -13783,7 +14062,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* write data to the dataset */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
- /*
+ /*
* Copy within the same file
*/
/* copy the opened dataset (with the opened committed datatype) to another location in SRC file */
@@ -13798,7 +14077,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the copied dataset in SRC file */
if(H5Dclose(did2) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened dataset (with the opened committed datatype) from SRC to DST */
@@ -13819,8 +14098,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the committed datatype at SRC file */
if(H5Tclose(tid) < 0) TEST_ERROR
- /*
- * Test case 4
+ /*
+ * Test case 4
*/
/* create a group in SRC file */
if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
@@ -13833,7 +14112,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* write data to the dataset */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
- /*
+ /*
* Copy within the same file
*/
/* copy the opened group (together with opened dataset) to another location in SRC file */
@@ -13848,7 +14127,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
/* close the DST dataset */
if(H5Gclose(gid2) < 0) TEST_ERROR
- /*
+ /*
* Copy to another file
*/
/* copy the opened group (together with opened dataset) to DST file */
@@ -13883,20 +14162,20 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Dclose(did2);
- H5Sclose(sid);
- H5Gclose(gid);
- H5Gclose(gid2);
- H5Fclose(fid_dst);
- H5Fclose(fid_src);
+ H5Dclose(did);
+ H5Dclose(did2);
+ H5Sclose(sid);
+ H5Gclose(gid);
+ H5Gclose(gid2);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
} H5E_END_TRY;
return 1;
} /* end test_copy_dataset_open */
-
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose: Test H5Ocopy()
*
@@ -13904,24 +14183,22 @@ 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
main(void)
{
int nerrors = 0;
- hid_t fapl, fapl2;
+ hid_t fapl, fapl2;
hid_t fcpl_shared, ocpl;
unsigned max_compact, min_dense;
int configuration; /* Configuration of tests. */
- int ExpressMode;
+ int ExpressMode;
hbool_t same_file; /* Whether to run tests that only use one file */
/* Setup */
@@ -13930,7 +14207,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
@@ -13966,57 +14243,58 @@ 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 */
/* The tests... */
nerrors += test_copy_dataset_simple(fcpl_src, fcpl_dst, src_fapl, dst_fapl);
+ nerrors += test_copy_dataset_versionbounds(fcpl_src, src_fapl);
nerrors += test_copy_dataset_simple_samefile(fcpl_src, src_fapl);
/* Test with dataset opened in the file or not */
@@ -14073,10 +14351,10 @@ main(void)
FALSE, "H5Ocopy(): expand soft link");
nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl,
H5O_COPY_EXPAND_EXT_LINK_FLAG,
- FALSE, "H5Ocopy: expand external link");
+ FALSE, "H5Ocopy(): expand external link");
nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl,
H5O_COPY_EXPAND_SOFT_LINK_FLAG | H5O_COPY_EXPAND_EXT_LINK_FLAG,
- FALSE, "H5Ocopy: expand soft and external links");
+ FALSE, "H5Ocopy(): expand soft and external links");
nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl,
H5O_COPY_SHALLOW_HIERARCHY_FLAG,
FALSE, "H5Ocopy(): shallow group copy");
@@ -14173,20 +14451,20 @@ main(void)
*/
} /* end for */
- /* Reset file address checking info */
- addr_reset();
+ /* Reset file token checking info */
+ token_reset();
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
/* 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
@@ -14213,9 +14491,9 @@ main(void)
h5_cleanup(FILENAME, fapl);
- return 0;
+ HDexit(EXIT_SUCCESS);
error:
- return 1;
+ HDexit(EXIT_FAILURE);
} /* main */
diff --git a/test/objcopy_ref.c b/test/objcopy_ref.c
new file mode 100644
index 0000000..20c6138
--- /dev/null
+++ b/test/objcopy_ref.c
@@ -0,0 +1,1698 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Peter X. Cao
+ * May 01, 2005
+ *
+ * Purpose: Test H5Ocopy() for references.
+ */
+
+#include "testhdf5.h"
+
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_TESTING
+#include "H5Fpkg.h" /* File access */
+
+const char *FILENAME[] = {
+ "objcopy_ref_src",
+ "objcopy_ref_dst",
+ "objcopy_ref_ext",
+ "objcopy_ref_src2",
+ "verbound_ref_src",
+ "verbound_ref_dst",
+ NULL
+};
+
+/* Configuration, really a series of bit flags. Maximum value is all three
+ * bit flags enabled.
+ */
+#define CONFIG_SHARE_SRC 1
+#define CONFIG_SHARE_DST 2
+#define CONFIG_SRC_NEW_FORMAT 4
+#define CONFIG_DST_NEW_FORMAT 8
+#define CONFIG_DENSE 16
+#define MAX_CONFIGURATION 31
+
+#define NAME_DATASET_SIMPLE "dataset_simple"
+#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple"
+#define NAME_GROUP_UNCOPIED "/uncopied"
+#define NAME_GROUP_TOP "/g0"
+#define NAME_GROUP_SUB "/g0/g00"
+#define NAME_GROUP_SUB_SUB2 "g000"
+#define NAME_GROUP_LINK "/g_links"
+#define NAME_GROUP_LINK2 "/g_links2"
+#define NAME_GROUP_REF "ref_grp"
+#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple"
+#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple"
+#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple"
+#define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple"
+#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere"
+#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere"
+#define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere"
+#define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere"
+
+#define NAME_BUF_SIZE 1024
+#define ATTR_NAME_LEN 80
+#define DIM_SIZE_1 12
+#define DIM_SIZE_2 6
+
+unsigned num_attributes_g; /* Number of attributes created */
+
+/* Table containing object id and object name */
+/* (Used for detecting duplicate objects when comparing groups */
+static struct {
+ size_t nalloc; /* number of slots allocated */
+ size_t nobjs; /* number of objects */
+ H5O_token_t *obj; /* tokens for objects seen */
+} idtab_g;
+
+/* Local function prototypes */
+static int
+compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
+ const void *buf1, const void *buf2, hid_t obj_owner);
+static int
+compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf);
+static int
+compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags);
+
+/*-------------------------------------------------------------------------
+ * Function: token_insert
+ *
+ * Purpose: Add a token to the table.
+ *
+ * Return: void
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, November 5, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+token_insert(H5O_info2_t *oinfo)
+{
+ size_t n;
+
+ /* Don't add it if the link count is 1 because such an object can only
+ * be encountered once. */
+ if(oinfo->rc < 2)
+ return;
+
+ /* Extend the table */
+ if(idtab_g.nobjs >= idtab_g.nalloc) {
+ idtab_g.nalloc = MAX(256, 2 * idtab_g.nalloc);
+ idtab_g.obj = (H5O_token_t *)HDrealloc(idtab_g.obj, idtab_g.nalloc * sizeof(idtab_g.obj[0]));
+ }
+
+ /* Insert the entry */
+ n = idtab_g.nobjs++;
+ idtab_g.obj[n] = oinfo->token;
+} /* end token_insert() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: token_lookup
+ *
+ * Purpose: Check if a token has already been encountered
+ *
+ * Return: Success: TRUE/FALSE
+ * Failure: (can't fail)
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, November 5, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static H5_ATTR_PURE hbool_t
+token_lookup(hid_t loc_id, H5O_info2_t *oinfo)
+{
+ size_t n;
+ int token_cmp;
+
+ if(oinfo->rc < 2)
+ return FALSE; /*only one link possible*/
+
+ for(n = 0; n < idtab_g.nobjs; n++) {
+ if(H5Otoken_cmp(loc_id, &(idtab_g.obj[n]), &oinfo->token, &token_cmp) < 0)
+ return FALSE;
+ if(0 == token_cmp)
+ return TRUE;
+ }
+
+ return FALSE;
+} /* end token_lookup() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: token_reset
+ *
+ * Purpose: Reset the token tracking data structures
+ *
+ * Return: void
+ *
+ * Programmer: Quincey Koziol
+ * Saturday, November 5, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+token_reset(void)
+{
+ if(idtab_g.obj)
+ HDfree(idtab_g.obj);
+ idtab_g.obj = NULL;
+ idtab_g.nalloc = idtab_g.nobjs = 0;
+} /* end token_reset() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: attach_ref_attr
+ *
+ * Purpose: Create an attribute with object references
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+attach_ref_attr(hid_t file_id, hid_t loc_id)
+{
+ char dsetname1[] = "dataset1_pointed_by_ref_attr";
+ char dsetname2[] = "dataset2_pointed_by_ref_attr";
+ hid_t did1 = (-1), did2 = (-1), aid = (-1), sid = (-1), sid_ref = (-1);
+ hsize_t dims[2] = {2,9};
+ hsize_t dims_ref[1] = {2};
+ H5R_ref_t ref[2];
+ int data1[2][9] = {{1,1,1,1,1,1,1,1,1},{1,1,1,1,1,1,1,1,18}};
+ int data2[2][9] = {{2,2,2,2,2,2,2,2,2},{2,2,2,2,2,2,2,2,18}};
+
+ /* creates two simple datasets */
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
+ if((sid_ref = H5Screate_simple(1, dims_ref, NULL)) < 0) TEST_ERROR
+ if((did1 = H5Dcreate2(file_id, dsetname1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data1) < 0) TEST_ERROR
+ if((did2 = H5Dcreate2(file_id, dsetname2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data2) < 0) TEST_ERROR
+
+ /* create an attribute with two object references */
+ if(H5Rcreate_object(file_id, dsetname1, H5P_DEFAULT, &ref[0]) < 0) TEST_ERROR
+ if(H5Rcreate_object(file_id, dsetname2, H5P_DEFAULT, &ref[1]) < 0) TEST_ERROR
+ if((aid = H5Acreate2(loc_id, "obj_ref_attr", H5T_STD_REF, sid_ref, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Awrite(aid, H5T_STD_REF, ref) < 0) TEST_ERROR
+
+ if(H5Sclose(sid) < 0) TEST_ERROR
+ if(H5Sclose(sid_ref) < 0) TEST_ERROR
+ if(H5Dclose(did1) < 0) TEST_ERROR
+ if(H5Dclose(did2) < 0) TEST_ERROR
+ if(H5Aclose(aid) < 0) TEST_ERROR
+ if(H5Rdestroy(&ref[0]) < 0) TEST_ERROR
+ if(H5Rdestroy(&ref[1]) < 0) TEST_ERROR
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Sclose(sid);
+ H5Sclose(sid_ref);
+ H5Dclose(did1);
+ H5Dclose(did2);
+ H5Aclose(aid);
+ H5Rdestroy(&ref[0]);
+ H5Rdestroy(&ref[1]);
+ } H5E_END_TRY;
+
+ return(-1);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: attach_reg_ref_attr
+ *
+ * Purpose: Create an attribute with object references
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Peter Cao
+ * Monday, March 5, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+attach_reg_ref_attr(hid_t file_id, hid_t loc_id)
+{
+ const char dsetnamev[] = "dataset_pointed_by_reg_ref_attr";
+ hid_t aid = (-1);
+ hid_t space_id = (-1); /* dataspace identifiers */
+ hid_t spacer_id = (-1); /* dataspace identifiers */
+ hid_t dsetv_id = (-1); /*dataset identifiers*/
+ hsize_t dims[2] = {2,9};
+ hsize_t dimsr[1] = {2};
+ int rank = 2;
+ int rankr =1;
+ H5R_ref_t ref[2];
+ int data[2][9] = {{1,1,2,3,3,4,5,5,999},{1,2,2,3,4,4,5,6,999}};
+ hsize_t start[2] = {0, 3};
+ hsize_t count[2] = {2, 3};
+ hsize_t coord[3][2] = {{0, 0}, {1, 6}, {0, 8}};
+ size_t num_points = 3;
+
+ /* create a 2D dataset */
+ if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR
+ if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0) TEST_ERROR
+ if((dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data) < 0) TEST_ERROR
+
+ /* create reg_ref of block selection */
+ if(H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL) < 0) TEST_ERROR
+ if(H5Rcreate_region(file_id, dsetnamev, space_id, H5P_DEFAULT, &ref[0]) < 0) TEST_ERROR
+
+ /* create reg_ref of point selection */
+ if(H5Sselect_none(space_id) < 0) TEST_ERROR
+ if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0) TEST_ERROR
+ if(H5Rcreate_region(file_id, dsetnamev, space_id, H5P_DEFAULT, &ref[1]) < 0) TEST_ERROR
+
+ /* create reg_ref attribute */
+ if((aid = H5Acreate2(loc_id, "reg_ref_attr", H5T_STD_REF, spacer_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Awrite(aid, H5T_STD_REF, ref) < 0) TEST_ERROR
+
+ /* attach the reg_ref attribute to the dataset itself */
+ if(H5Aclose(aid) < 0) TEST_ERROR
+ if((aid = H5Acreate2(dsetv_id, "reg_ref_attr", H5T_STD_REF, spacer_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Awrite(aid, H5T_STD_REF, ref) < 0) TEST_ERROR
+
+ if(H5Sclose(spacer_id) < 0) TEST_ERROR
+ if(H5Sclose(space_id) < 0) TEST_ERROR
+ if(H5Dclose(dsetv_id) < 0) TEST_ERROR
+ if(H5Aclose(aid) < 0) TEST_ERROR
+ if(H5Rdestroy(&ref[0]) < 0) TEST_ERROR
+ if(H5Rdestroy(&ref[1]) < 0) TEST_ERROR
+
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Sclose(spacer_id);
+ H5Sclose(space_id);
+ H5Dclose(dsetv_id);
+ H5Aclose(aid);
+ H5Rdestroy(&ref[0]);
+ H5Rdestroy(&ref[1]);
+ } H5E_END_TRY;
+
+ return(-1);
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: create_reg_ref_dataset
+ *
+ * Purpose: Create a dataset with region references
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Peter Cao
+ * Friday, August 4, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+create_reg_ref_dataset(hid_t file_id, hid_t loc_id)
+{
+ const char dsetnamev[] = "dataset_pointed_by_ref_dset";
+ const char dsetnamer[] = "dataset_with_reg_ref";
+ const char dsetnamer1[] = "compact_dataset_with_reg_ref";
+ const char dsetnamer2[] = "compressed_dataset_with_reg_ref";
+ hid_t space_id = (-1); /* dataspace identifiers */
+ hid_t spacer_id = (-1);
+ hid_t dsetv_id = (-1); /*dataset identifiers*/
+ hid_t dsetr_id = (-1);
+ hsize_t dims[2] = {2,9};
+ hsize_t dimsr[1] = {2};
+ int rank = 2;
+ int rankr =1;
+ hsize_t chunk_size=1;
+ H5R_ref_t ref[2];
+ int data[2][9] = {{1,1,2,3,3,4,5,5,6},{1,2,2,3,4,4,5,6,6}};
+ hsize_t start[2];
+ hsize_t count[2];
+ hsize_t coord[3][2] = {{0, 0}, {1, 6}, {0, 8}};
+ size_t num_points = 3;
+ hid_t pid = (-1);
+
+ if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR
+ if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0) TEST_ERROR
+ if((dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data) < 0) TEST_ERROR
+ if((dsetr_id = H5Dcreate2(loc_id, dsetnamer, H5T_STD_REF, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ start[0] = 0;
+ start[1] = 3;
+ count[0] = 2;
+ count[1] = 3;
+ if(H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL) < 0) TEST_ERROR
+ if(H5Rcreate_region(file_id, dsetnamev, space_id, H5P_DEFAULT, &ref[0]) < 0) TEST_ERROR
+ if(H5Sselect_none(space_id) < 0) TEST_ERROR
+ if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0) TEST_ERROR
+ if(H5Rcreate_region(file_id, dsetnamev, space_id, H5P_DEFAULT, &ref[1]) < 0) TEST_ERROR
+ if(H5Dwrite(dsetr_id, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref) < 0) TEST_ERROR
+ if(H5Dclose(dsetr_id) < 0) TEST_ERROR
+
+ /* create and set compact plist */
+ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR
+
+ if((dsetr_id = H5Dcreate2(loc_id, dsetnamer1, H5T_STD_REF, spacer_id, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Pclose(pid) < 0) TEST_ERROR
+ if(H5Dwrite(dsetr_id, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0) TEST_ERROR
+ if(H5Dclose(dsetr_id) < 0) TEST_ERROR
+
+ /* create and set comp & chunk plist */
+ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(pid, 1, &chunk_size) < 0) TEST_ERROR
+ if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR
+
+ if((dsetr_id = H5Dcreate2(loc_id, dsetnamer2, H5T_STD_REF, spacer_id, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Pclose(pid) < 0) TEST_ERROR
+ if(H5Dwrite(dsetr_id, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref) < 0) TEST_ERROR
+ if(H5Dclose(dsetr_id) < 0) TEST_ERROR
+
+ if(H5Sclose(space_id) < 0) TEST_ERROR
+ if(H5Sclose(spacer_id) < 0) TEST_ERROR
+ if(H5Dclose(dsetv_id) < 0) TEST_ERROR
+ if(H5Rdestroy(&ref[0]) < 0) TEST_ERROR
+ if(H5Rdestroy(&ref[1]) < 0) TEST_ERROR
+
+ return 0;
+
+
+error:
+ H5E_BEGIN_TRY {
+ H5Sclose(space_id);
+ H5Sclose(spacer_id);
+ H5Dclose(dsetr_id);
+ H5Dclose(dsetv_id);
+ H5Pclose(pid);
+ H5Rdestroy(&ref[0]);
+ H5Rdestroy(&ref[1]);
+ } H5E_END_TRY;
+
+ return(-1);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: test_copy_attach_attributes
+ *
+ * Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Peter Cao
+ * Friday, September 30, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_copy_attach_attributes(hid_t loc_id, hid_t type_id)
+{
+ hid_t aid = -1, sid = -1;
+ char attr_name[ATTR_NAME_LEN];
+ int attr_data[2];
+ hsize_t dim1 = 2;
+ hid_t acpl = -1;
+ unsigned u;
+ int ret_value = -1;
+
+ if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 )
+ goto done;
+
+ /* Create attribute creation plist */
+ if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0)
+ goto done;
+
+ for(u = 0; u < num_attributes_g; u++) {
+ HDsprintf(attr_name, "%u attr", u);
+
+ /* Set attribute data */
+ attr_data[0] = (int)(100 * u);
+ attr_data[1] = (int)(200 * u);
+
+ /* Set attribute character set (alternate) */
+ if(u % 2) {
+ if(H5Pset_char_encoding(acpl, H5T_CSET_ASCII) < 0)
+ goto done;
+ } /* end if */
+ else
+ if(H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0)
+ goto done;
+
+ if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, acpl, H5P_DEFAULT)) < 0)
+ goto done;
+
+ if(H5Awrite(aid, H5T_NATIVE_INT, attr_data) < 0)
+ goto done;
+
+ if(aid > 0)
+ H5Aclose(aid);
+
+ aid = -1;
+ }
+
+ ret_value = 0;
+
+done:
+ if(sid > 0)
+ H5Sclose(sid);
+ if(aid > 0)
+ H5Aclose(aid);
+ if(acpl > 0)
+ H5Pclose(acpl);
+
+ return ret_value;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: compare_attribute
+ *
+ * Purpose: Compare two attributes to check that they are equal
+ *
+ * Return: TRUE if attributes are equal/FALSE if they are different
+ *
+ * Programmer: Peter Cao
+ * Saturday, December 17, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_owner)
+{
+ hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t tid = -1, tid2 = -1; /* Datatype IDs */
+ size_t elmt_size; /* Size of datatype */
+ htri_t is_committed; /* If the datatype is committed */
+ htri_t is_committed2; /* If the datatype is committed */
+ H5A_info_t ainfo; /* Attribute info */
+ H5A_info_t ainfo2; /* Attribute info */
+ hssize_t nelmts; /* # of elements in dataspace */
+ void *rbuf = NULL; /* Buffer for reading raw data */
+ void *rbuf2 = NULL; /* Buffer for reading raw data */
+
+ /* Check the character sets are equal */
+ if(H5Aget_info(aid, &ainfo) < 0) TEST_ERROR
+ if(H5Aget_info(aid2, &ainfo2) < 0) TEST_ERROR
+ if(ainfo.cset != ainfo2.cset) TEST_ERROR
+
+ /* Check the creation orders are equal (if appropriate) */
+ if(ainfo.corder_valid != ainfo2.corder_valid) TEST_ERROR
+ if(ainfo.corder_valid)
+ if(ainfo.corder != ainfo2.corder) TEST_ERROR
+
+ /* Check the datatypes are equal */
+
+ /* Open the datatype for the source attribute */
+ if((tid = H5Aget_type(aid)) < 0) TEST_ERROR
+
+ /* Open the datatype for the destination attribute */
+ if((tid2 = H5Aget_type(aid2)) < 0) TEST_ERROR
+
+ /* Check that both datatypes are committed/not committed */
+ if((is_committed = H5Tcommitted(tid)) < 0) TEST_ERROR
+ if((is_committed2 = H5Tcommitted(tid2)) < 0) TEST_ERROR
+ if(is_committed != is_committed2) TEST_ERROR
+
+ /* Compare the datatypes */
+ if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR
+
+ /* Determine the size of datatype (for later) */
+ if((elmt_size = H5Tget_size(tid)) == 0) TEST_ERROR
+
+ /* Check the dataspaces are equal */
+
+ /* Open the dataspace for the source attribute */
+ if((sid = H5Aget_space(aid)) < 0) TEST_ERROR
+
+ /* Open the dataspace for the destination attribute */
+ if((sid2 = H5Aget_space(aid2)) < 0) TEST_ERROR
+
+ /* Compare the dataspaces */
+ if(H5Sextent_equal(sid, sid2) != TRUE) TEST_ERROR
+
+ /* Determine the number of elements in dataspace (for later) */
+ if((nelmts = H5Sget_simple_extent_npoints(sid2)) < 0) TEST_ERROR
+
+ /* Check the raw data is equal */
+
+ /* Allocate & initialize space for the raw data buffers */
+ if((rbuf = HDcalloc( elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR
+ if((rbuf2 = HDcalloc( elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR
+
+ /* Read data from the source attribute */
+ if(H5Aread(aid, tid, rbuf) < 0) TEST_ERROR
+
+ /* Read data from the destination attribute */
+ if(H5Aread(aid2, tid2, rbuf2) < 0) TEST_ERROR
+
+ /* Check raw data read in against data written out */
+ if(wbuf) {
+ if(!compare_data(aid, (hid_t)0, pid, tid, (size_t)nelmts, wbuf, rbuf, obj_owner)) TEST_ERROR
+ if(!compare_data(aid2, (hid_t)0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, obj_owner)) TEST_ERROR
+ } /* end if */
+ /* Don't have written data, just compare data between the two attributes */
+ else
+ if(!compare_data(aid, aid2, pid, tid, (size_t)nelmts, rbuf, rbuf2, obj_owner)) TEST_ERROR
+
+ /* Reclaim vlen data, if necessary */
+ if(H5Tdetect_class(tid, H5T_VLEN) == TRUE || H5Tdetect_class(tid, H5T_REFERENCE) == TRUE)
+ if(H5Treclaim(tid, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
+ if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE || H5Tdetect_class(tid2, H5T_REFERENCE) == TRUE)
+ if(H5Treclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
+
+ /* Release raw data buffers */
+ HDfree(rbuf);
+ rbuf = NULL;
+ HDfree(rbuf2);
+ rbuf2 = NULL;
+
+ /* close the source dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* close the destination dataspace */
+ if(H5Sclose(sid2) < 0) TEST_ERROR
+
+ /* close the source datatype */
+ if(H5Tclose(tid) < 0) TEST_ERROR
+
+ /* close the destination datatype */
+ if(H5Tclose(tid2) < 0) TEST_ERROR
+
+ return TRUE;
+
+error:
+ if(rbuf)
+ HDfree(rbuf);
+ if(rbuf2)
+ HDfree(rbuf2);
+ H5E_BEGIN_TRY {
+ H5Sclose(sid2);
+ H5Sclose(sid);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+ return FALSE;
+} /* end compare_attribute() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: compare_std_attributes
+ *
+ * Purpose: Compare "standard" attributes on two objects to check that they are equal
+ *
+ * Return: TRUE if objects have same attributes/FALSE if they are different
+ *
+ * Programmer: Quincey Koziol
+ * Monday, October 31, 2005
+ *
+ * Note: This isn't very general, the attributes are assumed to be
+ * those written in test_copy_attach_attributes().
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid)
+{
+ hid_t aid = -1, aid2 = -1; /* Attribute IDs */
+ H5O_info2_t oinfo1, oinfo2; /* Object info */
+ unsigned cpy_flags; /* Object copy flags */
+
+ /* Retrieve the object copy flags from the property list, if it's non-DEFAULT */
+ if(pid != H5P_DEFAULT) {
+ if(H5Pget_copy_object(pid, &cpy_flags) < 0) TEST_ERROR
+ } /* end if */
+ else
+ cpy_flags = 0;
+
+ /* Check the number of attributes on source dataset */
+ if(H5Oget_info3(oid, &oinfo1, H5O_INFO_NUM_ATTRS) < 0) TEST_ERROR
+
+ /* Check the number of attributes on destination dataset */
+ if(H5Oget_info3(oid2, &oinfo2, H5O_INFO_NUM_ATTRS) < 0) TEST_ERROR
+
+ if(cpy_flags & H5O_COPY_WITHOUT_ATTR_FLAG) {
+ /* Check that the destination has no attributes */
+ if(oinfo2.num_attrs != 0) TEST_ERROR
+ } /* end if */
+ else {
+ char attr_name[ATTR_NAME_LEN]; /* Attribute name */
+ unsigned i; /* Local index variable */
+
+ /* Compare the number of attributes */
+ if(oinfo1.num_attrs != oinfo2.num_attrs) TEST_ERROR
+
+ /* Check the attributes are equal */
+ for(i = 0; i < (unsigned)oinfo1.num_attrs; i++) {
+ if((aid = H5Aopen_by_idx(oid, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)i, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Aget_name(aid, (size_t)ATTR_NAME_LEN, attr_name) < 0) TEST_ERROR
+
+ if((aid2 = H5Aopen(oid2, attr_name, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check the attributes are equal */
+ if(!compare_attribute(aid, aid2, pid, NULL, oid)) TEST_ERROR
+
+ /* Close the attributes */
+ if(H5Aclose(aid) < 0) TEST_ERROR
+ if(H5Aclose(aid2) < 0) TEST_ERROR
+ } /* end for */
+ } /* end if */
+
+ /* Objects should be the same. :-) */
+ return TRUE;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Aclose(aid2);
+ H5Aclose(aid);
+ } H5E_END_TRY;
+ return FALSE;
+} /* end compare_std_attributes() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: compare_data
+ *
+ * Purpose: Compare two buffers of data to check that they are equal
+ *
+ * Return: TRUE if buffer are equal/FALSE if they are different
+ *
+ * Programmer: Quincey Koziol
+ * Monday, November 21, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+compare_data(hid_t parent1, hid_t parent2, hid_t pid, hid_t tid, size_t nelmts,
+ const void *buf1, const void *buf2, hid_t obj_owner)
+{
+ size_t elmt_size; /* Size of an element */
+
+ /* Check size of each element */
+ if((elmt_size = H5Tget_size(tid)) == 0) TEST_ERROR
+
+ /* If the type is a compound containing a vlen, loop over all elements for
+ * each compound member. Compounds containing reference are not supported
+ * yet. */
+ if((H5Tget_class(tid) == H5T_COMPOUND)
+ && (H5Tdetect_class(tid, H5T_VLEN) == TRUE)) {
+ hid_t memb_id; /* Member id */
+ const uint8_t *memb1; /* Pointer to current member */
+ const uint8_t *memb2; /* Pointer to current member */
+ int nmembs; /* Number of members */
+ size_t memb_off; /* Member offset */
+ size_t memb_size; /* Member size */
+ unsigned memb_idx; /* Member index */
+ size_t elmt; /* Current element */
+
+ /* Get number of members in compound */
+ if((nmembs = H5Tget_nmembers(tid)) < 0) TEST_ERROR
+
+ /* Loop over members */
+ for(memb_idx=0; memb_idx<(unsigned)nmembs; memb_idx++) {
+ /* Get member offset. Note that we cannot check for an error here.
+ */
+ memb_off = H5Tget_member_offset(tid, memb_idx);
+
+ /* Get member id */
+ if((memb_id = H5Tget_member_type(tid, memb_idx)) < 0) TEST_ERROR
+
+ /* Get member size */
+ if((memb_size = H5Tget_size(memb_id)) == 0) TEST_ERROR
+
+ /* Set up pointers to member in the first element */
+ memb1 = (const uint8_t *)buf1 + memb_off;
+ memb2 = (const uint8_t *)buf2 + memb_off;
+
+ /* Check if this member contains (or is) a vlen */
+ if(H5Tget_class(memb_id) == H5T_VLEN) {
+ hid_t base_id; /* vlen base type id */
+
+ /* Get base type of vlen datatype */
+ if((base_id = H5Tget_super(memb_id)) < 0) TEST_ERROR
+
+ /* Iterate over all elements, recursively calling this function
+ * for each */
+ for(elmt=0; elmt<nelmts; elmt++) {
+ /* Check vlen lengths */
+ if(((const hvl_t *)((const void *)memb1))->len
+ != ((const hvl_t *)((const void *)memb2))->len)
+ TEST_ERROR
+
+ /* Check vlen data */
+ if(!compare_data(parent1, parent2, pid, base_id,
+ ((const hvl_t *)((const void *)memb1))->len,
+ ((const hvl_t *)((const void *)memb1))->p,
+ ((const hvl_t *)((const void *)memb2))->p, obj_owner))
+ TEST_ERROR
+
+ /* Update member pointers */
+ memb1 += elmt_size;
+ memb2 += elmt_size;
+ } /* end for */
+ } else {
+ /* vlens cannot currently be nested below the top layer of a
+ * compound */
+ HDassert(H5Tdetect_class(memb_id, H5T_VLEN) == FALSE);
+
+ /* Iterate over all elements, calling memcmp() for each */
+ for(elmt=0; elmt<nelmts; elmt++) {
+ if(HDmemcmp(memb1, memb2, memb_size))
+ TEST_ERROR
+
+ /* Update member pointers */
+ memb1 += elmt_size;
+ memb2 += elmt_size;
+ } /* end for */
+ } /* end else */
+ } /* end for */
+ } else if(H5Tdetect_class(tid, H5T_VLEN) == TRUE) {
+ const hvl_t *vl_buf1, *vl_buf2; /* Aliases for buffers to compare */
+ hid_t base_tid; /* Base type of vlen datatype */
+ size_t u; /* Local index variable */
+
+ /* Check for "simple" vlen datatype */
+ if(H5Tget_class(tid) != H5T_VLEN) TEST_ERROR
+
+ /* Get base type of vlen datatype */
+ if((base_tid = H5Tget_super(tid)) < 0) TEST_ERROR
+
+ /* Loop over elements in buffers */
+ vl_buf1 = (const hvl_t *)buf1;
+ vl_buf2 = (const hvl_t *)buf2;
+ for(u = 0; u < nelmts; u++, vl_buf1++, vl_buf2++) {
+ /* Check vlen lengths */
+ if(vl_buf1->len != vl_buf2->len) TEST_ERROR
+
+ /* Check vlen data */
+ if(!compare_data(parent1, parent2, pid, base_tid, vl_buf1->len, vl_buf1->p, vl_buf2->p, obj_owner)) TEST_ERROR
+ } /* end for */
+
+ if(H5Tclose(base_tid) < 0) TEST_ERROR
+ } /* end if */
+ else if(H5Tdetect_class(tid, H5T_REFERENCE) == TRUE) {
+ size_t u; /* Local index variable */
+
+ /* Check for "simple" reference datatype */
+ if(H5Tget_class(tid) != H5T_REFERENCE) TEST_ERROR
+
+ /* Check for object or region reference */
+ if(H5Tequal(tid, H5T_STD_REF) > 0) {
+ H5R_ref_t *ref_buf1, *ref_buf2; /* Aliases for buffers to compare */
+
+ /* Loop over elements in buffers */
+ ref_buf1 = (H5R_ref_t *)buf1;
+ ref_buf2 = (H5R_ref_t *)buf2;
+ for(u = 0; u < nelmts; u++, ref_buf1++, ref_buf2++) {
+ hid_t obj1_id, obj2_id; /* IDs for objects referenced */
+ H5O_type_t obj1_type, obj2_type; /* Types of objects referenced */
+
+ /* Check for types of objects handled */
+ if(H5Rget_obj_type3(ref_buf1, H5P_DEFAULT, &obj1_type) < 0) TEST_ERROR
+ if(H5Rget_obj_type3(ref_buf2, H5P_DEFAULT, &obj2_type) < 0) TEST_ERROR
+ if(obj1_type != obj2_type) TEST_ERROR
+
+ /* Open referenced objects */
+ if((obj1_id = H5Ropen_object(ref_buf1, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((obj2_id = H5Ropen_object(ref_buf2, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* break the infinite loop when the ref_object points to itself */
+ if(obj_owner > 0) {
+ H5O_info2_t oinfo1, oinfo2;
+ int token_cmp;
+
+ if(H5Oget_info3(obj_owner, &oinfo1, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Oget_info3(obj1_id, &oinfo2, H5O_INFO_BASIC) < 0) TEST_ERROR
+ if(H5Otoken_cmp(obj1_id, &oinfo1.token, &oinfo2.token, &token_cmp) < 0) TEST_ERROR
+ if(0 == token_cmp) {
+ if(H5Oclose(obj1_id) < 0) TEST_ERROR
+ if(H5Oclose(obj2_id) < 0) TEST_ERROR
+ return TRUE;
+ }
+ }
+
+ /* Check for types of objects handled */
+ switch(obj1_type) {
+ case H5O_TYPE_DATASET:
+ if(compare_datasets(obj1_id, obj2_id, pid, NULL) != TRUE) TEST_ERROR
+ break;
+
+ case H5O_TYPE_GROUP:
+ if(compare_groups(obj1_id, obj2_id, pid, -1, 0) != TRUE) TEST_ERROR
+ break;
+
+ case H5O_TYPE_NAMED_DATATYPE:
+ 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:
+ TEST_ERROR
+ } /* end switch */
+
+ /* Close objects */
+ if(H5Oclose(obj1_id) < 0) TEST_ERROR
+ if(H5Oclose(obj2_id) < 0) TEST_ERROR
+
+ if(H5Rget_type(ref_buf1) == H5R_DATASET_REGION2) {
+ hid_t obj1_sid, obj2_sid; /* Dataspace IDs for objects referenced */
+
+ /* Get regions for referenced datasets */
+ if((obj1_sid = H5Ropen_region(ref_buf1, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((obj2_sid = H5Ropen_region(ref_buf2, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Check if dataspaces are the same shape */
+ if(H5Sselect_shape_same(obj1_sid, obj2_sid) < 0) TEST_ERROR
+
+ /* Close dataspaces */
+ if(H5Sclose(obj1_sid) < 0) TEST_ERROR
+ if(H5Sclose(obj2_sid) < 0) TEST_ERROR
+ } /* end if */
+ } /* end for */
+ } /* end if */
+ else
+ TEST_ERROR
+ } /* end else */
+ else
+ if(HDmemcmp(buf1, buf2, (elmt_size * nelmts))) TEST_ERROR
+
+ /* Data should be the same. :-) */
+ return TRUE;
+
+error:
+ return FALSE;
+} /* end compare_data() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: compare_datasets
+ *
+ * Purpose: Compare two datasets to check that they are equal
+ *
+ * Return: TRUE if datasets are equal/FALSE if they are different
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, October 25, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
+{
+ hid_t sid = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t tid = -1, tid2 = -1; /* Datatype IDs */
+ hid_t dcpl = -1, dcpl2 = -1; /* Dataset creation property list IDs */
+ size_t elmt_size; /* Size of datatype */
+ htri_t is_committed; /* If the datatype is committed */
+ htri_t is_committed2; /* If the datatype is committed */
+ int nfilters; /* Number of filters applied to dataset */
+ 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 dataspace status */
+ H5D_space_status_t space_status2; /* Dataset's raw dataspace status */
+
+ /* Check the datatypes are equal */
+
+ /* Open the datatype for the source dataset */
+ if((tid = H5Dget_type(did)) < 0) TEST_ERROR
+
+ /* Open the datatype for the destination dataset */
+ if((tid2 = H5Dget_type(did2)) < 0) TEST_ERROR
+
+ /* Check that both datatypes are committed/not committed */
+ if((is_committed = H5Tcommitted(tid)) < 0) TEST_ERROR
+ if((is_committed2 = H5Tcommitted(tid2)) < 0) TEST_ERROR
+ if(is_committed != is_committed2) TEST_ERROR
+
+ /* Compare the datatypes */
+ if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR
+
+ /* Determine the size of datatype (for later) */
+ if((elmt_size = H5Tget_size(tid)) == 0) TEST_ERROR
+
+
+ /* Check the dataspaces are equal */
+
+ /* Open the dataspace for the source dataset */
+ if((sid = H5Dget_space(did)) < 0) TEST_ERROR
+
+ /* Open the dataspace for the destination dataset */
+ if((sid2 = H5Dget_space(did2)) < 0) TEST_ERROR
+
+ /* Compare the dataspaces */
+ if(H5Sextent_equal(sid, sid2) != TRUE) TEST_ERROR
+
+ /* Determine the number of elements in dataspace (for later) */
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0) TEST_ERROR
+
+
+ /* Check the dataset creation property lists are equal */
+
+ /* Open the dataset creation property list for the source dataset */
+ if((dcpl = H5Dget_create_plist(did)) < 0) TEST_ERROR
+
+ /* Open the dataset creation property list for the destination dataset */
+ if((dcpl2 = H5Dget_create_plist(did2)) < 0) TEST_ERROR
+
+ /* Compare the rest of the dataset creation property lists */
+ if(H5Pequal(dcpl, dcpl2) != TRUE) TEST_ERROR
+
+ /* Get the number of filters on dataset (for later) */
+ if((nfilters = H5Pget_nfilters(dcpl)) < 0) TEST_ERROR
+
+ /* close the source dataset creation property list */
+ if(H5Pclose(dcpl) < 0) TEST_ERROR
+
+ /* close the destination dataset creation property list */
+ if(H5Pclose(dcpl2) < 0) TEST_ERROR
+
+
+ /* Check the allocated storage is the same */
+
+ /* Check that the space allocation status is the same */
+ if(H5Dget_space_status(did, &space_status) < 0) TEST_ERROR
+ if(H5Dget_space_status(did2, &space_status2) < 0) TEST_ERROR
+ if(space_status != space_status2) TEST_ERROR
+
+ /* Check that the space used is the same */
+ /* (Don't check if the dataset is filtered (i.e. compressed, etc.) and
+ * the datatype is VLEN, since the addresses for the vlen
+ * data in each dataset will (probably) be different and the storage
+ * size will thus vary)
+ */
+ if(!(nfilters > 0 && (H5Tdetect_class(tid, H5T_VLEN) ||
+ (H5Tdetect_class(tid, H5T_REFERENCE) && H5Tequal(tid, H5T_STD_REF))))) {
+ hsize_t storage_size = H5Dget_storage_size(did); /* Dataset's raw data storage size */
+ hsize_t storage_size2 = H5Dget_storage_size(did2); /* 2nd Dataset's raw data storage size */
+
+ if(storage_size != storage_size2) TEST_ERROR
+ } /* end if */
+
+ /* Check the raw data is equal */
+
+ /* Allocate & initialize space for the raw data buffers */
+ if((rbuf = HDcalloc( elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR
+ if((rbuf2 = HDcalloc( elmt_size, (size_t)nelmts)) == NULL) TEST_ERROR
+
+ /* Read data from datasets */
+ if(H5Dread(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
+ if(H5Dread(did2, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
+
+ /* Check raw data read in against data written out */
+ if(wbuf) {
+ if(!compare_data(did, (hid_t)0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR
+ if(!compare_data(did2, (hid_t)0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR
+ } /* end if */
+ /* Don't have written data, just compare data between the two datasets */
+ else
+ if(!compare_data(did, did2, pid, tid, (size_t)nelmts, rbuf, rbuf2, did)) TEST_ERROR
+
+ /* Reclaim vlen data, if necessary */
+ if(H5Tdetect_class(tid, H5T_VLEN) == TRUE || H5Tdetect_class(tid, H5T_REFERENCE) == TRUE)
+ if(H5Treclaim(tid, sid, H5P_DEFAULT, rbuf) < 0) TEST_ERROR
+ if(H5Tdetect_class(tid2, H5T_VLEN) == TRUE || H5Tdetect_class(tid2, H5T_REFERENCE) == TRUE)
+ if(H5Treclaim(tid2, sid2, H5P_DEFAULT, rbuf2) < 0) TEST_ERROR
+
+ /* Release raw data buffers */
+ HDfree(rbuf);
+ rbuf = NULL;
+ HDfree(rbuf2);
+ rbuf2 = NULL;
+
+ /* close the source dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ /* close the destination dataspace */
+ if(H5Sclose(sid2) < 0) TEST_ERROR
+
+ /* close the source datatype */
+ if(H5Tclose(tid) < 0) TEST_ERROR
+
+ /* close the destination datatype */
+ if(H5Tclose(tid2) < 0) TEST_ERROR
+
+
+ /* Check if the attributes are equal */
+ if(compare_std_attributes(did, did2, pid) != TRUE) TEST_ERROR
+
+
+ /* Datasets should be the same. :-) */
+ return TRUE;
+
+error:
+ H5E_BEGIN_TRY {
+ if(rbuf)
+ HDfree(rbuf);
+ if(rbuf2)
+ HDfree(rbuf2);
+ H5Pclose(dcpl2);
+ H5Pclose(dcpl);
+ H5Sclose(sid2);
+ H5Sclose(sid);
+ H5Tclose(tid2);
+ H5Tclose(tid);
+ } H5E_END_TRY;
+ return FALSE;
+} /* end compare_datasets() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: compare_groups
+ *
+ * Purpose: Compare two groups to check that they are "equal"
+ *
+ * Return: TRUE if group are equal/FALSE if they are different
+ *
+ * Programmer: Quincey Koziol
+ * Monday, October 31, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags)
+{
+ H5G_info_t ginfo; /* Group info struct */
+ H5G_info_t ginfo2; /* Group info struct */
+ hsize_t idx; /* Index over the objects in group */
+ unsigned cpy_flags; /* Object copy flags */
+
+ /* Retrieve the object copy flags from the property list, if it's non-DEFAULT */
+ if(pid != H5P_DEFAULT) {
+ if(H5Pget_copy_object(pid, &cpy_flags) < 0) TEST_ERROR
+ } /* end if */
+ else
+ cpy_flags = 0;
+
+ /* Check if both groups have the same # of objects */
+ if(H5Gget_info(gid, &ginfo) < 0) TEST_ERROR
+ if(H5Gget_info(gid2, &ginfo2) < 0) TEST_ERROR
+ if((cpy_flags & H5O_COPY_SHALLOW_HIERARCHY_FLAG) && depth == 0) {
+ if(ginfo2.nlinks != 0) TEST_ERROR
+ } /* end if */
+ else {
+ if(ginfo.nlinks != ginfo2.nlinks) TEST_ERROR
+ } /* end if */
+
+ /* Check contents of groups */
+ if(ginfo2.nlinks > 0) {
+ char objname[NAME_BUF_SIZE]; /* Name of object in group */
+ char objname2[NAME_BUF_SIZE]; /* Name of object in group */
+ H5L_info2_t linfo; /* Link information */
+ H5L_info2_t linfo2; /* Link information */
+
+ /* Loop over contents of groups */
+ for(idx = 0; idx < ginfo.nlinks; idx++) {
+ /* Check name of objects */
+ if(H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, idx, objname, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_name_by_idx(gid2, ".", H5_INDEX_NAME, H5_ITER_INC, idx, objname2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(HDstrcmp(objname, objname2)) TEST_ERROR
+
+ /* Get link info */
+ if(H5Lget_info2(gid, objname, &linfo, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_info2(gid2, objname2, &linfo2, H5P_DEFAULT) < 0) TEST_ERROR
+ if(linfo.type != linfo2.type) TEST_ERROR
+
+ /* Extra checks for "real" objects */
+ if(linfo.type == H5L_TYPE_HARD) {
+ hid_t oid, oid2; /* IDs of objects within group */
+ H5O_info2_t oinfo, oinfo2; /* Data model object info */
+ H5O_native_info_t ninfo, ninfo2; /* Native file format object info */
+
+ /* Compare some pieces of the object info */
+ /* Get data model object info */
+ if(H5Oget_info_by_name3(gid, objname, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_info_by_name3(gid2, objname2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Get native object info */
+ if(H5Oget_native_info_by_name(gid, objname, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Oget_native_info_by_name(gid2, objname2, &ninfo2, H5O_NATIVE_INFO_HDR, H5P_DEFAULT) < 0) TEST_ERROR
+
+ if(oinfo.type != oinfo2.type) TEST_ERROR
+ if(oinfo.rc != oinfo2.rc) TEST_ERROR
+
+ /* If NULL messages are preserved, the number of messages
+ * should be the same in the destination.
+ * Otherwise, it should simply be true that the number
+ * of messages hasn't increased.
+ */
+ if(H5O_COPY_PRESERVE_NULL_FLAG & copy_flags) {
+ if(ninfo.hdr.nmesgs != ninfo2.hdr.nmesgs)
+ ;
+ else
+ if(ninfo.hdr.nmesgs < ninfo2.hdr.nmesgs)
+ TEST_ERROR
+ }
+
+ /* Check for object already having been compared */
+ if(token_lookup(gid, &oinfo))
+ continue;
+ else
+ token_insert(&oinfo);
+
+ /* Open objects */
+ if((oid = H5Oopen(gid, objname, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((oid2 = H5Oopen(gid2, objname2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Compare objects within group */
+ switch(oinfo.type) {
+ case H5O_TYPE_GROUP:
+ /* Compare groups */
+ if(compare_groups(oid, oid2, pid, depth - 1, copy_flags) != TRUE) TEST_ERROR
+ break;
+
+ case H5O_TYPE_DATASET:
+ /* Compare datasets */
+ if(compare_datasets(oid, oid2, pid, NULL) != TRUE) TEST_ERROR
+ break;
+
+ case H5O_TYPE_NAMED_DATATYPE:
+ /* Compare datatypes */
+ 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");
+ break;
+ } /* end switch */
+
+ /* Close objects */
+ if(H5Oclose(oid) < 0) TEST_ERROR
+ if(H5Oclose(oid2) < 0) TEST_ERROR
+ } /* end if */
+ else {
+ /* Check that both links are the same size */
+ if(linfo.u.val_size != linfo2.u.val_size) TEST_ERROR
+
+ /* Compare link values */
+ if(linfo.type == H5L_TYPE_SOFT ||
+ (linfo.type >= H5L_TYPE_UD_MIN && linfo.type <= H5L_TYPE_MAX)) {
+ char linkval[NAME_BUF_SIZE]; /* Link value */
+ char linkval2[NAME_BUF_SIZE]; /* Link value */
+
+ /* Get link values */
+ HDassert(linfo.u.val_size <= NAME_BUF_SIZE);
+ if(H5Lget_val(gid, objname, linkval, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lget_val(gid2, objname2, linkval2, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Compare link data */
+ if(HDmemcmp(linkval, linkval2, linfo.u.val_size)) TEST_ERROR
+ } /* end else-if */
+ else {
+HDassert(0 && "Unknown type of link");
+ } /* end else */
+ } /* end else */
+ } /* end for */
+ } /* end if */
+
+ /* Check if the attributes are equal */
+ if(compare_std_attributes(gid, gid2, pid) != TRUE) TEST_ERROR
+
+ /* Groups should be the same. :-) */
+ return TRUE;
+
+error:
+ H5E_BEGIN_TRY {
+ } H5E_END_TRY;
+ return FALSE;
+} /* end compare_groups() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_copy_option
+ *
+ * Purpose: Create a group in SRC file and copy it to DST file
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ * Programmer: Peter Cao
+ * March 11, 2006
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl,
+ unsigned flag, hbool_t crt_intermediate_grp, const char* test_desciption)
+{
+ hid_t fid_src = -1, fid_dst = -1, fid_ext = -1; /* File IDs */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t gid=-1, gid2=-1, gid_ref=-1; /* Group IDs */
+ hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */
+ hid_t pid=-1, lcpl_id=-1; /* Property IDs */
+ unsigned cpy_flags; /* Object copy flags */
+ int depth = -1; /* Copy depth */
+ hsize_t dim2d[2];
+ int buf[DIM_SIZE_1][DIM_SIZE_2];
+ int i, j;
+ char src_filename[NAME_BUF_SIZE];
+ char dst_filename[NAME_BUF_SIZE];
+
+ TESTING(test_desciption);
+
+ /* set initial data values */
+ for (i=0; i<DIM_SIZE_1; i++)
+ for (j=0; j<DIM_SIZE_2; j++)
+ buf[i][j] = 10000 + 100*i+j;
+
+ /* Initialize the filenames */
+ h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename);
+ h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename);
+
+ /* Reset file token checking info */
+ token_reset();
+
+ /* create source file */
+ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
+
+ /* create group at the SRC file */
+ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* attach attributes to the group */
+ if(test_copy_attach_attributes(gid, H5T_NATIVE_INT) < 0) TEST_ERROR
+
+ /* Set dataspace dimensions */
+ dim2d[0]=DIM_SIZE_1;
+ dim2d[1]=DIM_SIZE_2;
+
+ /* create dataspace */
+ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
+
+ /* add a dataset to the top group */
+ if((did = H5Dcreate2(gid, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* create a sub-group */
+ if((gid_sub = H5Gcreate2(fid_src, NAME_GROUP_SUB, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* add a dataset to the sub group */
+ if((did = H5Dcreate2(gid_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* create sub-sub-group */
+ if((gid_sub_sub = H5Gcreate2(gid_sub, NAME_GROUP_SUB_SUB2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* add a dataset to the sub sub group */
+ if((did = H5Dcreate2(gid_sub_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+
+ /* close dataset */
+ if(H5Dclose(did) < 0) TEST_ERROR
+
+ /* close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+
+ if(H5Gclose(gid_sub_sub) < 0) TEST_ERROR
+
+ if(H5Gclose(gid_sub) < 0) TEST_ERROR
+
+ /* close the group */
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ if((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0) {
+ /* Create group to copy */
+ if((gid = H5Gcreate2(fid_src, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft(NAME_DATASET_SUB_SUB, fid_src, NAME_LINK_SOFT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("nowhere", fid_src, NAME_LINK_SOFT_DANGLE, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+
+ /* Create group to compare with */
+ if((gid = H5Gcreate2(fid_src, NAME_GROUP_LINK2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_hard(fid_src, NAME_DATASET_SUB_SUB, H5L_SAME_LOC, NAME_LINK_SOFT2, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Lcreate_soft("nowhere", fid_src, NAME_LINK_SOFT_DANGLE2, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR
+ } /* end if */
+
+ if((flag & H5O_COPY_EXPAND_EXT_LINK_FLAG) > 0) {
+ char ext_filename[NAME_BUF_SIZE];
+
+ h5_fixname(FILENAME[2], src_fapl, ext_filename, sizeof ext_filename);
+
+ /* Create the external file and dataset */
+ if((fid_ext = H5Fcreate(ext_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR
+ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_ext, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+ if(H5Fclose(fid_ext) < 0) TEST_ERROR
+
+ /* Create group to copy */
+ if(!(flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG)) {
+ if((gid = H5Gcreate2(fid_src, NAME_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ } /* end if */
+ else
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_LINK, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Lcreate_external(ext_filename, NAME_DATASET_SIMPLE, fid_src, NAME_LINK_EXTERN, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Lcreate_external("no_file", "no_object", fid_src, NAME_LINK_EXTERN_DANGLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Create group to compare with */
+ if(!(flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG)) {
+ if((gid = H5Gcreate2(fid_src, NAME_GROUP_LINK2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ } /* end if */
+ else
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_LINK2, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_LINK_EXTERN2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
+ if(H5Lcreate_external("no_file", "no_object", fid_src, NAME_LINK_EXTERN_DANGLE2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Dclose(did) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* Close dataspace */
+ if(H5Sclose(sid) < 0) TEST_ERROR
+ } /* end if */
+
+ if((flag & H5O_COPY_EXPAND_REFERENCE_FLAG) > 0) {
+ if((gid_ref = H5Gcreate2(fid_src, NAME_GROUP_REF, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* create an attribute of new object references */
+ if(attach_ref_attr(fid_src, gid_ref) < 0) TEST_ERROR
+
+ /* create an attribute of region references */
+ if(attach_reg_ref_attr(fid_src, gid_ref) < 0) TEST_ERROR
+
+ /* create a dataset of region references */
+ if(create_reg_ref_dataset(fid_src, gid_ref) < 0) TEST_ERROR
+
+ /* Close group holding reference objects */
+ if(H5Gclose(gid_ref) < 0) TEST_ERROR
+ } /* end if */
+
+ /* close the SRC file */
+ if(H5Fclose(fid_src) < 0) TEST_ERROR
+
+ /* open the source file with read-only */
+ /* (except when expanding soft links */
+ if((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0) {
+ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDWR, src_fapl)) < 0) TEST_ERROR
+ } /* end if */
+ else
+ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR
+
+ /* create destination file */
+ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR
+
+ /* Create an uncopied object in destination file so that tokens in source and destination
+ files aren't the same */
+ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* create property to pass copy options */
+ if((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR
+
+ /* set options for object copy */
+ if(H5Pset_copy_object(pid, flag) < 0) TEST_ERROR
+
+ /* Verify object copy flags */
+ if(H5Pget_copy_object(pid, &cpy_flags) < 0) TEST_ERROR
+ if(cpy_flags != flag) TEST_ERROR
+
+ /* copy the group from SRC to DST */
+ if(crt_intermediate_grp) {
+ /* Create link creation plist to pass in intermediate group creation */
+ if((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0) TEST_ERROR
+
+ if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, "/new_g0/new_g00", pid, lcpl_id) < 0) TEST_ERROR
+
+ if(H5Pclose(lcpl_id) < 0) TEST_ERROR
+
+ /* open the group for copy */
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* open the destination group */
+ if((gid2 = H5Gopen2(fid_dst, "/new_g0/new_g00", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ } else if(((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0)
+ || ((flag & H5O_COPY_EXPAND_EXT_LINK_FLAG) > 0)) {
+ if(H5Ocopy(fid_src, NAME_GROUP_LINK, fid_dst, NAME_GROUP_LINK, pid, H5P_DEFAULT) < 0) TEST_ERROR
+
+ if((flag & H5O_COPY_EXPAND_SOFT_LINK_FLAG) > 0)
+ /* Unlink dataset to copy from original location */
+ /* (So group comparison works properly) */
+ if(H5Ldelete(fid_src, NAME_DATASET_SUB_SUB, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+
+ /* open the group for copy */
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_LINK2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* open the destination group */
+ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_LINK, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ } else if(flag & (H5O_COPY_WITHOUT_ATTR_FLAG | H5O_COPY_PRESERVE_NULL_FLAG)) {
+ if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* open the group for copy */
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* open the destination group */
+ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ } else if(flag & H5O_COPY_SHALLOW_HIERARCHY_FLAG) {
+ if(H5Ocopy(fid_src, NAME_GROUP_TOP, fid_dst, NAME_GROUP_TOP, pid, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* open the group for copy */
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* open the destination group */
+ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* Set the copy depth */
+ depth = 1;
+ } else if((flag & H5O_COPY_EXPAND_REFERENCE_FLAG) > 0) {
+ if(H5Ocopy(fid_src, NAME_GROUP_REF, fid_dst, NAME_GROUP_REF, pid, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* open the group for copy */
+ if((gid = H5Gopen2(fid_src, NAME_GROUP_REF, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /* open the destination group */
+ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_REF, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ } else {
+ /* Unknown flag */
+ TEST_ERROR
+ } /* end else */
+
+ /* Check if the groups are equal */
+ if(compare_groups(gid, gid2, pid, depth, flag) != TRUE) TEST_ERROR
+ if(H5Gclose(gid2) < 0) TEST_ERROR
+ if(H5Gclose(gid) < 0) TEST_ERROR
+
+ /* close the SRC file */
+ if(H5Fclose(fid_src) < 0) TEST_ERROR
+
+ /* close the DST file */
+ if(H5Fclose(fid_dst) < 0) TEST_ERROR
+
+ /* close properties */
+ if(H5Pclose(pid) < 0) TEST_ERROR
+
+ PASSED();
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(lcpl_id);
+ H5Pclose(pid);
+ H5Sclose(sid);
+ H5Dclose(did);
+ H5Gclose(gid_ref);
+ H5Gclose(gid_sub);
+ H5Gclose(gid2);
+ H5Gclose(gid);
+ H5Fclose(fid_dst);
+ H5Fclose(fid_src);
+ H5Fclose(fid_ext);
+ } H5E_END_TRY;
+ return 1;
+} /* end test_copy_option */
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Test H5Ocopy()
+ *
+ * Tests a number of cases: messages can be stored in the
+ * new or old format, messages can be shared in either,
+ * both, or neither of the source and destination files.
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ * Programmer: Peter Cao
+ * Friday, September 30, 2005
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+ hid_t fapl, fapl2;
+ hid_t fcpl_shared, ocpl;
+ unsigned max_compact, min_dense;
+ int configuration; /* Configuration of tests. */
+ int ExpressMode;
+
+ /* Setup */
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ ExpressMode = GetTestExpress();
+ if (ExpressMode > 1)
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
+
+ /* Copy the file access property list */
+ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
+
+ /* Set the "use the latest version of the format" bounds for creating objects in the file */
+ if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) TEST_ERROR
+
+ /* Create an FCPL with sharing enabled */
+ if((fcpl_shared = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_shared_mesg_nindexes(fcpl_shared, 1) < 0) TEST_ERROR
+ if(H5Pset_shared_mesg_index(fcpl_shared, 0, H5O_SHMESG_ALL_FLAG, 10) < 0) TEST_ERROR
+
+ /* Obtain the default attribute storage phase change values */
+ if((ocpl = H5Pcreate(H5P_OBJECT_CREATE)) < 0) TEST_ERROR
+ if(H5Pget_attr_phase_change(ocpl, &max_compact, &min_dense) < 0) TEST_ERROR
+ if(H5Pclose(ocpl) < 0) TEST_ERROR
+
+ /* Test in all configurations */
+ for(configuration = 0; configuration <= MAX_CONFIGURATION; configuration++) {
+ hid_t src_fapl;
+ hid_t dst_fapl;
+ hid_t fcpl_src;
+ hid_t fcpl_dst;
+
+ /* No need to test dense attributes with old format */
+ if(!(configuration & CONFIG_SRC_NEW_FORMAT) && (configuration & CONFIG_DENSE))
+ continue;
+
+ /* TODO Region references currently do not support copy from new format to old format
+ * (this may be fixed once H5Sencode/decode and H5CXis fixed) */
+ if((configuration & CONFIG_SRC_NEW_FORMAT) && !(configuration & CONFIG_DST_NEW_FORMAT))
+ continue;
+
+ /* Test with and without shared messages */
+ if(configuration & CONFIG_SHARE_SRC) {
+ HDputs("\nTesting with shared src messages:");
+ fcpl_src = fcpl_shared;
+ }
+ else {
+ HDputs("\nTesting without shared src messages:");
+ fcpl_src = H5P_DEFAULT;
+ }
+ if(configuration & CONFIG_SHARE_DST) {
+ HDputs("Testing with shared dst messages:");
+ fcpl_dst = fcpl_shared;
+ }
+ else {
+ 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) {
+ HDputs("Testing with latest format for source file:");
+ src_fapl = fapl2;
+
+ /* Test with and without dense attributes */
+ if(configuration & CONFIG_DENSE) {
+ HDputs("Testing with dense attributes:");
+ num_attributes_g = max_compact + 1;
+ }
+ else {
+ HDputs("Testing without dense attributes:");
+ num_attributes_g = MAX(min_dense, 2) - 2;
+ }
+ } /* end if */
+ else {
+ 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) {
+ HDputs("Testing with latest format for destination file:");
+ dst_fapl = fapl2;
+ } /* end if */
+ else {
+ HDputs("Testing with oldest file format for destination file:");
+ dst_fapl = fapl;
+ } /* end else */
+
+ /* The tests... */
+ nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl,
+ H5O_COPY_EXPAND_REFERENCE_FLAG,
+ FALSE, "H5Ocopy(): expand object reference");
+ } /* end for */
+
+ /* Reset file token checking info */
+ token_reset();
+
+ /* Verify symbol table messages are cached */
+ nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+
+ /* Results */
+ if(nerrors) {
+ HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n",
+ nerrors, (1 == nerrors ? "" : "S"));
+ HDexit(EXIT_FAILURE);
+ } /* end if */
+
+ HDputs ("All object copying tests passed.");
+
+ /* close property list.
+ * NOTE: if this property list is not closed and the test is
+ * run with the split or multi driver, an interesting
+ * problem is exposed in the property list shutdown code.
+ *
+ * Namely, since the split/multi driver copies property
+ * lists for internal use, there's a (high) chance that
+ * leaving the FAPL open and having the library's shutdown
+ * code close it will cause the underlying property lists
+ * to be cleaned up first, causing the actual property list
+ * close operation to fail (since it won't be able to close
+ * the already closed underlying property list).
+ *
+ * The could be addressed by converting the split/multi to
+ * use non-public API routines, or putting some way into the
+ * public H5I routines to indicate ordering at shutdown.
+ *
+ * For now, we just make certain to close the property list.
+ * (QAK - 2016/04/06)
+ *
+ */
+ H5Pclose(fapl2);
+
+ h5_cleanup(FILENAME, fapl);
+
+ HDexit(EXIT_SUCCESS);
+
+error:
+ HDexit(EXIT_FAILURE);
+} /* main */
+
diff --git a/test/ohdr.c b/test/ohdr.c
index faec835..ad76576 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -15,32 +15,43 @@
* Tuesday, November 24, 1998
*/
#include "h5test.h"
-#include "H5Iprivate.h"
+
+#include "H5CXprivate.h" /* API Contexts */
+#include "H5Iprivate.h" /* Identifiers */
+#include "H5VLprivate.h" /* Virtual Object Layer */
/*
* This file needs to access private datatypes from the H5O package.
* This file also needs to access the object header testing code.
*/
-#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_FRIEND /* suppress error about including H5Opkg */
#define H5O_TESTING
#include "H5Opkg.h"
/*
* This file needs to access private datatypes from the H5G package.
*/
-#define H5G_FRIEND /*suppress error about including H5Gpkg */
+#define H5G_FRIEND /* suppress error about including H5Gpkg */
#include "H5Gpkg.h"
const char *FILENAME[] = {
"ohdr",
+ "ohdr_min_a",
+ "ohdr_min_b",
NULL
};
+/* used for object header size comparison */
+#define EQ 1
+#define LT 2
+#define GT 3
+
/* The tbogus.h5 is generated from gen_bogus.c in HDF5 'test' directory.
* To get this data file, define H5O_ENABLE_BOGUS in src/H5Oprivate, rebuild
* the library and simply compile gen_bogus.c with that HDF5 library and run it.
*/
-#define FILE_BOGUS "tbogus.h5"
+#define FILE_BOGUS "tbogus.h5"
+#define TESTFILE_LEN 256
/* */
#define FILE_OHDR_SWMR "ohdr_swmr.h5"
@@ -49,24 +60,24 @@ const char *FILENAME[] = {
/*
* Verify that messages are moved forward into a "continuation message":
- * Create an object header with several continuation chunks
- * Remove a message in the last chunk
- * The remaining message(s) in the last chunk should be moved forward into the continuation message
- * The process will repeat when the continuation message is big enough to hold all the
- * messages in the last chunk.
- * Result: the number of chunks should be reduced
+ * Create an object header with several continuation chunks
+ * Remove a message in the last chunk
+ * The remaining message(s) in the last chunk should be moved forward into the continuation message
+ * The process will repeat when the continuation message is big enough to hold all the
+ * messages in the last chunk.
+ * Result: the number of chunks should be reduced
*/
static herr_t
test_cont(char *filename, hid_t fapl)
{
- hid_t file=-1;
- H5F_t *f = NULL;
+ hid_t file=-1;
+ H5F_t *f = NULL;
H5O_hdr_info_t hdr_info;
- H5O_loc_t oh_locA, oh_locB;
- time_t time_new;
- const char *short_name = "T";
- const char *long_name = "This is the message";
- size_t nchunks;
+ H5O_loc_t oh_locA, oh_locB;
+ time_t time_new;
+ const char *short_name = "T";
+ const char *long_name = "This is the message";
+ size_t nchunks;
TESTING("object header continuation block");
@@ -76,7 +87,7 @@ test_cont(char *filename, hid_t fapl)
/* Create the file to operate on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if (H5AC_ignore_tags(f) < 0) {
H5_FAILED();
@@ -84,51 +95,51 @@ test_cont(char *filename, hid_t fapl)
goto error;
} /* end if */
- if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0)
+ if(H5O_create(f, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locA/*out*/) < 0)
FAIL_STACK_ERROR
- if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locB/*out*/) < 0)
+ if(H5O_create(f, (size_t)H5O_MIN_SIZE, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_locB/*out*/) < 0)
FAIL_STACK_ERROR
time_new = 11111111;
- if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &long_name) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locA, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locB, H5O_MTIME_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_locA, H5O_NAME_ID, 0, 0, &short_name) < 0)
FAIL_STACK_ERROR
- if(1 != H5O_link(&oh_locA, 1, H5AC_ind_read_dxpl_id))
+ if(1 != H5O_link(&oh_locA, 1))
FAIL_STACK_ERROR
- if(1 != H5O_link(&oh_locB, 1, H5AC_ind_read_dxpl_id))
+ if(1 != H5O_link(&oh_locB, 1))
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0)
+ if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5O_expunge_chunks_test(&oh_locA, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O__expunge_chunks_test(&oh_locA) < 0)
FAIL_STACK_ERROR
- if(H5O_get_hdr_info(&oh_locA, H5AC_ind_read_dxpl_id, &hdr_info) < 0)
+ if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0)
FAIL_STACK_ERROR
nchunks = hdr_info.nchunks;
/* remove the 1st H5O_NAME_ID message */
- if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_remove(&oh_locA, H5O_NAME_ID, 0, FALSE) < 0)
FAIL_STACK_ERROR
- if(H5O_get_hdr_info(&oh_locA, H5AC_ind_read_dxpl_id, &hdr_info) < 0)
+ if(H5O_get_hdr_info(&oh_locA, &hdr_info) < 0)
FAIL_STACK_ERROR
if(hdr_info.nchunks >= nchunks)
@@ -143,7 +154,6 @@ test_cont(char *filename, hid_t fapl)
PASSED();
-
return SUCCEED;
error:
@@ -167,15 +177,14 @@ error:
static herr_t
test_ohdr_cache(char *filename, hid_t fapl)
{
- hid_t file = -1; /* File ID */
+ hid_t file = -1; /* File ID */
hid_t my_fapl; /* FAPL ID */
- hid_t my_dxpl; /* DXPL ID */
H5AC_cache_config_t mdc_config; /* Metadata cache configuration info */
- H5F_t *f = NULL; /* File handle */
+ H5F_t *f = NULL; /* File handle */
H5HL_t *lheap, *lheap2, *lheap3; /* Pointer to local heaps */
haddr_t lheap_addr, lheap_addr2, lheap_addr3; /* Local heap addresses */
- H5O_loc_t oh_loc; /* Object header location */
- time_t time_new; /* Time value for modification time message */
+ H5O_loc_t oh_loc; /* Object header location */
+ time_t time_new; /* Time value for modification time message */
unsigned rc; /* Refcount for object */
TESTING("object header creation in cache");
@@ -195,46 +204,42 @@ test_ohdr_cache(char *filename, hid_t fapl)
if(H5Pset_mdc_config(my_fapl, &mdc_config) < 0)
FAIL_STACK_ERROR
- /* Make a copy of the default DXPL */
- if((my_dxpl = H5Pcopy(H5AC_ind_read_dxpl_id)) < 0)
- FAIL_STACK_ERROR
-
/* Create the file to operate on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
FAIL_STACK_ERROR
if(H5Pclose(my_fapl) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if(H5AC_ignore_tags(f) < 0)
FAIL_STACK_ERROR
/* Create object (local heap) that occupies most of cache */
- if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr) < 0)
+ if(H5HL_create(f, (31 * 1024), &lheap_addr) < 0)
FAIL_STACK_ERROR
/* Protect local heap (which actually pins it in the cache) */
- if(NULL == (lheap = H5HL_protect(f, my_dxpl, lheap_addr, H5AC__READ_ONLY_FLAG)))
+ if(NULL == (lheap = H5HL_protect(f, lheap_addr, H5AC__READ_ONLY_FLAG)))
FAIL_STACK_ERROR
/* Create an object header */
HDmemset(&oh_loc, 0, sizeof(oh_loc));
- if(H5O_create(f, my_dxpl, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0)
+ if(H5O_create(f, (size_t)2048, (size_t)1, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0)
FAIL_STACK_ERROR
/* Query object header information */
rc = 0;
- if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0)
+ if(H5O__get_rc_test(&oh_loc, &rc) < 0)
FAIL_STACK_ERROR
if(0 != rc)
TEST_ERROR
/* Create object (local heap) that occupies most of cache */
- if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr2) < 0)
+ if(H5HL_create(f, (31 * 1024), &lheap_addr2) < 0)
FAIL_STACK_ERROR
/* Protect local heap (which actually pins it in the cache) */
- if(NULL == (lheap2 = H5HL_protect(f, my_dxpl, lheap_addr2, H5AC__READ_ONLY_FLAG)))
+ if(NULL == (lheap2 = H5HL_protect(f, lheap_addr2, H5AC__READ_ONLY_FLAG)))
FAIL_STACK_ERROR
/* Unprotect local heap (which actually unpins it from the cache) */
@@ -243,15 +248,15 @@ test_ohdr_cache(char *filename, hid_t fapl)
/* Create object header message in new object header */
time_new = 11111111;
- if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, my_dxpl) < 0)
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
/* Create object (local heap) that occupies most of cache */
- if(H5HL_create(f, my_dxpl, (31 * 1024), &lheap_addr3) < 0)
+ if(H5HL_create(f, (31 * 1024), &lheap_addr3) < 0)
FAIL_STACK_ERROR
/* Protect local heap (which actually pins it in the cache) */
- if(NULL == (lheap3 = H5HL_protect(f, my_dxpl, lheap_addr3, H5AC__READ_ONLY_FLAG)))
+ if(NULL == (lheap3 = H5HL_protect(f, lheap_addr3, H5AC__READ_ONLY_FLAG)))
FAIL_STACK_ERROR
/* Unprotect local heap (which actually unpins it from the cache) */
@@ -265,13 +270,13 @@ test_ohdr_cache(char *filename, hid_t fapl)
* a non-invasive way -QAK)
*/
rc = 0;
- if(H5O_get_rc(&oh_loc, my_dxpl, &rc) < 0)
+ if(H5O__get_rc_test(&oh_loc, &rc) < 0)
FAIL_STACK_ERROR
if(0 != rc)
TEST_ERROR
/* Decrement reference count o object header */
- if(H5O_dec_rc_by_loc(&oh_loc, my_dxpl) < 0)
+ if(H5O_dec_rc_by_loc(&oh_loc) < 0)
FAIL_STACK_ERROR
/* Close object header created */
@@ -282,8 +287,6 @@ test_ohdr_cache(char *filename, hid_t fapl)
if(H5HL_unprotect(lheap) < 0)
FAIL_STACK_ERROR
- if(H5Pclose(my_dxpl) < 0)
- FAIL_STACK_ERROR
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
@@ -309,17 +312,17 @@ error:
static herr_t
test_ohdr_swmr(hbool_t new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t fapl = -1; /* File access property list */
- hid_t did = -1; /* Dataset ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t plist = -1; /* Dataset creation property list */
- size_t compact_size = 1024; /* The size of compact dataset */
- int *wbuf = NULL; /* Buffer for writing */
- hsize_t dims[1]; /* Dimension sizes */
- size_t u; /* Iterator */
- int n; /* Data variable */
- H5O_info_t obj_info; /* Information for the object */
+ hid_t fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list */
+ hid_t did = -1; /* Dataset ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t plist = -1; /* Dataset creation property list */
+ size_t compact_size = 1024; /* The size of compact dataset */
+ int *wbuf = NULL; /* Buffer for writing */
+ hsize_t dims[1]; /* Dimension sizes */
+ size_t u; /* Iterator */
+ int n; /* Data variable */
+ H5O_native_info_t ninfo; /* Information for the object */
if(new_format) {
TESTING("exercise the coding for the re-read of the object header for SWMR access: latest-format");
@@ -355,7 +358,7 @@ test_ohdr_swmr(hbool_t new_format)
dims[0] = (hsize_t)compact_size;
if((sid = H5Screate_simple(1, dims, NULL)) < 0)
FAIL_STACK_ERROR
-
+
/* Create property list for compact dataset creation */
if((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
@@ -389,15 +392,16 @@ test_ohdr_swmr(hbool_t new_format)
FAIL_STACK_ERROR
/* Get the object information */
- if(H5Oget_info(did, &obj_info) < 0)
+ if(H5Oget_native_info(did, &ninfo, H5O_NATIVE_INFO_HDR) < 0)
FAIL_STACK_ERROR
- if(obj_info.hdr.version != OBJ_VERSION_LATEST)
- FAIL_STACK_ERROR
+ if(new_format)
+ if(ninfo.hdr.version != OBJ_VERSION_LATEST)
+ FAIL_STACK_ERROR
/* The size of object header should be greater than the speculative read size of H5O_SPEC_READ_SIZE */
/* This will exercise the coding for the re-read of the object header for SWMR access */
- if(obj_info.hdr.space.total < H5O_SPEC_READ_SIZE)
+ if(ninfo.hdr.space.total < H5O_SPEC_READ_SIZE)
TEST_ERROR;
/* Close the dataset */
@@ -447,10 +451,10 @@ error:
/*
* To test objects with unknown messages in a file with:
- * a) H5O_BOGUS_VALID_ID:
- * --the bogus_id is within the range of H5O_msg_class_g[]
- * b) H5O_BOGUS_INVALID_ID:
- * --the bogus_id is outside the range of H5O_msg_class_g[]
+ * a) H5O_BOGUS_VALID_ID:
+ * --the bogus_id is within the range of H5O_msg_class_g[]
+ * b) H5O_BOGUS_INVALID_ID:
+ * --the bogus_id is outside the range of H5O_msg_class_g[]
*
* The test file is FILE_BOGUS: "tbogus.h5" generated with gen_bogus.c
* --objects that have unknown header messages with H5O_BOGUS_VALID_ID in "/"
@@ -461,22 +465,22 @@ error:
static herr_t
test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
{
- hid_t fid = -1; /* file ID */
- hid_t gid = -1; /* group ID */
- hid_t did = -1; /* Dataset ID */
+ hid_t fid = -1; /* file ID */
+ hid_t gid = -1; /* group ID */
+ hid_t did = -1; /* Dataset ID */
hid_t sid = -1; /* Dataspace ID */
hid_t aid = -1; /* Attribute ID */
- hid_t loc = -1; /* location: file or group ID */
- hid_t fid_bogus = -1; /* bogus file ID */
- hid_t gid_bogus = -1; /* bogus group ID */
- hid_t loc_bogus = -1; /* location: bogus file or group ID */
- char testfile[256];
+ hid_t loc = -1; /* location: file or group ID */
+ hid_t fid_bogus = -1; /* bogus file ID */
+ hid_t gid_bogus = -1; /* bogus group ID */
+ hid_t loc_bogus = -1; /* location: bogus file or group ID */
+ char testfile[TESTFILE_LEN];
/* create a different name for a local copy of the data file to be
opened with rd/wr file permissions in case build and test are
done in the source directory. */
- HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS));
- testfile[strlen(FILE_BOGUS)]='\0';
+ HDstrncpy(testfile, FILE_BOGUS, TESTFILE_LEN);
+ testfile[TESTFILE_LEN - 1]='\0';
HDstrncat(testfile, ".copy", 5);
/* Make a copy of the data file from svn. */
@@ -490,13 +494,13 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Open FILE_BOGUS */
- if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ if((fid_bogus = H5Fopen(testfile, H5F_ACC_RDONLY, fapl)) < 0)
FAIL_STACK_ERROR
/* Set up location ID depending on bogus_id */
if(bogus_id == H5O_BOGUS_INVALID_ID) {
/* Open "group" in FILE_BOGUS */
- if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0)
+ if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
loc_bogus = gid_bogus;
@@ -518,6 +522,16 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
PASSED();
+ TESTING("object with unknown header message & 'shareable' flag set");
+
+ /* Open the dataset with the unknown header message, adn "shareable" flag */
+ if((did = H5Dopen2(loc_bogus, "Dataset5", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if(H5Dclose(did) < 0)
+ FAIL_STACK_ERROR
+
+ PASSED();
+
TESTING("object in r/o file with unknown header message & 'fail if unknown and open for write' flag set");
/* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */
@@ -561,7 +575,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* Set up location ID depending on bogus_id */
if(bogus_id == H5O_BOGUS_INVALID_ID) {
/* Open "group" in filename */
- if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
loc = gid;
} else
@@ -572,7 +586,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Check that the "unknown" message was _NOT_ marked */
- if(H5O_check_msg_marked_test(did, FALSE) < 0)
+ if(H5O__check_msg_marked_test(did, FALSE) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
@@ -595,7 +609,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* Set up location ID depending on bogus_id */
if(bogus_id == H5O_BOGUS_INVALID_ID) {
/* Open "group" in filename */
- if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
loc = gid;
} else
@@ -641,7 +655,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* Set up location ID depending on bogus_id */
if(bogus_id == H5O_BOGUS_INVALID_ID) {
/* Open "group" in filename */
- if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
loc = gid;
} else
@@ -652,14 +666,14 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
FAIL_STACK_ERROR
/* Check that the "unknown" message was marked */
- if(H5O_check_msg_marked_test(did, TRUE) < 0)
+ if(H5O__check_msg_marked_test(did, TRUE) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
if(H5Dclose(did) < 0)
FAIL_STACK_ERROR
- /* Closing: filename */
+ /* Closing: filename */
if(bogus_id == H5O_BOGUS_INVALID_ID)
if(H5Gclose(gid) < 0)
FAIL_STACK_ERROR
@@ -684,7 +698,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* Set up location ID */
if(bogus_id == H5O_BOGUS_INVALID_ID) {
/* Open "group" in FILE_BOGUS */
- if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0)
+ if((gid_bogus = H5Gopen2(fid_bogus, "group", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
loc_bogus = gid_bogus;
} else
@@ -715,7 +729,7 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl)
/* Closing: FILE_BOGUS */
if(bogus_id == H5O_BOGUS_INVALID_ID)
if(H5Gclose(gid_bogus) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
if(H5Fclose(fid_bogus) < 0)
FAIL_STACK_ERROR
@@ -737,16 +751,844 @@ error:
return FAIL;
} /* test_unknown() */
+/*
+ * Count the number of attributes attached to an object.
+ * Returns negative in event of error.
+ */
+static int
+count_attributes(hid_t dset_id)
+{
+ H5O_info2_t info;
+
+ if(H5Oget_info3(dset_id, &info, H5O_INFO_NUM_ATTRS) < 0)
+ return -1;
+ else
+ return (int)info.num_attrs; /* should never exceed int bounds */
+} /* count_attributes */
+
+/*
+ * Get the total space used by the object header.
+ * Used by oh_compare()
+ * On success, stores size in `size_out` pointer.
+ */
+static herr_t
+_oh_getsize(hid_t did, hsize_t *size_out)
+{
+ H5O_native_info_t ninfo;
+
+ if(FAIL == H5Oget_native_info(did, &ninfo, H5O_NATIVE_INFO_HDR))
+ return FAIL;
+
+ *size_out = ninfo.hdr.space.total;
+
+ return SUCCEED;
+} /* _oh_getsize */
+
+/*
+ * Compare the TOTAL space used by datasets' object headers.
+ * Returns negative value if an error occurred,
+ * else positive #defined indicator value EQ, LT, GT.
+ */
+static int
+oh_compare(hid_t did1, hid_t did2)
+{
+ hsize_t space1 = 0;
+ hsize_t space2 = 0;
+
+ if(FAIL == _oh_getsize(did1, &space1))
+ return -1;
+ if(FAIL == _oh_getsize(did2, &space2))
+ return -2;
+
+ if(space1 < space2)
+ return LT;
+ else if(space1 > space2)
+ return GT;
+ else
+ return EQ;
+} /* oh_compare() */
+
+/*
+ * Demonstrate attribute addition to datasets.
+ * Conduct additions side-by-side with a standard datataset and one with
+ * minimized dataset object headers.
+ */
+#define ATTR_NAME_MAX 64
+#define ATTR_SHORT "first"
+#define ATTR_LONG "second"
+#define N_ATTRS 64
+static herr_t
+test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id)
+{
+ hsize_t dims[1] = {0}; /* dataspace extent */
+ char filename[512] = "";
+ char attr_name[ATTR_NAME_MAX] = "";
+ hid_t fid = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t aid = H5I_INVALID_HID;
+ char *in_buf = NULL;
+ char *out_buf = NULL;
+ size_t buf_size = 0;
+ int out_val = 0;
+ int in_val = 0;
+ int i;
+
+ TESTING("adding attributes to datasets created with H5Pset_dset_no_attrs_hint()")
+
+ /* Create the test file */
+ if(NULL == h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)))
+ TEST_ERROR;
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Set the 'no attrs' hint on the dcpl */
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) == H5I_INVALID_HID)
+ TEST_ERROR;
+ if(H5Pset_dset_no_attrs_hint(dcpl_id, TRUE) < 0)
+ TEST_ERROR;
+
+ /* The dataset doesn't need to contain data */
+ dims[0] = 0;
+ if((sid = H5Screate_simple(1, dims, NULL)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Create the dataset */
+ if((did = H5Dcreate2(fid, "H5Pset_dset_no_attrs_hint", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Close */
+ if(H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /**********************************************
+ * ADD A (STRING) ATTRIBUTE AND MANIPULATE IT *
+ **********************************************/
+
+ buf_size = HDstrlen(ATTR_LONG) + 1;
+ if(NULL == (in_buf = (char *)HDcalloc(buf_size, sizeof(char))))
+ TEST_ERROR;
+ if(NULL == (out_buf = (char *)HDcalloc(buf_size, sizeof(char))))
+ TEST_ERROR;
+
+ /* Create a string attribute on the dataset
+ *
+ * It has to be long enough to hold the longest string we're going to write
+ * to it.
+ */
+ dims[0] = buf_size;
+ if((sid = H5Screate_simple(1, dims, NULL)) == H5I_INVALID_HID)
+ TEST_ERROR;
+ if((aid = H5Acreate2(did, "string_attr", H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Write attribute data */
+ HDstrcpy(in_buf, ATTR_SHORT);
+ if(H5Awrite(aid, H5T_NATIVE_CHAR, in_buf) < 0)
+ TEST_ERROR;
+
+ /* Make sure the count is correct */
+ if(count_attributes(did) != 1)
+ TEST_ERROR;
+
+ /* Read the data back and verify */
+ if(H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0)
+ TEST_ERROR;
+ if(HDstrcmp(in_buf, out_buf))
+ TEST_ERROR;
+
+ /* modify the string attribute */
+ HDmemset(in_buf, 0, buf_size);
+ HDstrcpy(in_buf, ATTR_LONG);
+ if(H5Awrite(aid, H5T_NATIVE_CHAR, in_buf) < 0)
+ TEST_ERROR;
+
+ if(count_attributes(did) != 1)
+ TEST_ERROR;
+
+ /* Read the data back and verify */
+ if(H5Aread(aid, H5T_NATIVE_CHAR, out_buf) < 0)
+ TEST_ERROR;
+ if(HDstrcmp(in_buf, out_buf))
+ TEST_ERROR;
+
+ /* Close */
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if(H5Aclose(aid) < 0)
+ TEST_ERROR;
+
+ /***************************************
+ * ADD A BUNCH OF (INTEGER) ATTRIBUTES *
+ ***************************************/
+
+ if((sid = H5Screate(H5S_SCALAR)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Loop over a reasonable number of attributes */
+ for(i = 0; i < N_ATTRS; i++) {
+
+ /* Set the attribute's name */
+ if(HDsnprintf(attr_name, ATTR_NAME_MAX, "int_attr_%d", i) < 0)
+ TEST_ERROR;
+
+ /* Create an integer attribute on the dataset */
+ if((aid = H5Acreate2(did, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Write attribute data */
+ in_val = i;
+ if(H5Awrite(aid, H5T_NATIVE_INT, &in_val) < 0)
+ TEST_ERROR;
+
+ /* Make sure the count is correct (already has one attribute) */
+ if(count_attributes(did) != i + 2)
+ TEST_ERROR;
+
+ /* Read the data back and verify */
+ if(H5Aread(aid, H5T_NATIVE_INT, &out_val) < 0)
+ TEST_ERROR;
+ if(in_val != out_val)
+ TEST_ERROR;
+
+ /* Close */
+ if(H5Aclose(aid) < 0)
+ TEST_ERROR;
+ }
+
+ /* Close */
+ if(H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /* Close the remaining IDs */
+ if(H5Dclose(did) < 0)
+ TEST_ERROR;
+ if(H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* Free memory */
+ HDfree(in_buf);
+ HDfree(out_buf);
+
+ PASSED();
+ return SUCCEED;
+
+error :
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(dcpl_id);
+ (void)H5Sclose(sid);
+ (void)H5Dclose(did);
+ (void)H5Aclose(aid);
+ (void)H5Fclose(fid);
+ } H5E_END_TRY;
+
+ HDfree(in_buf);
+ HDfree(out_buf);
+
+ return FAIL;
+} /* test_minimized_dset_ohdr_attribute_addition */
+
+/*
+ * Compare header sizes against when headers have been minimized.
+ * Repeats tests with headers "compact" and normal.
+ */
+static herr_t
+test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id)
+{
+ hsize_t array_10[1] = {10}; /* dataspace extents */
+ unsigned compact = 0;
+
+ /* IDs that are file-agnostic */
+ hid_t dspace_id = -1;
+ hid_t int_type_id = -1;
+ hid_t dcpl_minimize = -1;
+ hid_t dcpl_dontmin = -1;
+ hid_t dcpl_default = -1;
+
+ /* IDs for non-minimized file open */
+ hid_t file_f_id = -1; /* lower 'f' for standard file setting */
+ hid_t dset_f_x_id = -1; /* 'x' for default */
+ hid_t dset_f_N_id = -1; /* 'N' for explcit non-minimized dset */
+ hid_t dset_f_Y_id = -1; /* 'Y' for minimized dset */
+
+ /* IDs for minimized file open */
+ hid_t file_F_id = -1; /* upper 'F' for minimized file setting */
+ hid_t dset_F_x_id = -1; /* 'x' for default */
+ hid_t dset_F_N_id = -1; /* 'N' for explcit non-minimized dset */
+ hid_t dset_F_Y_id = -1; /* 'Y' for minimized dset */
+
+ char filename_a[512] = "";
+ char filename_b[512] = "";
+
+ herr_t ret;
+
+ /* dataset suffixes:
+ * | default | minimize | don't minimize (dcpl-set)
+ * ---------------+---------+----------+---------------
+ * file-default | f_x | f_Y | f_N
+ * ---------------+---------+----------+---------------
+ * file-minimized | F_x | F_Y | F_N
+ */
+
+
+ /*********
+ * SETUP *
+ *********/
+
+ /* Set filenames (not in a test, can't use TEST_ERROR) */
+ if(h5_fixname(FILENAME[1], fapl_id, filename_a, sizeof(filename_a)) == NULL)
+ return FAIL;
+ if(h5_fixname(FILENAME[2], fapl_id, filename_b, sizeof(filename_b)) == NULL)
+ return FAIL;
+
+ for (compact = 0; compact < 2; compact++) { /* 0 or 1 */
+
+ if(compact)
+ TESTING("minimized dset object headers size comparisons (compact)")
+ else
+ TESTING("minimized dset object headers size comparisons")
+
+ dcpl_default = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_default < 0) TEST_ERROR
+
+ dcpl_minimize = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_minimize < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_minimize, TRUE);
+ if(ret < 0) TEST_ERROR
+
+ dcpl_dontmin = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_dontmin < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_dontmin, FALSE);
+ if(ret < 0) TEST_ERROR
+
+ if(compact) {
+ ret = H5Pset_layout(dcpl_default, H5D_COMPACT);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_layout(dcpl_minimize, H5D_COMPACT);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_layout(dcpl_dontmin, H5D_COMPACT);
+ if(ret < 0) TEST_ERROR
+ }
+
+ dspace_id = H5Screate_simple(1, array_10, NULL);
+ if(dspace_id < 0) TEST_ERROR
+
+ int_type_id = H5Tcopy(H5T_NATIVE_INT);
+ if(int_type_id < 0) TEST_ERROR
+
+ file_f_id = H5Fcreate(filename_a, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if(file_f_id < 0) TEST_ERROR
+
+ dset_f_x_id = H5Dcreate2(file_f_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
+ if(dset_f_x_id < 0) TEST_ERROR
+
+ dset_f_N_id = H5Dcreate2(file_f_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
+ if(dset_f_N_id < 0) TEST_ERROR
+
+ dset_f_Y_id = H5Dcreate2(file_f_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
+ if(dset_f_x_id < 0) TEST_ERROR
+
+ file_F_id = H5Fcreate(filename_b, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if(file_F_id < 0) TEST_ERROR
+ ret = H5Fset_dset_no_attrs_hint(file_F_id, TRUE);
+ if(ret < 0) TEST_ERROR
+
+ dset_F_x_id = H5Dcreate2(file_F_id, "default", int_type_id, dspace_id, H5P_DEFAULT, dcpl_default, H5P_DEFAULT);
+ if(dset_F_x_id < 0) TEST_ERROR
+
+ dset_F_N_id = H5Dcreate2(file_F_id, "dsetNOT", int_type_id, dspace_id, H5P_DEFAULT, dcpl_dontmin, H5P_DEFAULT);
+ if(dset_F_N_id < 0) TEST_ERROR
+
+ dset_F_Y_id = H5Dcreate2(file_F_id, "dsetMIN", int_type_id, dspace_id, H5P_DEFAULT, dcpl_minimize, H5P_DEFAULT);
+ if(dset_F_Y_id < 0) TEST_ERROR
+
+ /*********
+ * TESTS *
+ *********/
+
+ if(oh_compare(dset_f_x_id, dset_f_x_id) != EQ) TEST_ERROR /* identity */
+
+ if(oh_compare(dset_f_x_id, dset_f_N_id) != EQ) TEST_ERROR
+ if(oh_compare(dset_f_x_id, dset_f_Y_id) != GT) TEST_ERROR
+ if(oh_compare(dset_f_N_id, dset_f_Y_id) != GT) TEST_ERROR
+
+ if(oh_compare(dset_F_x_id, dset_F_N_id) != EQ) TEST_ERROR
+ if(oh_compare(dset_F_x_id, dset_F_Y_id) != EQ) TEST_ERROR
+ if(oh_compare(dset_F_N_id, dset_F_Y_id) != EQ) TEST_ERROR
+
+ if(oh_compare(dset_F_x_id, dset_f_Y_id) != EQ) TEST_ERROR
+ if(oh_compare(dset_F_x_id, dset_f_x_id) != LT) TEST_ERROR
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ if(H5Sclose(dspace_id) < 0) TEST_ERROR
+ if(H5Tclose(int_type_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_default) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_minimize) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_dontmin) < 0) TEST_ERROR
+
+ if(H5Fclose(file_f_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_f_x_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_f_N_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_f_Y_id) < 0) TEST_ERROR
+
+ if(H5Fclose(file_F_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_F_x_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_F_N_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_F_Y_id) < 0) TEST_ERROR
+
+ PASSED();
+
+ } /* compact and non-compact */
+
+ return SUCCEED;
+
+error :
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(dcpl_default);
+ (void)H5Pclose(dcpl_minimize);
+ (void)H5Pclose(dcpl_dontmin);
+ (void)H5Sclose(dspace_id);
+ (void)H5Tclose(int_type_id);
+
+ (void)H5Fclose(file_f_id);
+ (void)H5Dclose(dset_f_x_id);
+ (void)H5Dclose(dset_f_N_id);
+ (void)H5Dclose(dset_f_Y_id);
+
+ (void)H5Fclose(file_F_id);
+ (void)H5Dclose(dset_F_x_id);
+ (void)H5Dclose(dset_F_N_id);
+ (void)H5Dclose(dset_F_Y_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* test_minimized_dset_ohdr_size_comparisons */
+
+/*
+ * Test minimized dataset object header with filter/pipeline message
+ */
+static herr_t
+test_minimized_dset_ohdr_with_filter(hid_t fapl_id)
+{
+ char filename[512] = "";
+ const hsize_t extents[1] = {1024}; /* extents of dataspace */
+ const unsigned filter_values[] = {0}; /* TBD */
+ const hsize_t chunk_dim[] = {32}; /* needed for filter */
+ const int ndims = 1;
+ hid_t dspace_id = -1;
+ hid_t dtype_id = -1;
+ hid_t dcpl_xZ_id = -1;
+ hid_t dcpl_mx_id = -1;
+ hid_t dcpl_mZ_id = -1;
+ hid_t dset_xx_id = -1;
+ hid_t dset_xZ_id = -1;
+ hid_t dset_mx_id = -1;
+ hid_t dset_mZ_id = -1;
+ hid_t file_id = -1;
+ herr_t ret;
+
+ /* dcpl suffixes:
+ * | default | minimize
+ * ----------+---------+---------
+ * no filter | xx | mx
+ * ----------+---------+---------
+ * filter | xZ | mZ
+ */
+
+ TESTING("minimized dset object headers with filter message");
+
+ /*********
+ * SETUP *
+ *********/
+
+ if(h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)) == NULL)
+ TEST_ERROR
+
+ dcpl_mx_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_mx_id < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_mx_id, TRUE);
+ if(ret < 0) TEST_ERROR
+
+ dcpl_xZ_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_xZ_id < 0) TEST_ERROR
+ ret = H5Pset_chunk(dcpl_xZ_id, ndims, chunk_dim);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_filter(dcpl_xZ_id, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, 0, filter_values);
+ if(ret < 0) TEST_ERROR
+ dcpl_mZ_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_mZ_id < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_mZ_id, TRUE);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_chunk(dcpl_mZ_id, ndims, chunk_dim);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_filter( dcpl_mZ_id, H5Z_FILTER_DEFLATE, H5Z_FLAG_OPTIONAL, 0, filter_values);
+ if(ret < 0) TEST_ERROR
+
+ dspace_id = H5Screate_simple(1, extents, extents);
+ if(dspace_id < 0) TEST_ERROR
+
+ dtype_id = H5Tcopy(H5T_NATIVE_INT);
+ if(dtype_id < 0) TEST_ERROR
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if(file_id < 0) TEST_ERROR
+
+ dset_xx_id = H5Dcreate2(file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_xx_id < 0) TEST_ERROR
+
+ dset_mx_id = H5Dcreate2(file_id, "Mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
+ if(dset_mx_id < 0) TEST_ERROR
+
+ dset_xZ_id = H5Dcreate2(file_id, "xZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xZ_id, H5P_DEFAULT);
+ if(dset_xZ_id < 0) TEST_ERROR
+
+ dset_mZ_id = H5Dcreate2(file_id, "MZ", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mZ_id, H5P_DEFAULT);
+ if(dset_mZ_id < 0) TEST_ERROR
+
+ /*********
+ * TESTS *
+ *********/
+
+ if(oh_compare(dset_mx_id, dset_xx_id) != LT) TEST_ERROR
+ if(oh_compare(dset_mx_id, dset_xZ_id) != LT) TEST_ERROR
+ if(oh_compare(dset_mZ_id, dset_mx_id) != GT) TEST_ERROR
+ if(oh_compare(dset_mZ_id, dset_xZ_id) != LT) TEST_ERROR
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ if(H5Sclose(dspace_id) < 0) TEST_ERROR
+ if(H5Tclose(dtype_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_xZ_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_mx_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_mZ_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_xx_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_xZ_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_mx_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_mZ_id) < 0) TEST_ERROR
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Sclose(dspace_id);
+ (void)H5Tclose(dtype_id);
+ (void)H5Pclose(dcpl_xZ_id);
+ (void)H5Pclose(dcpl_mx_id);
+ (void)H5Pclose(dcpl_mZ_id);
+ (void)H5Dclose(dset_xx_id);
+ (void)H5Dclose(dset_xZ_id);
+ (void)H5Dclose(dset_mx_id);
+ (void)H5Dclose(dset_mZ_id);
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* test_minimized_dset_ohdr_with_filter */
+
+/*
+ * Test minimized dataset object header and recording modification times.
+ */
+static herr_t
+test_minimized_dset_ohdr_modification_times(hid_t _fapl_id)
+{
+ /* test-local structure for parameterized testing
+ */
+ struct testcase {
+ unsigned oh_version;
+ };
+
+ char filename[512] = "";
+ const hsize_t extents[1] = {128}; /* extents of dataspace */
+ hid_t dspace_id = -1;
+ hid_t dtype_id = -1;
+ hid_t dcpl_xT_id = -1; /* Track modtime */
+ hid_t dcpl_mx_id = -1; /* minimized */
+ hid_t dcpl_mT_id = -1; /* minimized, Track */
+ hid_t dcpl_mN_id = -1; /* minimized, do Not track */
+ hid_t dset_xx_id = -1;
+ hid_t dset_xT_id = -1;
+ hid_t dset_mx_id = -1;
+ hid_t dset_mT_id = -1;
+ hid_t dset_mN_id = -1;
+ hid_t file_id = -1;
+ hid_t fapl_id = -1;
+ herr_t ret;
+
+ unsigned i = 0; /* for testcase loop */
+ unsigned n_cases = 2; /* must match `cases` array size below */
+ struct testcase cases[2] = {
+ { 1, }, /* version 1 object header */
+ { 2, }, /* version 2 object header */
+ };
+
+ /* dcpl suffixes:
+ * | default | minimize
+ * ------------+---------+---------
+ * default | xx | mx
+ * ------------+---------+---------
+ * don't track | xN | mN
+ * ------------+---------+---------
+ * track | xT | mT
+ */
+
+ TESTING("minimized dset object headers with modification times");
+
+ /*********
+ * SETUP *
+ *********/
+
+ if(h5_fixname(FILENAME[1], _fapl_id, filename, sizeof(filename)) == NULL)
+ TEST_ERROR
+
+ dcpl_mx_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_mx_id < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_mx_id, TRUE);
+ if(ret < 0) TEST_ERROR
+
+ dcpl_xT_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_xT_id < 0) TEST_ERROR
+ ret = H5Pset_obj_track_times(dcpl_xT_id, TRUE);
+ if(ret < 0) TEST_ERROR
+
+ dcpl_mT_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_mT_id < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_mT_id, TRUE);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_obj_track_times(dcpl_mT_id, TRUE);
+ if(ret < 0) TEST_ERROR
+
+ dcpl_mN_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_mN_id < 0) TEST_ERROR
+ ret = H5Pset_dset_no_attrs_hint(dcpl_mN_id, TRUE);
+ if(ret < 0) TEST_ERROR
+ ret = H5Pset_obj_track_times(dcpl_mN_id, FALSE);
+ if(ret < 0) TEST_ERROR
+
+ dspace_id = H5Screate_simple(1, extents, extents);
+ if(dspace_id < 0) TEST_ERROR
+
+ dtype_id = H5Tcopy(H5T_NATIVE_INT);
+ if(dtype_id < 0) TEST_ERROR
+
+ for (i = 0; i < n_cases; i++) {
+
+ /* -------------- *
+ * per-case setup *
+ * -------------- */
+
+ fapl_id = H5Pcopy(_fapl_id);
+ if(fapl_id < 0) TEST_ERROR
+
+ if(cases[i].oh_version > 1) {
+ ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_V110);
+ if(ret < 0) TEST_ERROR
+ }
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if(file_id < 0) TEST_ERROR
+
+ dset_xx_id = H5Dcreate2( file_id, "xx", dtype_id, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_xx_id < 0) TEST_ERROR
+
+ dset_mx_id = H5Dcreate2(file_id, "mx", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mx_id, H5P_DEFAULT);
+ if(dset_mx_id < 0) TEST_ERROR
+
+ dset_xT_id = H5Dcreate2(file_id, "xT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_xT_id, H5P_DEFAULT);
+ if(dset_xT_id < 0) TEST_ERROR
+ dset_mT_id = H5Dcreate2(file_id, "mT", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mT_id, H5P_DEFAULT);
+ if(dset_mT_id < 0) TEST_ERROR
+
+ dset_mN_id = H5Dcreate2(file_id, "mN", dtype_id, dspace_id, H5P_DEFAULT, dcpl_mN_id, H5P_DEFAULT);
+ if(dset_mN_id < 0) TEST_ERROR
+
+ /* ----- *
+ * TESTS *
+ * ----- */
+
+ /* sanity check */
+ if(oh_compare(dset_mx_id, dset_xx_id) != LT) TEST_ERROR
+ if(oh_compare(dset_mx_id, dset_xT_id) != LT) TEST_ERROR
+
+ if(oh_compare(dset_xx_id, dset_xT_id) != EQ) TEST_ERROR
+ if(oh_compare(dset_mx_id, dset_mT_id) != EQ) TEST_ERROR
+ if(oh_compare(dset_mN_id, dset_mT_id) != LT) TEST_ERROR
+
+ if(oh_compare(dset_mT_id, dset_xT_id) != LT) TEST_ERROR
+
+ /* ----------------- *
+ * per-case teardown *
+ * ----------------- */
+
+ if(H5Dclose(dset_xx_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_xT_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_mx_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_mT_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_mN_id) < 0) TEST_ERROR
+ if(H5Fclose(file_id) < 0) TEST_ERROR
+ if(H5Pclose(fapl_id) < 0) TEST_ERROR
+
+ } /* for each version tested */
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ if(H5Sclose(dspace_id) < 0) TEST_ERROR
+ if(H5Tclose(dtype_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_xT_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_mx_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_mT_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_mN_id) < 0) TEST_ERROR
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Sclose(dspace_id);
+ (void)H5Tclose(dtype_id);
+ (void)H5Pclose(dcpl_xT_id);
+ (void)H5Pclose(dcpl_mx_id);
+ (void)H5Pclose(dcpl_mT_id);
+ (void)H5Pclose(dcpl_mN_id);
+ (void)H5Dclose(dset_xx_id);
+ (void)H5Dclose(dset_xT_id);
+ (void)H5Dclose(dset_mx_id);
+ (void)H5Dclose(dset_mT_id);
+ (void)H5Dclose(dset_mN_id);
+ (void)H5Fclose(file_id);
+ (void)H5Pclose(fapl_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* test_minimized_dset_ohdr_modification_times */
+
+/*
+ * Test minimized dataset object header with a fill value set.
+ */
+static herr_t
+test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id)
+{
+ char filename[512] = "";
+ const hsize_t extents[1] = {64}; /* extents of dataspace */
+ const int fill[1] = {343}; /* fill value of dataset */
+ hid_t file_id = -1;
+ hid_t dtype_id = -1;
+ hid_t dspace_id = -1;
+ hid_t dcpl_id = -1;
+ hid_t fapl_id = -1;
+ hid_t dset_0_id = -1;
+ hid_t dset_1_id = -1;
+ herr_t ret;
+
+ /*********
+ * SETUP *
+ *********/
+
+ TESTING("minimized dset object headers with fill values and different libver support");
+
+ fapl_id = H5Pcopy(_fapl_id);
+ if(fapl_id < 0) TEST_ERROR
+
+ if(h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)) == NULL)
+ TEST_ERROR
+
+ dspace_id = H5Screate_simple(1, extents, extents);
+ if(dspace_id < 0) TEST_ERROR
+
+ dtype_id = H5Tcopy(H5T_NATIVE_INT);
+ if(dtype_id < 0) TEST_ERROR
+
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(dcpl_id < 0) TEST_ERROR
+
+ ret = H5Pset_dset_no_attrs_hint(dcpl_id, TRUE);
+ if(ret == FAIL) TEST_ERROR;
+
+ ret = H5Pset_fill_value(dcpl_id, dtype_id, fill);
+ if(ret == FAIL) TEST_ERROR;
+
+ ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST);
+ if(ret == FAIL) TEST_ERROR;
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if(file_id < 0) TEST_ERROR
+
+ dset_0_id = H5Dcreate2(file_id, "fullrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ if(dset_0_id < 0) TEST_ERROR
+
+ /* Close file and re-open with different libver bounds.
+ * Dataset "fullrange" must also be closed for expected reopen behavior.
+ */
+ if(H5Fclose(file_id) < 0) TEST_ERROR;
+ if(H5Dclose(dset_0_id) < 0) TEST_ERROR
+
+ ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_LATEST);
+ if(ret == FAIL) TEST_ERROR;
+
+ file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+ if(file_id < 0) TEST_ERROR
+
+ dset_1_id = H5Dcreate2(file_id, "upperrange", dtype_id, dspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ if(dset_1_id < 0) TEST_ERROR
+
+ /* re-open "fullrange" dataset
+ */
+ dset_0_id = H5Dopen2(file_id, "fullrange", H5P_DEFAULT);
+ if(dset_0_id < 0) TEST_ERROR
+
+ /*********
+ * TESTS *
+ *********/
+
+ /* dset not supporting pre-1.08 should be smaller? */
+ if(oh_compare(dset_1_id, dset_0_id) != LT) TEST_ERROR
+
+ /************
+ * TEARDOWN *
+ ************/
+
+ if(H5Sclose(dspace_id) < 0) TEST_ERROR
+ if(H5Tclose(dtype_id) < 0) TEST_ERROR
+ if(H5Pclose(dcpl_id) < 0) TEST_ERROR
+ if(H5Pclose(fapl_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_0_id) < 0) TEST_ERROR
+ if(H5Dclose(dset_1_id) < 0) TEST_ERROR
+ if(H5Fclose(file_id) < 0) TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Sclose(dspace_id);
+ (void)H5Tclose(dtype_id);
+ (void)H5Pclose(dcpl_id);
+ (void)H5Pclose(fapl_id);
+ (void)H5Dclose(dset_0_id);
+ (void)H5Dclose(dset_1_id);
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ return FAIL;
+} /* test_minimized_dset_ohdr_fillvalue_backwards_compatability */
+
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
* Purpose: Exercise private object header behavior and routines
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Robb Matzke
+ * Programmer: Robb Matzke
* Tuesday, November 24, 1998
*
*-------------------------------------------------------------------------
@@ -754,32 +1596,58 @@ error:
int
main(void)
{
- hid_t fapl = -1, file = -1;
- H5F_t *f = NULL;
- char filename[1024];
- H5O_hdr_info_t hdr_info; /* Object info */
- H5O_loc_t oh_loc; /* Object header locations */
- time_t time_new, ro;
- int i; /* Local index variable */
- unsigned b; /* Index for "new format" loop */
- herr_t ret; /* Generic return value */
+ hid_t fapl = -1;
+ hid_t file = -1;
+ H5F_t *f = NULL;
+ const char *env_h5_drvr; /* File driver value from environment */
+ hbool_t single_file_vfd; /* Whether VFD used stores data in a single file */
+ char filename[1024];
+ H5O_hdr_info_t hdr_info; /* Object info */
+ H5O_loc_t oh_loc; /* Object header locations */
+ H5F_libver_t low, high; /* File format bounds */
+ time_t time_new, ro;
+ int i; /* Local index variable */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
+ herr_t ret; /* Generic return value */
+
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if(env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ /* 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"));
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- /* Loop over old & new formats */
- for(b = FALSE; b <= TRUE; b++) {
- /* Display info about testing */
- if(b)
- HDputs("Using new file format:");
- else
- HDputs("Using default file format:");
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
- /* Set the format to use for the file */
- if(H5Pset_libver_bounds(fapl, (b ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST) < 0)
- FAIL_STACK_ERROR
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ const char *low_string; /* Message for library version low bound */
+ const char *high_string; /* Message for library version high bound */
+ char msg[80]; /* Message for file format version */
+
+ /* Set version bounds before opening the file */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Display info about testing */
+ low_string = h5_get_version_string(low);
+ high_string = h5_get_version_string(high);
+ HDsprintf(msg, "Using file format version: (%s, %s)", low_string,
+ high_string);
+ HDputs(msg);
/* test on object continuation block */
if(test_cont(filename, fapl) < 0)
@@ -788,7 +1656,7 @@ main(void)
/* Create the file to operate on */
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if(H5AC_ignore_tags(f) < 0) {
H5_FAILED();
@@ -802,22 +1670,22 @@ main(void)
*/
TESTING("object header creation");
HDmemset(&oh_loc, 0, sizeof(oh_loc));
- if(H5O_create(f, H5AC_ind_read_dxpl_id, (size_t)64, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0)
+ if(H5O_create(f, (size_t)64, (size_t)0, H5P_GROUP_CREATE_DEFAULT, &oh_loc/*out*/) < 0)
FAIL_STACK_ERROR
PASSED();
/* create a new message */
TESTING("message creation");
time_new = 11111111;
- if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(1 != H5O_link(&oh_loc, 1, H5AC_ind_read_dxpl_id))
+ if(1 != H5O_link(&oh_loc, 1))
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0)
+ if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
- if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id))
+ if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro))
FAIL_STACK_ERROR
if(ro != time_new)
TEST_ERROR
@@ -828,19 +1696,19 @@ main(void)
*/
TESTING("message modification");
time_new = 33333333;
- if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0)
+ if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
- if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id))
+ if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro))
FAIL_STACK_ERROR
if(ro != time_new)
TEST_ERROR
/* Make certain that chunk #0 in the object header can be encoded with a 1-byte size */
- if(H5O_get_hdr_info(&oh_loc, H5AC_ind_read_dxpl_id, &hdr_info) < 0)
+ if(H5O_get_hdr_info(&oh_loc, &hdr_info) < 0)
FAIL_STACK_ERROR
if(hdr_info.space.total >=256)
TEST_ERROR
@@ -858,16 +1726,16 @@ main(void)
TESTING("object header overflow in memory");
for(i = 0; i < 40; i++) {
time_new = (i + 1) * 1000 + 1000000;
- if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
} /* end for */
- if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0)
+ if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
/* Make certain that chunk #0 in the object header will be encoded with a 2-byte size */
- if(H5O_get_hdr_info(&oh_loc, H5AC_ind_read_dxpl_id, &hdr_info) < 0)
+ if(H5O_get_hdr_info(&oh_loc, &hdr_info) < 0)
FAIL_STACK_ERROR
if(hdr_info.space.total < 256)
TEST_ERROR
@@ -886,7 +1754,7 @@ main(void)
FAIL_STACK_ERROR
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
FAIL_STACK_ERROR
- if(NULL == (f = (H5F_t *)H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file)))
FAIL_STACK_ERROR
if (H5AC_ignore_tags(f) < 0)
FAIL_STACK_ERROR
@@ -902,11 +1770,11 @@ main(void)
TESTING("object header overflow on disk");
for(i = 0; i < 10; i++) {
time_new = (i + 1) * 1000 + 10;
- if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0)
+ if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
} /* end for */
PASSED();
@@ -915,13 +1783,13 @@ main(void)
* Delete all time messages.
*/
TESTING("message deletion");
- if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_remove(&oh_loc, H5O_MTIME_ID, H5O_ALL, TRUE) < 0)
FAIL_STACK_ERROR
- if(H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id))
+ if(H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro))
FAIL_STACK_ERROR
- if(H5O_msg_read(&oh_loc, H5O_MTIME_ID, &ro, H5AC_ind_read_dxpl_id))
+ if(H5O_msg_read(&oh_loc, H5O_MTIME_ID, &ro))
FAIL_STACK_ERROR
PASSED();
@@ -932,23 +1800,23 @@ main(void)
*/
TESTING("constant message handling");
time_new = 22222222;
- if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, &time_new) < 0)
FAIL_STACK_ERROR
- if(H5AC_flush(f, H5AC_ind_read_dxpl_id) < 0)
+ if(H5AC_flush(f) < 0)
FAIL_STACK_ERROR
- if(H5AC_expunge_entry(f, H5AC_ind_read_dxpl_id, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
+ if(H5AC_expunge_entry(f, H5AC_OHDR, oh_loc.addr, H5AC__NO_FLAGS_SET) < 0)
FAIL_STACK_ERROR
- if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro, H5AC_ind_read_dxpl_id))
+ if(NULL == H5O_msg_read(&oh_loc, H5O_MTIME_NEW_ID, &ro))
FAIL_STACK_ERROR
if(ro != time_new)
TEST_ERROR
time_new = 33333333;
H5E_BEGIN_TRY {
- ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5AC_ind_read_dxpl_id);
+ ret = H5O_msg_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new);
} H5E_END_TRY;
if(ret >= 0)
TEST_ERROR
- if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE, H5AC_ind_read_dxpl_id) < 0)
+ if(H5O_msg_remove(&oh_loc, H5O_MTIME_NEW_ID, H5O_ALL, TRUE) < 0)
FAIL_STACK_ERROR
PASSED();
@@ -967,16 +1835,45 @@ main(void)
* and the various "fail/mark if unknown" object header message flags
*/
HDputs("Accessing objects with unknown header messages: H5O_BOGUS_VALID_ID");
- if(test_unknown(H5O_BOGUS_VALID_ID, filename, fapl) < 0)
- TEST_ERROR
+ if(single_file_vfd) {
+ if(test_unknown(H5O_BOGUS_VALID_ID, filename, fapl) < 0)
+ TEST_ERROR
+ } /* end if */
+ else {
+ SKIPPED();
+ HDputs(" Unknown header message test not supported with the current VFD.");
+ } /* end else */
HDputs("Accessing objects with unknown header messages: H5O_BOGUS_INVALID_ID");
- if(test_unknown(H5O_BOGUS_INVALID_ID, filename, fapl) < 0)
- TEST_ERROR
+ if(single_file_vfd) {
+ if(test_unknown(H5O_BOGUS_INVALID_ID, filename, fapl) < 0)
+ TEST_ERROR
+ } /* end if */
+ else {
+ SKIPPED();
+ HDputs(" Unknown header message test not supported with the current VFD.");
+ } /* end else */
/* Test object header creation metadata cache issues */
if(test_ohdr_cache(filename, fapl) < 0)
TEST_ERROR
- } /* end for */
+
+ if(test_minimized_dset_ohdr_attribute_addition(fapl) < 0)
+ TEST_ERROR
+
+ if(test_minimized_dset_ohdr_size_comparisons(fapl) < 0)
+ TEST_ERROR
+
+ if(test_minimized_dset_ohdr_with_filter(fapl) < 0)
+ TEST_ERROR
+
+ if(test_minimized_dset_ohdr_modification_times(fapl) < 0)
+ TEST_ERROR
+
+ if(test_minimized_dset_ohdr_fillvalue_backwards_compatability(fapl) < 0)
+ TEST_ERROR
+
+ } /* high */
+ } /* low */
/* Verify symbol table messages are cached */
if(h5_verify_cached_stabs(FILENAME, fapl) < 0) TEST_ERROR
@@ -985,16 +1882,22 @@ main(void)
if(test_ohdr_swmr(TRUE) < 0) TEST_ERROR
if(test_ohdr_swmr(FALSE) < 0) TEST_ERROR
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
HDputs("All object header tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Fclose(file);
} H5E_END_TRY;
+ if(api_ctx_pushed) H5CX_pop();
+
return 1;
} /* end main() */
diff --git a/test/page_buffer.c b/test/page_buffer.c
index 853ef93..a508dc9 100644
--- a/test/page_buffer.c
+++ b/test/page_buffer.c
@@ -21,8 +21,10 @@
#include "h5test.h"
-#include "H5PBprivate.h"
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Iprivate.h"
+#include "H5PBprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/*
* This file needs to access private information from the H5F package.
@@ -35,24 +37,26 @@
#include "H5Fpkg.h"
-#define FILENAME_LEN 1024
+#define FILENAME_LEN 1024
+
+/* test routines */
+#ifdef H5_HAVE_PARALLEL
+static unsigned verify_page_buffering_disabled(hid_t orig_fapl,
+ const char *env_h5_drvr);
+#else
#define NUM_DSETS 5
#define NX 100
#define NY 50
-/* helper routines */
-static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl);
-static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size);
-
-/* test routines */
static unsigned test_args(hid_t fapl, const char *env_h5_drvr);
static unsigned test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr);
static unsigned test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr);
static unsigned test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr);
static unsigned test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr);
-#ifdef H5_HAVE_PARALLEL
-static unsigned verify_page_buffering_disabled(hid_t orig_fapl,
- const char *env_h5_drvr);
+
+/* helper routines */
+static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl);
+static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size);
#endif /* H5_HAVE_PARALLEL */
const char *FILENAME[] = {
@@ -60,6 +64,7 @@ const char *FILENAME[] = {
NULL
};
+#ifndef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: create_file()
@@ -67,9 +72,9 @@ const char *FILENAME[] = {
* Purpose: The purpose of this function appears to be a smoke check
* intended to exercise the page buffer.
*
- * Specifically, the function creates a file, and then goes
- * through a loop in which it creates four data sets, write
- * data to one of them, verifies the data written, and then
+ * Specifically, the function creates a file, and then goes
+ * through a loop in which it creates four data sets, write
+ * data to one of them, verifies the data written, and then
* deletes the three that it didn't write to.
*
* Any data mis-matches or failures reported by the HDF5
@@ -96,7 +101,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
int i;
int num_elements;
int j;
- char dset_name[10];
+ char dset_name[32];
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
FAIL_STACK_ERROR;
@@ -153,7 +158,7 @@ create_file(char *filename, hid_t fcpl, hid_t fapl)
HDmemset(data, 0, (size_t)num_elements * sizeof(int));
if((dset_id = H5Dopen2(grp_id, dset_name, H5P_DEFAULT)) < 0)
- FAIL_STACK_ERROR;
+ FAIL_STACK_ERROR;
if(H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
FAIL_STACK_ERROR;
if(H5Dclose(dset_id) < 0)
@@ -208,7 +213,7 @@ error:
* Purpose: The purpose of this function appears to be a smoke check
* intended to exercise the page buffer.
*
- * Specifically, the function opens a file (created by
+ * Specifically, the function opens a file (created by
* create_file()?), and verify the contents of its datasets.
*
* Any data mis-matches or failures reported by the HDF5
@@ -223,7 +228,7 @@ error:
*-------------------------------------------------------------------------
*/
static unsigned
-open_file(char *filename, hid_t fapl, hsize_t page_size,
+open_file(char *filename, hid_t fapl, hsize_t page_size,
size_t page_buffer_size)
{
hid_t file_id = -1;
@@ -233,14 +238,14 @@ open_file(char *filename, hid_t fapl, hsize_t page_size,
int i;
int j;
int num_elements;
- char dset_name[10];
+ char dset_name[32];
H5F_t *f = NULL;
if((file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
if(f->shared->page_buf == NULL)
@@ -294,6 +299,7 @@ error:
} H5E_END_TRY;
return 1;
}
+#endif /* H5_HAVE_PARALLEL */
/*
*
@@ -334,7 +340,7 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize)
memb_addr[H5FD_MEM_DRAW] = ((memb_addr[H5FD_MEM_DRAW] + pagesize - 1) / pagesize) * pagesize;
} else {
/* Set memb_addr aligned */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
memb_addr[mt] = ((memb_addr[mt] + pagesize - 1) / pagesize) * pagesize;
} /* end else */
@@ -343,7 +349,7 @@ set_multi_split(const char *env_h5_drvr, hid_t fapl, hsize_t pagesize)
TEST_ERROR
/* Free memb_name */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
free(memb_name[mt]);
} /* end if */
@@ -355,6 +361,7 @@ error:
} /* set_multi_split() */
+#ifndef H5_HAVE_PARALLEL
/*-------------------------------------------------------------------------
* Function: test_args()
@@ -363,7 +370,7 @@ error:
*
* 1) verifying that API errors are caught.
*
- * 2) verifying that the page buffer behaves more or less
+ * 2) verifying that the page buffer behaves more or less
* as advertized.
*
* Any data mis-matches or unexpected failures or successes
@@ -377,6 +384,7 @@ error:
*
*-------------------------------------------------------------------------
*/
+
static unsigned
test_args(hid_t orig_fapl, const char *env_h5_drvr)
{
@@ -396,8 +404,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
- /* Test setting a page buffer without Paged Aggregation enabled -
- * should fail
+ /* Test setting a page buffer without Paged Aggregation enabled -
+ * should fail
*/
if(H5Pset_page_buffer_size(fapl, 512, 0, 0) < 0)
TEST_ERROR;
@@ -410,8 +418,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
- /* Test setting a page buffer with a size smaller than a single
- * page size - should fail
+ /* Test setting a page buffer with a size smaller than a single
+ * page size - should fail
*/
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0)
TEST_ERROR;
@@ -430,8 +438,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
- /* Test setting a page buffer with sum of min meta and raw
- * data percentage > 100 - should fail
+ /* Test setting a page buffer with sum of min meta and raw
+ * data percentage > 100 - should fail
*/
H5E_BEGIN_TRY {
ret = H5Pset_page_buffer_size(fapl, 512, 50, 51);
@@ -460,8 +468,8 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
- /* Test setting a page buffer with a size slightly larger than a
- * single page size
+ /* Test setting a page buffer with a size slightly larger than a
+ * single page size
*/
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0)
TEST_ERROR;
@@ -521,7 +529,7 @@ test_args(hid_t orig_fapl, const char *env_h5_drvr)
if(H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- PASSED()
+ PASSED();
return 0;
error:
@@ -547,14 +555,14 @@ error:
*
* Programmer: unknown
* ?? / ?? / ??
- *
+ *
* Changes: Added base_page_cnt field as supporting code. This allows
* the test to adjust to the number of page buffer pages
* accessed during file open / create.
*
- * The test for the value of base_page_cnt just after file
+ * The test for the value of base_page_cnt just after file
* open exists detect changes in library behavior. Assuming
- * any such change is not indicative of other issues, these
+ * any such change is not indicative of other issues, these
* tests can be modified to reflect the change.
*
* JRM -- 2/23/17
@@ -570,9 +578,6 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
hid_t file_id = -1; /* File ID */
hid_t fcpl = -1;
hid_t fapl = -1;
- H5FD_io_info_t fdio_info;
- H5P_genplist_t *meta_plist = (H5P_genplist_t *)H5I_object(H5AC_ind_read_dxpl_id);
- H5P_genplist_t *raw_plist = (H5P_genplist_t *)H5I_object(H5AC_rawdata_dxpl_id);
size_t base_page_cnt;
size_t page_count = 0;
int i, num_elements = 2000;
@@ -606,11 +611,11 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
- * Get the number of pages inserted, and verify that it is the
+ * Get the number of pages inserted, and verify that it is the
* the expected value.
*/
base_page_cnt = H5SL_count(f->shared->page_buf->slist_ptr);
@@ -618,13 +623,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* allocate space for a 2000 elements */
- if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- /* intialize all the elements to have a value of -1 */
+ /* initialize all the elements to have a value of -1 */
for(i=0 ; i<num_elements ; i++)
data[i] = -1;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
/* update the first 50 elements to have values 0-49 - this will be
@@ -634,7 +639,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
for(i=0 ; i<100 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
page_count ++;
@@ -646,7 +651,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
bring two more pages into the page buffer. */
for(i=0 ; i<150 ; i++)
data[i] = i+300;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*300), sizeof(int)*150, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*300), sizeof(int)*150, data) < 0)
FAIL_STACK_ERROR;
page_count += 2;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
@@ -656,7 +661,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
existing pages in the page buffer. */
for(i=0 ; i<200 ; i++)
data[i] = i+100;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*100), sizeof(int)*200, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*100), sizeof(int)*200, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
FAIL_STACK_ERROR;
@@ -665,7 +670,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
/* Changes: 450 - 600; 150 */
for(i=0 ; i<150 ; i++)
data[i] = i+450;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*450), sizeof(int)*150, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*450), sizeof(int)*150, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
FAIL_STACK_ERROR;
@@ -673,13 +678,13 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
/* Do a full page write to block 600-800 - should bypass the PB */
for(i=0 ; i<200 ; i++)
data[i] = i+600;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*600), sizeof(int)*200, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*600), sizeof(int)*200, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
FAIL_STACK_ERROR;
/* read elements 800 - 1200, this should not affect the PB, and should read -1s */
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*800), sizeof(int)*400, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*800), sizeof(int)*400, data) < 0)
FAIL_STACK_ERROR;
for (i=0; i < 400; i++) {
if(data[i] != -1) {
@@ -690,10 +695,10 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
FAIL_STACK_ERROR;
- /* read elements 1200 - 1201, this should read -1 and bring in an
- * entire page of addr 1200
+ /* read elements 1200 - 1201, this should read -1 and bring in an
+ * entire page of addr 1200
*/
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0)
FAIL_STACK_ERROR;
for (i=0; i < 1; i++) {
if(data[i] != -1) {
@@ -708,7 +713,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
/* read elements 175 - 225, this should use the PB existing pages */
/* Changes: 350 - 450 */
/* read elements 175 - 225, this should use the PB existing pages */
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
for (i=0; i < 100; i++) {
if(data[i] != i+350) {
@@ -721,10 +726,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
/* read elements 0 - 800 using the VFD.. this should result in -1s
except for the writes that went through the PB (100-300 & 600-800) */
- fdio_info.file = f->shared->lf;
- fdio_info.meta_dxpl = meta_plist;
- fdio_info.raw_dxpl = raw_plist;
- if(H5FD_read(&fdio_info, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0)
+ if(H5FD_read(f->shared->lf, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0)
FAIL_STACK_ERROR;
i = 0;
while (i < 800) {
@@ -744,9 +746,9 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
}
/* read elements 0 - 800 using the PB.. this should result in all
- * what we have written so far and should get the updates from the PB
+ * what we have written so far and should get the updates from the PB
*/
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*800, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
TEST_ERROR;
@@ -759,11 +761,11 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
/* update elements 400 - 1400 to value 0, this will go to disk but
* also evict existing pages from the PB (page 400 & 1200 that are
- * existing).
+ * existing).
*/
for(i=0 ; i<1000 ; i++)
data[i] = 0;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, data) < 0)
FAIL_STACK_ERROR;
page_count -= 2;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count + base_page_cnt)
@@ -772,7 +774,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
/* read elements 0 - 1000.. this should go to disk then update the
* buffer result 200-400 with existing pages
*/
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr, sizeof(int)*1000, data) < 0)
FAIL_STACK_ERROR;
i=0;
while (i < 1000) {
@@ -801,7 +803,7 @@ test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
HDfree(data);
- PASSED()
+ PASSED();
return 0;
error:
@@ -830,14 +832,14 @@ error:
*
* Programmer: unknown
* ?? / ?? / ??
- *
+ *
* Changes: Added base_page_cnt field as supporting code. This allows
* the test to adjust to the number of page buffer pages
* accessed during file open / create.
*
- * The test for the value of base_page_cnt just after file
+ * The test for the value of base_page_cnt just after file
* open exists detect changes in library behavior. Assuming
- * any such change is not indicative of other issues, these
+ * any such change is not indicative of other issues, these
* tests can be modified to reflect the change.
*
* JRM -- 2/23/17
@@ -892,11 +894,11 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
- * Get the number of pages inserted, and verify that it is the
+ * Get the number of pages inserted, and verify that it is the
* the expected value.
*/
base_page_cnt = H5SL_count(f->shared->page_buf->slist_ptr);
@@ -904,24 +906,24 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* allocate space for a 2000 elements */
- if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- /* intialize all the elements to have a value of -1 */
+ /* initialize all the elements to have a value of -1 */
for(i=0 ; i<num_elements ; i++)
data[i] = -1;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
/* update the first 100 elements to have values 0-99 - this will be
* a page buffer update with 1 page resulting in the page
- * buffer.
+ * buffer.
*/
for(i=0 ; i<100 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
page_count ++;
@@ -930,12 +932,12 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* update elements 300 - 450, with values 300 - 449 - this will
- * bring two pages into the page buffer and evict 0.
+ * bring two pages into the page buffer and evict 0.
*/
for(i=0 ; i<150 ; i++)
data[i] = i+300;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*300), sizeof(int)*150, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*300), sizeof(int)*150, data) < 0)
FAIL_STACK_ERROR;
page_count = 2;
@@ -964,7 +966,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
/* Changes: 300 - 301 */
for(i=0 ; i<1 ; i++)
data[i] = i+300;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*300), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*300), sizeof(int)*1, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
FAIL_STACK_ERROR;
@@ -972,7 +974,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
/* read elements 600 - 601, this should read -1 and bring in an
entire page of addr 600, and evict page 200 */
/* Changes: 1200 - 1201; 1200, 400 */
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*1200), sizeof(int)*1, data) < 0)
FAIL_STACK_ERROR;
for (i=0; i < 1; i++) {
if(data[i] != -1) {
@@ -999,7 +1001,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* read elements 175 - 225, this should move 100 to the top, evict 600 and bring in 200 */
/* Changes: 350 - 450; 200, 1200, 400 */
- if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, addr+(sizeof(int)*350), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
for (i=0; i < 100; i++) {
if(data[i] != i+350) {
@@ -1030,7 +1032,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
/* Changes: 400 - 1400; 400 */
for(i=0 ; i<1000 ; i++)
data[i] = 0;
- if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, addr+(sizeof(int)*400), sizeof(int)*1000, data) < 0)
FAIL_STACK_ERROR;
page_count -= 1;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1054,7 +1056,7 @@ test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
HDfree(data);
- PASSED()
+ PASSED();
return 0;
error:
@@ -1072,7 +1074,7 @@ error:
/*-------------------------------------------------------------------------
* Function: test_min_threshold()
*
- * Purpose: Tests verifying observation of minimum and maximum
+ * Purpose: Tests verifying observation of minimum and maximum
* raw and metadata page counts in the page buffer.
*
* Any data mis-matches or failures reported by the HDF5
@@ -1083,16 +1085,16 @@ error:
*
* Programmer: unknown
* ?? / ?? / ??
- *
+ *
* Changes: Added the base_raw_cnt and base_meta_cnt fields and
- * supporting code. This allows the test to adjust to the
- * number of page buffer pages accessed during file open /
+ * supporting code. This allows the test to adjust to the
+ * number of page buffer pages accessed during file open /
* create.
*
* The tests for the values of base_raw_cnt and base_meta_cnt
- * just after file open exist detect changes in library
- * behavior. Assuming any such change is not indicative of
- * other issues, these tests can be modified to reflect the
+ * just after file open exist detect changes in library
+ * behavior. Assuming any such change is not indicative of
+ * other issues, these tests can be modified to reflect the
* change.
*
* JRM -- 2/23/17
@@ -1151,7 +1153,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -1178,13 +1180,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(page_buf->min_raw_count != 0)
TEST_ERROR;
- if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- /* write all raw data, this would end up in page buffer since there
+ /* write all raw data, this would end up in page buffer since there
* is no metadata yet
*
* Not necessarily -- opening the file may may load a metadata page.
@@ -1192,19 +1194,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
for(i=0 ; i<100 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
page_count += 5;
@@ -1216,19 +1218,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* write all meta data, this would end up in page buffer */
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1242,21 +1244,21 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
/* write and read more raw data and make sure that they don't end up in
* page buffer since the minimum metadata is actually the entire
- * page buffer
+ * page buffer
*/
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1286,7 +1288,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
@@ -1312,31 +1314,31 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(page_buf->min_raw_count != 5)
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
TEST_ERROR;
- /* write all meta data, this would end up in page buffer since there
+ /* write all meta data, this would end up in page buffer since there
* is no raw data yet
*/
for(i=0 ; i<100 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
page_count += 5;
@@ -1347,19 +1349,19 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* write/read all raw data, this would end up in page buffer */
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1373,21 +1375,21 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
/* write and read more meta data and make sure that they don't end up in
* page buffer since the minimum metadata is actually the entire
- * page buffer
+ * page buffer
*/
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*100), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*350), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*350), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*750), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*750), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*900), sizeof(int)*50, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*900), sizeof(int)*50, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1405,8 +1407,8 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
HDprintf("\tMinimum metadata threshold = 40%%, Minimum rawdata threshold = 40%%\n");
page_count = 0;
- /* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages
- * minimum
+ /* keep 5 pages at max in the page buffer 2 meta pages, 2 raw pages
+ * minimum
*/
if(H5Pset_page_buffer_size(fapl, sizeof(int)*1000, 40, 40) < 0)
TEST_ERROR;
@@ -1416,13 +1418,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
*
- * However, with the current 1 metadata page inserted into the
- * the page buffer, it is not necessary to track the base raw and
+ * However, with the current 1 metadata page inserted into the
+ * the page buffer, it is not necessary to track the base raw and
* metadata entry counts.
*/
@@ -1439,39 +1441,39 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(page_buf->min_raw_count != 2)
TEST_ERROR;
- if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- /* intialize all the elements to have a value of -1 */
+ /* initialize all the elements to have a value of -1 */
for(i=0 ; i<num_elements ; i++)
data[i] = -1;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
/* fill the page buffer with raw data */
for(i=0 ; i<100 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
page_count += 5;
@@ -1483,13 +1485,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* add 3 meta entries evicting 3 raw entries */
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1501,13 +1503,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(f->shared->page_buf->raw_count != 2)
TEST_ERROR;
- /* adding more meta entires should replace meta entries since raw data
- * is at its minimum
+ /* adding more meta entires should replace meta entries since raw data
+ * is at its minimum
*/
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(f->shared->page_buf->meta_count != 3)
@@ -1517,13 +1519,13 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* bring existing raw entires up the LRU */
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*750), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- /* adding 2 raw entries (even with 1 call) should only evict 1 meta
- * entry and another raw entry
+ /* adding 2 raw entries (even with 1 call) should only evict 1 meta
+ * entry and another raw entry
*/
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*350), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(f->shared->page_buf->meta_count != 2)
@@ -1533,10 +1535,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* adding 2 meta entries should replace 2 entires at the bottom of the LRU */
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*98), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*98), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*242), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*242), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(f->shared->page_buf->meta_count != 2)
@@ -1557,7 +1559,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
page_buf = f->shared->page_buf;
@@ -1566,39 +1568,39 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(page_buf->min_raw_count != 0)
TEST_ERROR;
- if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- /* intialize all the elements to have a value of -1 */
+ /* initialize all the elements to have a value of -1 */
for(i=0 ; i<num_elements ; i++)
data[i] = -1;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
/* fill the page buffer with raw data */
for(i=0 ; i<100 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
page_count += 5;
@@ -1607,10 +1609,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* add 2 meta entries evicting 2 raw entries */
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1623,17 +1625,17 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
TEST_ERROR;
/* bring the rest of the raw entries up the LRU */
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
/* write one more raw entry which replace one meta entry */
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1645,10 +1647,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(f->shared->page_buf->raw_count != 4)
TEST_ERROR;
- /* write one more raw entry which should replace another raw entry
- * keeping min threshold of meta entries
+ /* write one more raw entry which should replace another raw entry
+ * keeping min threshold of meta entries
*/
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1660,10 +1662,10 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
if(f->shared->page_buf->raw_count != 4)
TEST_ERROR;
- /* write a metadata entry that should replace the metadata entry
- * at the bottom of the LRU
+ /* write a metadata entry that should replace the metadata entry
+ * at the bottom of the LRU
*/
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(H5SL_count(f->shared->page_buf->slist_ptr) != page_count)
@@ -1686,7 +1688,7 @@ test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr)
HDfree(data);
- PASSED()
+ PASSED();
return 0;
@@ -1719,16 +1721,16 @@ error:
*
* Programmer: unknown
* ?? / ?? / ??
- *
+ *
* Changes: Added the base_raw_cnt and base_meta_cnt fields and
- * supporting code. This allows the test to adjust to the
- * number of page buffer pages accessed during file open /
+ * supporting code. This allows the test to adjust to the
+ * number of page buffer pages accessed during file open /
* create.
*
* The tests for the values of base_raw_cnt and base_meta_cnt
- * just after file open exist detect changes in library
- * behavior. Assuming any such change is not indicative of
- * other issues, these tests can be modified to reflect the
+ * just after file open exist detect changes in library
+ * behavior. Assuming any such change is not indicative of
+ * other issues, these tests can be modified to reflect the
* change.
*
* JRM -- 2/23/17
@@ -1781,11 +1783,11 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
FAIL_STACK_ERROR;
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(file_id)))
+ if(NULL == (f = (H5F_t *)H5VL_object(file_id)))
FAIL_STACK_ERROR;
/* opening the file inserts one or more pages into the page buffer.
- * Get the raw and meta counts now, so we can adjust the expected
+ * Get the raw and meta counts now, so we can adjust the expected
* statistics accordingly.
*/
HDassert(f);
@@ -1805,99 +1807,99 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
if(H5Freset_page_buffering_stats(file_id) < 0)
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (meta_addr = H5MF_alloc(f, H5FD_MEM_SUPER, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, sizeof(int)*(size_t)num_elements)))
+ if(HADDR_UNDEF == (raw_addr = H5MF_alloc(f, H5FD_MEM_DRAW, sizeof(int)*(size_t)num_elements)))
FAIL_STACK_ERROR;
- /* intialize all the elements to have a value of -1 */
+ /* initialize all the elements to have a value of -1 */
for(i=0 ; i<num_elements ; i++)
data[i] = -1;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*(size_t)num_elements, data) < 0)
FAIL_STACK_ERROR;
for(i=0 ; i<200 ; i++)
data[i] = i;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*500), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*700), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*900), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*200, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*200, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*100), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*300), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*182, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_write(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*182, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr, sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*200), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*600), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_rawdata_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_DRAW, raw_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*400), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*200, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*600), sizeof(int)*200, data) < 0)
FAIL_STACK_ERROR;
- if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, H5AC_ind_read_dxpl_id, data) < 0)
+ if(H5F_block_read(f, H5FD_MEM_SUPER, meta_addr+(sizeof(int)*800), sizeof(int)*100, data) < 0)
FAIL_STACK_ERROR;
if(f->shared->page_buf->accesses[0] != 8)
@@ -1992,7 +1994,7 @@ test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr)
HDfree(data);
- PASSED()
+ PASSED();
return 0;
error:
@@ -2006,12 +2008,13 @@ error:
return 1;
} /* test_stats_collection */
+#endif /* #ifndef H5_HAVE_PARALLEL */
/*-------------------------------------------------------------------------
* Function: verify_page_buffering_disabled()
*
- * Purpose: This function should only be called in parallel
+ * Purpose: This function should only be called in parallel
* builds.
*
* At present, page buffering should be disabled in parallel
@@ -2022,7 +2025,7 @@ error:
*
* Programmer: John Mainzer
* 03/21/17
- *
+ *
* Changes: None.
*
*-------------------------------------------------------------------------
@@ -2069,7 +2072,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr)
if(file_id >= 0)
TEST_ERROR;
- /* now, create a file, close it, and then try to open it with page
+ /* now, create a file, close it, and then try to open it with page
* buffering enabled.
*/
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
@@ -2089,7 +2092,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr)
if(H5Fclose(file_id) < 0)
FAIL_STACK_ERROR;
- /* try to open the file using the fapl prepared above which enables
+ /* try to open the file using the fapl prepared above which enables
* page buffering. Should fail.
*/
H5E_BEGIN_TRY {
@@ -2105,7 +2108,7 @@ verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr)
if(H5Pclose(fapl) < 0)
FAIL_STACK_ERROR;
- PASSED()
+ PASSED();
return 0;
@@ -2142,6 +2145,7 @@ main(void)
hid_t fapl = -1; /* File access property list for data files */
unsigned nerrors = 0; /* Cumulative error count */
const char *env_h5_drvr = NULL; /* File Driver value from environment */
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
h5_reset();
@@ -2154,7 +2158,7 @@ main(void)
* Page buffering depends on paged aggregation which is
* currently disabled for multi/split drivers.
*/
- if((0 == HDstrcmp(env_h5_drvr, "multi")) ||
+ if((0 == HDstrcmp(env_h5_drvr, "multi")) ||
(0 == HDstrcmp(env_h5_drvr, "split"))) {
SKIPPED()
@@ -2167,7 +2171,11 @@ main(void)
PUTS_ERROR("Can't get VFD-dependent fapl")
} /* end if */
-#ifdef H5_HAVE_PARALLEL
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
+
+#ifdef H5_HAVE_PARALLEL
HDputs("Page Buffering is disabled for parallel.");
nerrors += verify_page_buffering_disabled(fapl, env_h5_drvr);
@@ -2187,12 +2195,15 @@ main(void)
if(nerrors)
goto error;
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
HDputs("All Page Buffering tests passed.");
HDexit(EXIT_SUCCESS);
error:
-
HDprintf("***** %d Page Buffering TEST%s FAILED! *****\n",
nerrors, nerrors > 1 ? "S" : "");
@@ -2200,7 +2211,8 @@ error:
H5Pclose(fapl);
} H5E_END_TRY;
- HDexit(EXIT_FAILURE);
+ if(api_ctx_pushed) H5CX_pop();
+ HDexit(EXIT_FAILURE);
} /* main() */
diff --git a/test/plugin.c b/test/plugin.c
deleted file mode 100644
index ea199f6..0000000
--- a/test/plugin.c
+++ /dev/null
@@ -1,1217 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/*
- * Purpose: Tests the plugin module (H5PL)
- */
-
-#include "h5test.h"
-#include "H5srcdir.h"
-
-/*
- * This file needs to access private datatypes from the H5Z and H5PL package.
- */
-#define H5PL_FRIEND
-#include "H5PLpkg.h"
-#define H5Z_FRIEND
-#include "H5Zpkg.h"
-
-/* Filters for HDF5 internal test */
-#define H5Z_FILTER_DYNLIB1 257
-#define H5Z_FILTER_DYNLIB2 258
-#define H5Z_FILTER_DYNLIB3 259
-#define H5Z_FILTER_DYNLIB4 260
-
-const char *FILENAME[] = {
- "plugin",
- NULL
-};
-#define FILENAME_BUF_SIZE 1024
-
-/* Dataset names for testing filters */
-#define DSET_DEFLATE_NAME "deflate"
-#define DSET_DYNLIB1_NAME "dynlib1"
-#define DSET_DYNLIB2_NAME "dynlib2"
-#define DSET_DYNLIB4_NAME "dynlib4"
-
-/* Parameters for internal filter test */
-#define FILTER_CHUNK_DIM1 2
-#define FILTER_CHUNK_DIM2 25
-#define FILTER_HS_OFFSET1 7
-#define FILTER_HS_OFFSET2 30
-#define FILTER_HS_SIZE1 4
-#define FILTER_HS_SIZE2 50
-
-/* Shared global arrays */
-#define DSET_DIM1 100
-#define DSET_DIM2 200
-
-/* Limit random number within 20000 */
-#define RANDOM_LIMIT 20000
-
-#define GROUP_ITERATION 1000
-
-int points_deflate[DSET_DIM1][DSET_DIM2],
- points_dynlib1[DSET_DIM1][DSET_DIM2],
- points_dynlib2[DSET_DIM1][DSET_DIM2],
- points_dynlib4[DSET_DIM1][DSET_DIM2],
- points_bzip2[DSET_DIM1][DSET_DIM2];
-
-
-/*-------------------------------------------------------------------------
- * Function: test_filter_internal
- *
- * Purpose: Tests writing entire data and partial data with filters
- *
- * Return: Success: 0
- * Failure: -1
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
-{
- herr_t ret_value = -1;
- hid_t dataset = -1; /* Dataset ID */
- hid_t dxpl = -1; /* Dataset xfer property list ID */
- hid_t write_dxpl = -1; /* Dataset xfer property list ID for writing */
- hid_t sid = -1; /* Dataspace ID */
- const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
- const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
- const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */
- void *tconv_buf = NULL; /* Temporary conversion buffer */
- int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2];
- size_t i, j; /* Local index variables */
- int n = 0;
-
- /* Create the data space */
- if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR
-
- /*
- * Create a small conversion buffer to test strip mining. We
- * might as well test all we can!
- */
- if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
- tconv_buf = HDmalloc((size_t)1000);
- if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) TEST_ERROR
- if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
-
- TESTING(" filters (setup)");
-
- /* Check if all the filters are available */
- if(H5Pall_filters_avail(dcpl) != TRUE) {
- H5_FAILED();
- HDprintf(" Line %d: Incorrect filter availability\n", __LINE__);
- TEST_ERROR
- } /* end if */
-
- /* Create the dataset */
- if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
-
- PASSED();
-
- /*----------------------------------------------------------------------
- * STEP 1: Read uninitialized data. It should be zero.
- *----------------------------------------------------------------------
- */
- TESTING(" filters (uninitialized read)");
-
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
-
- for(i=0; i<(size_t)size[0]; i++)
- for(j=0; j<(size_t)size[1]; j++)
- if(0 != check[i][j]) {
- H5_FAILED();
- HDprintf(" Read a non-zero value.\n");
- HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- TEST_ERROR
- } /* end if */
- PASSED();
-
- /*----------------------------------------------------------------------
- * STEP 2: Test filters by setting up a chunked dataset and writing
- * to it.
- *----------------------------------------------------------------------
- */
- TESTING(" filters (write)");
-
- n = 0;
- for(i=0; i<size[0]; i++)
- for(j=0; j<size[1]; j++)
- points[i][j] = (int)(n++);
-
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR;
-
- PASSED();
-
- /*----------------------------------------------------------------------
- * STEP 3: Try to read the data we just wrote.
- *----------------------------------------------------------------------
- */
- TESTING(" filters (read)");
-
- /* Read the dataset back */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<size[0]; i++)
- for(j=0; j<size[1]; j++)
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- HDfprintf(stderr," Read different values than written.\n");
- HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- HDfprintf(stderr," At original: %d\n", (int)points[i][j]);
- HDfprintf(stderr," At returned: %d\n", (int)check[i][j]);
- TEST_ERROR
- } /* end if */
-
- PASSED();
-
- /*----------------------------------------------------------------------
- * STEP 4: Write new data over the top of the old data. The new data is
- * random thus not very compressible, and will cause the chunks to move
- * around as they grow. We only change values for the left half of the
- * dataset although we rewrite the whole thing.
- *----------------------------------------------------------------------
- */
- TESTING(" filters (modify)");
-
- for(i=0; i<size[0]; i++)
- for(j=0; j<size[1]/2; j++)
- points[i][j] = (int)HDrandom () % RANDOM_LIMIT;
-
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR;
-
- /* Read the dataset back and check it */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<size[0]; i++)
- for(j=0; j<size[1]; j++)
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- HDprintf(" Read different values than written.\n");
- HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- TEST_ERROR
- } /* end if */
-
- PASSED();
-
- /*----------------------------------------------------------------------
- * STEP 5: Close the dataset and then open it and read it again. This
- * insures that the filters message is picked up properly from the
- * object header.
- *----------------------------------------------------------------------
- */
- TESTING(" filters (re-open)");
-
- if(H5Dclose(dataset) < 0) TEST_ERROR;
- if((dataset = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) TEST_ERROR;
-
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i = 0; i < size[0]; i++)
- for(j = 0; j < size[1]; j++)
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- HDprintf(" Read different values than written.\n");
- HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- TEST_ERROR
- } /* end if */
-
- PASSED();
-
- /*----------------------------------------------------------------------
- * STEP 6: Test partial I/O by writing to and then reading from a
- * hyperslab of the dataset. The hyperslab does not line up on chunk
- * boundaries (we know that case already works from above tests).
- *----------------------------------------------------------------------
- */
- TESTING(" filters (partial I/O)");
-
- for(i=0; i<(size_t)hs_size[0]; i++)
- for(j=0; j<(size_t)hs_size[1]; j++)
- points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom() % RANDOM_LIMIT;
-
- if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) TEST_ERROR;
- /* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0) TEST_ERROR;
-
- if(H5Dread(dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<(size_t)hs_size[0]; i++)
- for(j=0; j<(size_t)hs_size[1]; j++)
- if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
- H5_FAILED();
- HDfprintf(stderr," Read different values than written.\n");
- HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)((size_t)hs_offset[0]+i), (unsigned long)((size_t)hs_offset[1]+j));
- HDfprintf(stderr," At original: %d\n", (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- HDfprintf(stderr," At returned: %d\n", (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- TEST_ERROR
- } /* end if */
-
- PASSED();
-
- /* Save the data written to the file for later comparison when the file
- * is reopened for read test */
- for(i=0; i<size[0]; i++)
- for(j=0; j<size[1]; j++)
- if(!HDstrcmp(name, DSET_DEFLATE_NAME))
- points_deflate[i][j] = points[i][j];
- else if(!HDstrcmp(name, DSET_DYNLIB1_NAME))
- points_dynlib1[i][j] = points[i][j];
- else if(!HDstrcmp(name, DSET_DYNLIB2_NAME))
- points_dynlib2[i][j] = points[i][j];
- else if(!HDstrcmp(name, DSET_DYNLIB4_NAME))
- points_dynlib4[i][j] = points[i][j];
-
- ret_value = 0;
-
-error:
- /* Clean up objects used for this test */
- H5E_BEGIN_TRY {
- H5Dclose(dataset);
- H5Sclose(sid);
- H5Pclose(dxpl);
- } H5E_END_TRY
-
- if(tconv_buf)
- HDfree(tconv_buf);
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_filters_for_datasets
- *
- * Purpose: Tests creating datasets and writing data with dynamically loaded filters
- *
- * Return: Success: 0
- * Failure: -1
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_filters_for_datasets(hid_t file)
-{
- herr_t ret_value = -1;
- hid_t dc = -1; /* Dataset creation property list ID */
- const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
- unsigned int compress_level = 9;
- unsigned int dynlib4_values[4];
-
- /*----------------------------------------------------------
- * STEP 1: Test deflation by itself.
- *----------------------------------------------------------
- */
- HDputs("Testing deflate filter");
-#ifdef H5_HAVE_FILTER_DEFLATE
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
- if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
- if(H5Pset_deflate(dc, 6) < 0) TEST_ERROR
-
- if(test_filter_internal(file, DSET_DEFLATE_NAME, dc) < 0) TEST_ERROR
- /* Clean up objects used for this test */
- if(H5Pclose(dc) < 0) TEST_ERROR
-#else /* H5_HAVE_FILTER_DEFLATE */
- SKIPPED();
- HDputs(" Deflate filter not enabled");
-#endif /* H5_HAVE_FILTER_DEFLATE */
-
- /*----------------------------------------------------------
- * STEP 2: Test DYNLIB1 by itself.
- *----------------------------------------------------------
- */
- HDputs(" DYNLIB1 filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
- if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
- if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) TEST_ERROR
-
- if(test_filter_internal(file, DSET_DYNLIB1_NAME, dc) < 0) TEST_ERROR
-
- /* Clean up objects used for this test */
- if(H5Pclose(dc) < 0) TEST_ERROR
-
- /* Unregister the dynamic filter DYNLIB1 for testing purpose. The next time when this test is run for
- * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
- * for this filter. */
- if(H5Zunregister(H5Z_FILTER_DYNLIB1) < 0) TEST_ERROR
-
- /*----------------------------------------------------------
- * STEP 3: Test DYNLIB2 by itself.
- *----------------------------------------------------------
- */
- HDputs(" DYNLIB2 filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
- if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
- if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL) < 0) TEST_ERROR
-
- if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) TEST_ERROR
-
- /* Clean up objects used for this test */
- if(H5Pclose(dc) < 0) TEST_ERROR
-
- /* Unregister the dynamic filter DYNLIB2 for testing purpose. The next time when this test is run for
- * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
- * for this filter. */
- if(H5Zunregister(H5Z_FILTER_DYNLIB2) < 0) TEST_ERROR
-
- /*----------------------------------------------------------
- * STEP 4: Test DYNLIB4 by itself.
- *----------------------------------------------------------
- */
- HDputs(" DYNLIB4 filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
- if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
- dynlib4_values[0] = 9;
- if(H5get_libversion(&dynlib4_values[1], &dynlib4_values[2], &dynlib4_values[3]) < 0) TEST_ERROR
- if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB4, H5Z_FLAG_MANDATORY, (size_t)4, dynlib4_values) < 0) TEST_ERROR
-
- if(test_filter_internal(file, DSET_DYNLIB4_NAME, dc) < 0) TEST_ERROR
-
- /* Clean up objects used for this test */
- if(H5Pclose(dc) < 0) TEST_ERROR
-
- /* Unregister the dynamic filter DYNLIB4 for testing purpose. The next time when this test is run for
- * the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
- * for this filter. */
- if(H5Zunregister(H5Z_FILTER_DYNLIB4) < 0) TEST_ERROR
-
- ret_value = 0;
-
-error:
- /* Clean up objects used for this test */
- H5E_BEGIN_TRY {
- H5Pclose(dc);
- } H5E_END_TRY
-
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_read_data
- *
- * Purpose: Tests reading data and compares values
- *
- * Return: Success: 0
- * Failure: -1
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_read_data(hid_t dataset, int *origin_data)
-{
- herr_t ret_value = -1;
- int check[DSET_DIM1][DSET_DIM2];
- const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
- int *data_p = origin_data;
- size_t i, j; /* Local index variables */
-
- /* Read the dataset back */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<size[0]; i++)
- for(j=0; j<size[1]; j++) {
- if(*data_p != check[i][j]) {
- H5_FAILED();
- HDfprintf(stderr," Read different values than written.\n");
- HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- HDfprintf(stderr," At original: %d\n", *data_p);
- HDfprintf(stderr," At returned: %d\n", (int)check[i][j]);
- TEST_ERROR
- } /* end if */
- data_p++;
- }
-
- PASSED();
- ret_value = 0;
-
-error:
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_read_with_filters
- *
- * Purpose: Tests reading dataset created with dynamically loaded filters
- *
- * Return: Success: 0
- * Failure: -1
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_read_with_filters(hid_t file)
-{
- herr_t ret_value = -1;
- hid_t dset = -1; /* Dataset ID */
-
- /*----------------------------------------------------------
- * STEP 1: Test deflation by itself.
- *----------------------------------------------------------
- */
- TESTING("deflate filter");
-
-#ifdef H5_HAVE_FILTER_DEFLATE
- if(H5Zfilter_avail(H5Z_FILTER_DEFLATE) != TRUE) TEST_ERROR
-
- if((dset = H5Dopen2(file,DSET_DEFLATE_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
-
- if(test_read_data(dset, (int *)points_deflate) < 0) TEST_ERROR
-
- if(H5Dclose(dset) < 0) TEST_ERROR
-
- /* Clean up objects used for this test */
-#else /* H5_HAVE_FILTER_DEFLATE */
- SKIPPED();
- HDputs(" Deflate filter not enabled");
-#endif /* H5_HAVE_FILTER_DEFLATE */
-
- /*----------------------------------------------------------
- * STEP 2: Test DYNLIB1 by itself.
- *----------------------------------------------------------
- */
- TESTING(" DYNLIB1 filter");
-
- if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
-
- if(test_read_data(dset, (int *)points_dynlib1) < 0) TEST_ERROR
-
- if(H5Dclose(dset) < 0) TEST_ERROR
-
- /*----------------------------------------------------------
- * STEP 3: Test Bogus2 by itself.
- *----------------------------------------------------------
- */
- TESTING(" DYNLIB2 filter");
-
- if((dset = H5Dopen2(file, DSET_DYNLIB2_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
-
- if(test_read_data(dset, (int *)points_dynlib2) < 0) TEST_ERROR
-
- if(H5Dclose(dset) < 0) TEST_ERROR
-
- /*----------------------------------------------------------
- * STEP 4: Test DYNLIB4 by itself.
- *----------------------------------------------------------
- */
- TESTING(" DYNLIB4 filter");
-
- if((dset = H5Dopen2(file,DSET_DYNLIB4_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
-
- if(test_read_data(dset, (int *)points_dynlib4) < 0) TEST_ERROR
-
- if(H5Dclose(dset) < 0) TEST_ERROR
-
- ret_value = 0;
-
-error:
- /* Clean up objects used for this test */
- H5E_BEGIN_TRY {
- H5Dclose(dset);
- } H5E_END_TRY
-
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_noread_data
- *
- * Purpose: Tests not reading data
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_noread_data(hid_t dataset)
-{
- herr_t ret_value = -1;
- int check[DSET_DIM1][DSET_DIM2];
- herr_t ret = -1;
-
- /* Read the dataset back */
- H5E_BEGIN_TRY {
- ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check);
- } H5E_END_TRY
- if(ret >= 0)
- TEST_ERROR
-
- PASSED();
- ret_value = 0;
-
-error:
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_noread_with_filters
- *
- * Purpose: Tests reading dataset created with dynamically loaded filters disabled
- *
- * Return: Success: 0
- * Failure: -1
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_noread_with_filters(hid_t file)
-{
- herr_t ret_value = -1;
- hid_t dset = -1; /* Dataset ID */
- unsigned plugin_state; /* status of plugins */
-
- TESTING("DYNLIB1 filter with plugins disabled");
-
- /* disable filter plugin */
- if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR
-
- plugin_state = plugin_state & (unsigned)(~H5PL_FILTER_PLUGIN);
-
- if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR
-
- if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
-
- if(test_noread_data(dset) < 0) TEST_ERROR
-
- if(H5Dclose(dset) < 0) TEST_ERROR
-
- ret_value = 0;
-
-error:
- /* re-enable filter plugin */
- plugin_state = plugin_state | H5PL_FILTER_PLUGIN;
- H5PLset_loading_state(plugin_state);
-
- /* Clean up objects used for this test */
- H5E_BEGIN_TRY {
- H5Dclose(dset);
- } H5E_END_TRY
-
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_filters_for_groups
- *
- * Purpose: Tests creating group with dynamically loaded filters
- *
- * Return: Success: 0
- * Failure: -1
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_filters_for_groups(hid_t file)
-{
- herr_t ret_value = -1;
- hid_t gcpl = -1;
- hid_t gid = -1;
- hid_t group = -1;
- int i;
- char gname[256];
-
- TESTING("DYNLIB3 filter for group");
-
- if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
-
- /* Use DYNLIB3 for creating groups */
- if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) TEST_ERROR
-
- /* Create a group using this filter */
- if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
-
- /* Create multiple groups under "group1" */
- for(i=0; i < GROUP_ITERATION; i++) {
- HDsprintf(gname, "group_%d", i);
- if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gclose(group) < 0) TEST_ERROR
- }
-
- /* Close the group */
- if(H5Gclose(gid) < 0) TEST_ERROR
-
- /* Clean up objects used for this test */
- if(H5Pclose(gcpl) < 0) TEST_ERROR
-
- PASSED();
-
- ret_value = 0;
-
-error:
- /* Clean up objects used for this test */
- H5E_BEGIN_TRY {
- H5Gclose(group);
- H5Gclose(gid);
- H5Pclose(gcpl);
- } H5E_END_TRY
-
- return ret_value;
-}
-
-/*-------------------------------------------------------------------------
- * Function: test_groups_with_filters
- *
- * Purpose: Tests opening group with dynamically loaded filters
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_groups_with_filters(hid_t file)
-{
- herr_t ret_value = -1;
- hid_t gid = -1;
- hid_t group = -1;
- int i;
- char gname[256];
-
- TESTING("opening groups with DYNLIB3 filter");
-
- /* Open the top group */
- if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) TEST_ERROR
-
- /* Create multiple groups under "group1" */
- for(i=0; i < GROUP_ITERATION; i++) {
- HDsprintf(gname, "group_%d", i);
- if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Gclose(group) < 0) TEST_ERROR
- }
-
- /* Close the group */
- if(H5Gclose(gid) < 0) TEST_ERROR
-
- PASSED();
-
- ret_value = 0;
-
-error:
- /* Clean up objects used for this test */
- H5E_BEGIN_TRY {
- H5Gclose(group);
- H5Gclose(gid);
- } H5E_END_TRY
-
- return ret_value;
-}
-
-
-/*-------------------------------------------------------------------------
- * Function: test_path_api_calls
- *
- * Purpose: Tests the H5PL API calls that manipulate the plugin search
- * paths.
- *
- * Return: SUCCEED/FAIL
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-test_path_api_calls(void)
-{
- unsigned int n_starting_paths;
- unsigned int u;
- unsigned int n_paths;
- herr_t ret;
- ssize_t path_len = -1;
- char path[256];
- char temp_name[256];
-
- HDputs("Testing access to the filter path table");
-
- if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE)
- TEST_ERROR
-
- /* Set the number of paths to create for this test.
- *
- * This should be set high enough to ensure that at least one array
- * expansion will take place. See H5PLpath.c for details.
- */
- n_starting_paths = 42;
-
- /* Check that initialization is correct */
- TESTING(" initialize");
-
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths != 2)
- TEST_ERROR
-
- PASSED();
-
- /****************/
- /* H5PLremove() */
- /****************/
-
- /* Remove all the current paths */
- TESTING(" remove");
-
- /* Get the current size */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
-
- /* Remove all existing paths */
- for(u = n_paths; u > 0; u--)
- if(H5PLremove(u-1) < 0) {
- HDfprintf(stderr," at %u: %s\n", u, path);
- TEST_ERROR
- }
-
- /* Verify the table is empty */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths > 0)
- TEST_ERROR
-
- PASSED();
-
-
- TESTING(" remove (index 0 in empty table)");
-
- /* Try to remove index zero in an empty list (SHOULD FAIL) */
- H5E_BEGIN_TRY {
- ret = H5PLremove(0);
- } H5E_END_TRY
- if(ret >= 0)
- TEST_ERROR
-
- PASSED();
-
-
- /****************/
- /* H5PLappend() */
- /****************/
-
- TESTING(" append");
-
- /* Add a bunch of paths to the path table */
- for(u = 0; u < n_starting_paths; u++) {
- HDsprintf(path, "a_path_%u", u);
- if(H5PLappend(path) < 0) {
- HDfprintf(stderr," at %u: %s\n", u, path);
- TEST_ERROR
- }
- }
-
- PASSED();
-
-
- /**********************/
- /* H5PLremove() again */
- /**********************/
-
- TESTING(" remove (index too high)");
-
- /* Try to remove a path where the index is beyond the table capacity (SHOULD FAIL) */
- H5E_BEGIN_TRY {
- ret = H5PLremove(n_starting_paths);
- } H5E_END_TRY
-
- if(ret >= 0)
- TEST_ERROR
-
- PASSED();
-
-
- /*************/
- /* H5PLget() */
- /*************/
-
- TESTING(" get (path name)");
-
- /* Get the path length by passing in NULL */
- if((path_len = H5PLget(0, NULL, 0)) <= 0) {
- HDfprintf(stderr," get path 0 length failed\n");
- TEST_ERROR
- }
- if(path_len != 8)
- TEST_ERROR
-
- /* Get the path */
- if((path_len = H5PLget(0, path, 256)) <= 0) {
- HDfprintf(stderr," get 0 len: %u : %s\n", path_len, path);
- TEST_ERROR
- }
- if(HDstrcmp(path, "a_path_0") != 0) {
- HDfprintf(stderr," get 0: %s\n", path);
- TEST_ERROR
- }
-
- PASSED();
-
-
- TESTING(" get (high and low indices)");
-
- /* Get path at index 1 */
- if((path_len = H5PLget(1, path, 256)) <= 0)
- TEST_ERROR
- if(HDstrcmp(path, "a_path_1") != 0) {
- HDfprintf(stderr," get 1: %s\n", path);
- TEST_ERROR
- }
-
- /* Get path at the last index */
- if((path_len = H5PLget(n_starting_paths - 1, path, 256)) <= 0)
- TEST_ERROR
- HDsprintf(temp_name, "a_path_%u", n_starting_paths - 1);
- if(HDstrcmp(path, temp_name) != 0) {
- HDfprintf(stderr," get %u: %s\n", n_starting_paths - 1, path);
- TEST_ERROR
- }
-
- PASSED();
-
-
- TESTING(" get (index too high)");
-
- /* Get path at the last + 1 index (SHOULD FAIL) */
- H5E_BEGIN_TRY {
- path_len = H5PLget(n_starting_paths, NULL, 0);
- } H5E_END_TRY
- if(path_len > 0)
- TEST_ERROR
-
- PASSED();
-
-
- /*****************/
- /* H5PLprepend() */
- /*****************/
-
- /* We'll remove a path at an arbitrary index and then
- * prepend a new path.
- */
-
- TESTING(" remove (arbitrary index 1)");
-
- /* Remove one path */
- if(H5PLremove(8) < 0)
- TEST_ERROR
-
- /* Verify that the entries were moved */
- if((path_len = H5PLget(8, path, 256)) <= 0)
- TEST_ERROR
- if(HDstrcmp(path, "a_path_9") != 0) {
- HDfprintf(stderr," get 8: %s\n", path);
- TEST_ERROR
- }
-
- /* Verify the table shrank */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths != n_starting_paths - 1)
- TEST_ERROR
-
- PASSED();
-
-
- TESTING(" prepend");
-
- /* Prepend one path */
- HDsprintf(path, "a_path_%d", n_starting_paths + 1);
- if(H5PLprepend(path) < 0) {
- HDfprintf(stderr," prepend %u: %s\n", n_starting_paths + 1, path);
- TEST_ERROR
- }
-
- /* Verify the table increased */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths != n_starting_paths)
- TEST_ERROR
-
- /* Verify that the entries were moved */
- if(H5PLget(8, path, 256) <= 0)
- TEST_ERROR
- if(HDstrcmp(path, "a_path_7") != 0) {
- HDfprintf(stderr," get 8: %s\n", path);
- TEST_ERROR
- }
-
- /* Verify that the path was inserted at index zero */
- if(H5PLget(0, path, 256) <= 0)
- TEST_ERROR
- HDsprintf(temp_name, "a_path_%d", n_starting_paths + 1);
- if(HDstrcmp(path, temp_name) != 0) {
- HDfprintf(stderr," get 0: %s\n", path);
- TEST_ERROR
- }
-
- PASSED();
-
-
- /*****************/
- /* H5PLreplace() */
- /*****************/
-
- TESTING(" replace");
-
- /* Replace one path at index 1 */
- HDsprintf(path, "a_path_%u", n_starting_paths + 4);
- if(H5PLreplace(path, 1) < 0) {
- HDfprintf(stderr," replace 1: %s\n", path);
- TEST_ERROR
- }
-
- /* Verify the table size remained the same */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths != n_starting_paths)
- TEST_ERROR
-
- /* Verify that the entries were not moved by
- * inspecting the paths at indices +/- 1.
- */
-
- /* Check path at index 0 */
- if(H5PLget(0, path, 256) <= 0)
- TEST_ERROR
- HDsprintf(temp_name, "a_path_%u", n_starting_paths + 1);
- if(HDstrcmp(path, temp_name) != 0) {
- HDfprintf(stderr," get 0: %s\n", path);
- TEST_ERROR
- }
-
- /* Check path at index 2 */
- if(H5PLget(2, path, 256) <= 0)
- TEST_ERROR
- if(HDstrcmp(path, "a_path_1") != 0) {
- HDfprintf(stderr," get 2: %s\n", path);
- TEST_ERROR
- }
-
- PASSED();
-
-
- /****************/
- /* H5PLinsert() */
- /****************/
-
- /* We'll remove a path at an arbitrary index and then
- * insert a new path.
- */
-
- TESTING(" remove (arbitrary index 2)");
-
- /* Remove one path */
- if(H5PLremove(4) < 0)
- TEST_ERROR
-
- /* Verify that the entries were moved */
- if(H5PLget(4, path, 256) <= 0)
- TEST_ERROR
- if(HDstrcmp(path, "a_path_4") != 0) {
- HDfprintf(stderr," get 4: %s\n", path);
- TEST_ERROR
- }
-
- /* Verify the table size */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths != n_starting_paths - 1)
- TEST_ERROR
- PASSED();
-
-
- TESTING(" insert");
-
- /* Insert one path at index 3*/
- HDsprintf(path, "a_path_%d", n_starting_paths + 5);
- if(H5PLinsert(path, 3) < 0) {
- HDfprintf(stderr," insert 3: %s\n", path);
- TEST_ERROR
- }
-
- /* Verify that the entries were moved */
- if(H5PLget(4, path, 256) <= 0)
- TEST_ERROR
- if(HDstrcmp(path, "a_path_2") != 0) {
- HDfprintf(stderr," get 4: %s\n", path);
- TEST_ERROR
- }
-
- /* Verify the table size increased */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths != n_starting_paths)
- TEST_ERROR
-
- PASSED();
-
-
- /****************/
- /* H5PLremove() */
- /****************/
-
- /* Remove all the current paths */
- TESTING(" remove (all)");
-
- /* Get the current size */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
-
- /* Remove all existing paths */
- for(u = n_paths; u > 0; u--)
- if(H5PLremove(u-1) < 0) {
- HDfprintf(stderr," at %u: %s\n", u, path);
- TEST_ERROR
- }
-
- /* Verify the table is empty */
- if(H5PLsize(&n_paths) < 0)
- TEST_ERROR
- if(n_paths > 0)
- TEST_ERROR
-
- PASSED();
-
-
- return SUCCEED;
-
-error:
- return FAIL;
-} /* end test_path_api_calls() */
-
-
-/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests the plugin module (H5PL)
- *
- * Return: EXIT_SUCCESS/EXIT_FAILURE
- *
- *-------------------------------------------------------------------------
- */
-int
-main(void)
-{
- char filename[FILENAME_BUF_SIZE];
- hid_t file = -1;
- hid_t fapl = -1;
- hid_t fapl2 = -1;
- unsigned new_format;
- int mdc_nelmts;
- size_t rdcc_nelmts;
- size_t rdcc_nbytes;
- double rdcc_w0;
- int nerrors = 0;
-
- /* Testing setup */
- h5_reset();
-
- if ((fapl = h5_fileaccess()) < 0)
- TEST_ERROR
-
- /* Turn off the chunk cache, so all the chunks are immediately written to disk */
- if (H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0)
- TEST_ERROR
- rdcc_nbytes = 0;
- if (H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0)
- TEST_ERROR
-
- /* Copy the file access property list */
- if ((fapl2 = H5Pcopy(fapl)) < 0)
- TEST_ERROR
-
- /* Set the "use the latest version of the format" bounds for creating objects in the file */
- if (H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- TEST_ERROR
-
- h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
-
- /* Test with old & new format groups */
- for (new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t my_fapl;
-
- /* Set the FAPL for the type of format */
- if (new_format) {
- HDputs("\nTesting with new file format:");
- my_fapl = fapl2;
- }
- else {
- HDputs("Testing with old file format:");
- my_fapl = fapl;
- }
-
- /* Create the file for this test */
- if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
-
- /* Test dynamically loaded filters for chunked dataset */
- nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0);
-
- /* Test dynamically loaded filters for groups */
- nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0);
-
- if (H5Fclose(file) < 0)
- TEST_ERROR
- } /* end for */
-
- /* Close FAPL */
- if (H5Pclose(fapl2) < 0)
- TEST_ERROR
- if (H5Pclose(fapl) < 0)
- TEST_ERROR
-
- /* Restore the default error handler (set in h5_reset()) */
- h5_restore_err();
-
- HDputs("\nTesting reading data with with dynamic plugin filters:");
-
- /* Close the library so that all loaded plugin libraries are unloaded */
- h5_reset();
- if ((fapl = h5_fileaccess()) < 0)
- TEST_ERROR
-
- /* Reopen the file for testing data reading */
- if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
- TEST_ERROR
-
- /* Read the data with filters */
- nerrors += (test_read_with_filters(file) < 0 ? 1 : 0);
-
- /* Open the groups with filters */
- nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0);
-
- /* Restore the default error handler (set in h5_reset()) */
- h5_restore_err();
-
- /* Close the library so that all loaded plugin libraries are unloaded */
- h5_reset();
- if ((fapl = h5_fileaccess()) < 0)
- TEST_ERROR
-
- /* Reopen the file for testing data reading */
- if ((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
- TEST_ERROR
-
- /* Read the data with disabled filters */
- nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0);
-
- if (H5Fclose(file) < 0)
- TEST_ERROR
-
- /* Test the APIs for access to the filter plugin path table */
- nerrors += (test_path_api_calls() < 0 ? 1 : 0);
-
- if (nerrors)
- TEST_ERROR
-
- HDprintf("All plugin tests passed.\n");
- h5_cleanup(FILENAME, fapl);
-
- HDexit(EXIT_SUCCESS);
-
-error:
- nerrors = MAX(1, nerrors);
- HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
- HDexit(EXIT_FAILURE);
-} /* end main() */
-
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 b9536e5..171fd05 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 */
@@ -358,11 +358,11 @@ static int do_ranks( hid_t fapl, hbool_t new_format )
/* Iterate over different index types, but only if using the new format
*/
- for(index_type = RANK4_INDEX_BTREE; index_type < RANK4_NINDICES; H5_INC_ENUM(rank4_index_t, index_type)) {
+ for(index_type = RANK4_INDEX_BTREE; index_type < RANK4_NINDICES; index_type++) {
/* 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;
@@ -427,20 +427,50 @@ error:
*/
static int do_layouts( hid_t fapl )
{
+ hid_t new_fapl = -1;
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Generic return value */
- TESTING("storage layout use");
+ TESTING("storage layout use - tested with all low/high library format bounds");
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
- if (test_layouts( H5D_COMPACT, fapl ) < 0)
- goto error;
+ /* Copy plist to use locally to avoid modifying the original */
+ new_fapl = H5Pcopy(fapl);
- if (test_layouts( H5D_CONTIGUOUS, fapl ) < 0)
- goto error;
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ {
+ if (H5Pclose(new_fapl) < 0)
+ goto error;
+ continue;
+ }
+
+ if (test_layouts( H5D_COMPACT, new_fapl ) < 0)
+ goto error;
+
+ if (test_layouts( H5D_CONTIGUOUS, new_fapl ) < 0)
+ goto error;
+
+ if (H5Pclose(new_fapl) < 0)
+ goto error;
+ } /* end for high */
+ } /* end for low */
PASSED();
return 0;
error:
+ H5E_BEGIN_TRY
+ {
+ H5Pclose(new_fapl);
+ } H5E_END_TRY;
return -1;
}
@@ -528,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)
@@ -568,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 */
@@ -640,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 */
@@ -684,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 */
@@ -790,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
}
@@ -852,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
}
@@ -944,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
}
@@ -978,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
*
@@ -1037,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
@@ -1150,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
*-------------------------------------------------------------------------
@@ -1190,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
}
}
@@ -1235,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
@@ -1272,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
}
@@ -1283,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
}
@@ -1553,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
}
@@ -1587,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
}
@@ -1793,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
*
@@ -1850,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;
}
}
@@ -2013,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
*
@@ -2050,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
}
@@ -2132,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
@@ -2185,208 +1931,171 @@ 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();
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
}
@@ -2397,39 +2106,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
}
@@ -2438,123 +2139,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;
}
@@ -2979,7 +2657,7 @@ static int test_random_rank4_vl( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue,
} /* end else */
/* Free read buffer */
- if(H5Dvlen_reclaim(type, mspace, H5P_DEFAULT, rbuf) < 0)
+ if(H5Treclaim(type, mspace, H5P_DEFAULT, rbuf) < 0)
TEST_ERROR
} /* end if */
@@ -2999,7 +2677,7 @@ static int test_random_rank4_vl( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue,
/* Close */
if(H5Sselect_all(mspace) < 0)
TEST_ERROR
- if(H5Dvlen_reclaim(type, mspace, H5P_DEFAULT, wbuf) < 0)
+ if(H5Treclaim(type, mspace, H5P_DEFAULT, wbuf) < 0)
TEST_ERROR
free(fill_value.p);
if(H5Sclose(mspace) < 0)
@@ -3047,16 +2725,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 97abc16..215d748 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",
@@ -70,25 +70,27 @@ const char *FILENAME[] = {
#define GCPL_ON_ROOT_MAX_COMPACT 4
#define GCPL_ON_ROOT_MIN_DENSE 2
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Definitions for 'old_api' test */
#define OLD_API_GROUP "/old_api"
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Definitions for 'corrupt_stab_msg' test */
#define CORRUPT_STAB_FILE "corrupt_stab_msg.h5"
#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 +98,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 +127,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 +155,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 +179,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 +200,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 +228,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 +254,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 +277,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 +293,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 +320,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 */
- H5O_info_t oinfo; /* Object info */
+ 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_native_info_t ninfo; /* 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 +387,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 +404,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 */
@@ -419,14 +421,14 @@ lifecycle(hid_t fcpl, hid_t fapl2)
if(H5G__is_new_dense_test(gid) != FALSE) TEST_ERROR
/* Check that the object header is only one chunk and the space has been allocated correctly */
- if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR
- if(oinfo.hdr.space.total != 151) TEST_ERROR
- if(oinfo.hdr.space.free != 0) TEST_ERROR
- if(oinfo.hdr.nmesgs != 6) TEST_ERROR
- if(oinfo.hdr.nchunks != 1) TEST_ERROR
+ if(H5Oget_native_info(gid, &ninfo, H5O_NATIVE_INFO_HDR) < 0) TEST_ERROR
+ if(ninfo.hdr.space.total != 151) TEST_ERROR
+ if(ninfo.hdr.space.free != 0) TEST_ERROR
+ if(ninfo.hdr.nmesgs != 6) TEST_ERROR
+ if(ninfo.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 */
@@ -441,15 +443,15 @@ lifecycle(hid_t fcpl, hid_t fapl2)
if(H5G__is_new_dense_test(gid) != TRUE) TEST_ERROR
/* Check that the object header is still one chunk and the space has been allocated correctly */
- if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR
- if(oinfo.hdr.space.total != 151) TEST_ERROR
- if(oinfo.hdr.space.free != 92) TEST_ERROR
- if(oinfo.hdr.nmesgs != 3) TEST_ERROR
- if(oinfo.hdr.nchunks != 1) TEST_ERROR
+ if(H5Oget_native_info(gid, &ninfo, H5O_NATIVE_INFO_HDR) < 0) TEST_ERROR
+ if(ninfo.hdr.space.total != 151) TEST_ERROR
+ if(ninfo.hdr.space.free != 92) TEST_ERROR
+ if(ninfo.hdr.nmesgs != 3) TEST_ERROR
+ if(ninfo.hdr.nchunks != 1) TEST_ERROR
/* 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 +464,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 +474,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 +507,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 +534,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 +640,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 +651,7 @@ error:
return 1;
} /* end long_compact() */
-
+
/*-------------------------------------------------------------------------
* Function: read_old
*
@@ -691,7 +693,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 +711,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 +732,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 +757,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 +804,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 +819,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 +845,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 +871,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 +964,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 +992,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 +1051,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 +1059,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 +1138,24 @@ corrupt_stab_msg(void)
error:
H5E_BEGIN_TRY {
- H5Dclose(did);
- H5Fclose(fid);
+ H5Dclose(did);
+ H5Fclose(fid);
} H5E_END_TRY;
return 1;
-} /* end old_api() */
+} /* 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 +1165,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 +1193,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 +1243,7 @@ main(void)
if(nerrors)
goto error;
- puts("All symbol table tests passed.");
+ HDputs("All symbol table tests passed.");
/* Cleanup */
if (GetTestCleanup()) {
@@ -1253,7 +1255,7 @@ main(void)
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
return 1;
}
diff --git a/test/swmr.c b/test/swmr.c
index 3b1bd09..bab91bd 100644
--- a/test/swmr.c
+++ b/test/swmr.c
@@ -24,9 +24,9 @@
*
*************************************************************/
-#include "hdf5.h"
#include "h5test.h"
#include "H5Iprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
/*
* This file needs to access private information from the H5F package.
@@ -1169,7 +1169,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if((f = (H5F_t *)H5I_object(fid)) == NULL)
+ if((f = (H5F_t *)H5VL_object(fid)) == NULL)
FAIL_STACK_ERROR
/*
@@ -1327,7 +1327,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if((f = (H5F_t *)H5I_object(fid)) == NULL)
+ if((f = (H5F_t *)H5VL_object(fid)) == NULL)
FAIL_STACK_ERROR
/* File's superblock: log retry 1 for 1 time */
@@ -1431,7 +1431,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object for fid */
- if((f = (H5F_t *)H5I_object(fid)) == NULL)
+ if((f = (H5F_t *)H5VL_object(fid)) == NULL)
FAIL_STACK_ERROR
/* Re-open fid */
@@ -1439,7 +1439,7 @@ test_metadata_read_retry_info(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object for fid1 */
- if((f1 = (H5F_t *)H5I_object(fid1)) == NULL)
+ if((f1 = (H5F_t *)H5VL_object(fid1)) == NULL)
FAIL_STACK_ERROR
/* For fid: fixed array data block page--log retry 9 for 500 times */
@@ -3016,7 +3016,7 @@ test_start_swmr_write_stress_ohdr(hid_t in_fapl)
/* Retrieve the chunk # for the dataspace message */
chunk_num = UINT_MAX;
- if(H5O_msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
+ if(H5O__msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
FAIL_STACK_ERROR;
/* Should be in chunk #0 for now */
if(0 != chunk_num)
@@ -3073,7 +3073,7 @@ test_start_swmr_write_stress_ohdr(hid_t in_fapl)
/* Retrieve the chunk # for the dataspace message */
chunk_num = UINT_MAX;
- if(H5O_msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
+ if(H5O__msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0)
FAIL_STACK_ERROR;
/* Should be in chunk #0 for now */
if(1 != chunk_num)
@@ -6289,7 +6289,7 @@ test_bug_refresh(hid_t in_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = (H5F_t *)H5I_object(fid)))
+ if(NULL == (f = (H5F_t *)H5VL_object(fid)))
FAIL_STACK_ERROR
/* Create groups: compact to dense storage */
@@ -6485,106 +6485,104 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
if(childpid == 0) { /* Child process */
hid_t child_fid1 = -1; /* File ID */
hid_t child_fid2 = -1; /* File ID */
- hid_t child_did1 = -1, child_did2 = -1;
- hid_t child_sid = -1;
- hsize_t tdims[1];
- int rbuf[2] = {0, 0};
- int child_notify = 0;
+ hid_t child_did1 = -1, child_did2 = -1;
+ hid_t child_sid = -1;
+ hsize_t tdims[1];
+ int rbuf[2] = {0, 0};
+ int child_notify = 0;
- /* Close unused write end for out_pdf */
- if(HDclose(out_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close unused write end for out_pdf */
+ if(HDclose(out_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- /* close unused read end for in_pdf */
- if(HDclose(in_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
+ /* close unused read end for in_pdf */
+ if(HDclose(in_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 1) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 1)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the file 2 times */
- if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the file 2 times */
+ if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
- HDexit(EXIT_FAILURE);
+ if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Open the dataset 2 times */
- if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
- if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Open the dataset 2 times */
+ if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
+ if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace via did1 */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
- if(tdims[0] != 1)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace via did1 */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
+ if(tdims[0] != 1)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset via did2 */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset via did2 */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 99)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 99)
+ HDexit(EXIT_FAILURE);
- /* Notify parent process */
- child_notify = 2;
- if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
+ /* Notify parent process */
+ child_notify = 2;
+ if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Wait for notification from parent process */
- while(child_notify != 3) {
- if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
- HDexit(EXIT_FAILURE);
- }
+ /* Wait for notification from parent process */
+ while(child_notify != 3)
+ if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0)
+ HDexit(EXIT_FAILURE);
- /* Refresh dataset via did1 */
- if(H5Drefresh(child_did1) < 0)
- HDexit(EXIT_FAILURE);
+ /* Refresh dataset via did1 */
+ if(H5Drefresh(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
- /* Get the dataset's dataspace and verify */
- if((child_sid = H5Dget_space(child_did1)) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
- HDexit(EXIT_FAILURE);
+ /* Get the dataset's dataspace and verify */
+ if((child_sid = H5Dget_space(child_did1)) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0)
+ HDexit(EXIT_FAILURE);
- if(tdims[0] != 2)
- HDexit(EXIT_FAILURE);
+ if(tdims[0] != 2)
+ HDexit(EXIT_FAILURE);
- /* Read from the dataset */
- if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
- HDexit(EXIT_FAILURE);
+ /* Read from the dataset */
+ if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0)
+ HDexit(EXIT_FAILURE);
- /* Verify the data is correct */
- if(rbuf[0] != 100 || rbuf[1] != 100)
- HDexit(EXIT_FAILURE);
+ /* Verify the data is correct */
+ if(rbuf[0] != 100 || rbuf[1] != 100)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 datasets */
- if(H5Dclose(child_did1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Dclose(child_did2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 datasets */
+ if(H5Dclose(child_did1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Dclose(child_did2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the 2 files */
- if(H5Fclose(child_fid1) < 0)
- HDexit(EXIT_FAILURE);
- if(H5Fclose(child_fid2) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the 2 files */
+ if(H5Fclose(child_fid1) < 0)
+ HDexit(EXIT_FAILURE);
+ if(H5Fclose(child_fid2) < 0)
+ HDexit(EXIT_FAILURE);
- /* Close the pipes */
- if(HDclose(out_pdf[0]) < 0)
- HDexit(EXIT_FAILURE);
- if(HDclose(in_pdf[1]) < 0)
- HDexit(EXIT_FAILURE);
+ /* Close the pipes */
+ if(HDclose(out_pdf[0]) < 0)
+ HDexit(EXIT_FAILURE);
+ if(HDclose(in_pdf[1]) < 0)
+ HDexit(EXIT_FAILURE);
- HDexit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
}
/* Close unused read end for out_pdf */
@@ -6619,8 +6617,8 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format)
/* Wait for notification from child process */
while(notify != 2) {
- if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
- FAIL_STACK_ERROR;
+ if(HDread(in_pdf[0], &notify, sizeof(int)) < 0)
+ FAIL_STACK_ERROR;
}
/* Cork the metadata cache, to prevent the object header from being
@@ -7043,8 +7041,8 @@ main(void)
* by the environment variable.
*/
driver = HDgetenv("HDF5_DRIVER");
- if(!H5FD_supports_swmr_test(driver)) {
- printf("This VFD does not support SWMR I/O\n");
+ if(!H5FD__supports_swmr_test(driver)) {
+ HDprintf("This VFD does not support SWMR I/O\n");
return EXIT_SUCCESS;
} /* end if */
@@ -7134,7 +7132,7 @@ main(void)
if(nerrors)
goto error;
- printf("All tests passed.\n");
+ HDprintf("All tests passed.\n");
h5_cleanup(FILENAME, fapl);
@@ -7142,7 +7140,7 @@ main(void)
error:
nerrors = MAX(1, nerrors);
- printf("***** %d SWMR TEST%s FAILED! *****\n",
+ HDprintf("***** %d SWMR TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c
index 51caa3d..71e4929 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[])
@@ -337,7 +337,7 @@ int main(int argc, const char *argv[])
verbose = 0;
u++;
break;
-
+
/* Random # seed */
case 'r':
use_seed = 1;
@@ -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_check_compat_vfd.c b/test/swmr_check_compat_vfd.c
index 1589f6e..9b4fbb5 100644
--- a/test/swmr_check_compat_vfd.c
+++ b/test/swmr_check_compat_vfd.c
@@ -13,7 +13,7 @@
/* Purpose: This is a small program that checks if the HDF5_DRIVER
* environment variable is set to a value that supports SWMR.
- *
+ *
* It is intended for use in shell scripts.
*/
@@ -46,7 +46,7 @@ main(void)
driver = HDgetenv("HDF5_DRIVER");
- if(H5FD_supports_swmr_test(driver))
+ if(H5FD__supports_swmr_test(driver))
return EXIT_SUCCESS;
else
return EXIT_FAILURE;
diff --git a/test/swmr_common.c b/test/swmr_common.c
index a0d79e3..7ae1fad 100644
--- a/test/swmr_common.c
+++ b/test/swmr_common.c
@@ -26,6 +26,7 @@
#include "h5test.h"
#include "swmr_common.h"
+#include "vds_swmr.h"
/*******************/
/* Local Variables */
@@ -73,7 +74,28 @@ unsigned symbol_count[NLEVELS] = {100, 200, 400, 800, 1600};
/* Array of dataset information entries (1 per dataset) */
symbol_info_t *symbol_info[NLEVELS];
-
+hsize_t PLANES[N_SOURCES][RANK] = {
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH}
+};
+
+char FILE_NAMES[N_SOURCES][NAME_LEN] = {
+ {"vds_swmr_src_a.h5"},
+ {"vds_swmr_src_b.h5"},
+ {"vds_swmr_src_c.h5"},
+ {"vds_swmr_src_d.h5"},
+ {"vds_swmr_src_e.h5"},
+ {"vds_swmr_src_f.h5"}
+};
+
+char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
+char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
+
/*-------------------------------------------------------------------------
* Function: choose_dataset
*
@@ -101,7 +123,7 @@ choose_dataset(void)
return &symbol_info[level][offset];
} /* end choose_dataset() */
-
+
/*-------------------------------------------------------------------------
* Function: create_symbol_datatype
*
@@ -142,7 +164,7 @@ create_symbol_datatype(void)
return sym_type_id;
} /* end create_symbol_datatype() */
-
+
/*-------------------------------------------------------------------------
* Function: generate_name
*
@@ -161,7 +183,7 @@ create_symbol_datatype(void)
* The dataset's count
*
* Return: Success: 0
- *
+ *
* Failure: Can't fail
*
*-------------------------------------------------------------------------
@@ -170,13 +192,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 +232,7 @@ generate_symbols(void)
return 0;
} /* end generate_symbols() */
-
+
/*-------------------------------------------------------------------------
* Function: shutdown_symbols
*
@@ -238,7 +260,7 @@ shutdown_symbols(void)
return 0;
} /* end shutdown_symbols() */
-
+
/*-------------------------------------------------------------------------
* Function: print_metadata_retries_info
*
@@ -273,7 +295,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_common.h b/test/swmr_common.h
index 99d1cb2..a0bc581 100644
--- a/test/swmr_common.h
+++ b/test/swmr_common.h
@@ -26,7 +26,7 @@
#define NLEVELS 5 /* # of datasets in the SWMR test file */
-#define NMAPPING 9
+#define NMAPPING 9
#define FILENAME "swmr_data.h5" /* SWMR test file name */
#define DTYPE_SIZE 150 /* Data size in opaque type */
diff --git a/test/swmr_generator.c b/test/swmr_generator.c
index 1c2ec04..f6a4fe2 100644
--- a/test/swmr_generator.c
+++ b/test/swmr_generator.c
@@ -230,12 +230,12 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t swmr_write,
unsigned chunk_num; /* Object header chunk # for dataspace message */
/* Move the dataspace message to a new object header chunk */
- if(H5O_msg_move_to_new_chunk_test(dsid, H5O_SDSPACE_ID) < 0)
+ if(H5O__msg_move_to_new_chunk_test(dsid, H5O_SDSPACE_ID) < 0)
return -1;
/* Retrieve the chunk # for the dataspace message */
chunk_num = UINT_MAX;
- if(H5O_msg_get_chunkno_test(dsid, H5O_SDSPACE_ID, &chunk_num) < 0)
+ if(H5O__msg_get_chunkno_test(dsid, H5O_SDSPACE_ID, &chunk_num) < 0)
return -1;
/* Should not be in chunk #0 for now */
if(0 == chunk_num)
@@ -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[])
@@ -358,7 +358,7 @@ int main(int argc, const char *argv[])
HDfprintf(stderr, "\tcompression level = %d\n", comp_level);
HDfprintf(stderr, "\tindex type = %s\n", index_type);
} /* end if */
-
+
/* Set the random seed */
if(!use_seed) {
struct timeval t;
@@ -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..ee263e3 100644
--- a/test/swmr_reader.c
+++ b/test/swmr_reader.c
@@ -329,7 +329,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file,
/* Emit informational message */
if(verbose)
HDfprintf(verbose_file, "Closing file\n");
-
+
/* Close the file */
if(H5Fclose(fid) < 0)
return -1;
@@ -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..b02d16f 100644
--- a/test/swmr_remove_reader.c
+++ b/test/swmr_remove_reader.c
@@ -359,19 +359,19 @@ 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..2bebab9 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[])
@@ -272,7 +272,7 @@ int main(int argc, const char *argv[])
verbose = 0;
u++;
break;
-
+
/* Random # seed */
case 'r':
use_seed = 1;
@@ -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..2d558df 100644
--- a/test/swmr_sparse_reader.c
+++ b/test/swmr_sparse_reader.c
@@ -115,7 +115,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
/* Emit informational message */
if(verbose)
- HDfprintf(stderr, "Symbol = '%s', location = %lld\n", symbol->name, (long long)start);
+ HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1]);
/* Read record from dataset */
record->rec_id = (uint64_t)ULLONG_MAX;
@@ -126,7 +126,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
if(record->rec_id != start[1]) {
HDfprintf(stderr, "*** ERROR ***\n");
HDfprintf(stderr, "Incorrect record value!\n");
- HDfprintf(stderr, "Symbol = '%s', location = %lld, record->rec_id = %llu\n", symbol->name, (long long)start, (unsigned long long)record->rec_id);
+ HDfprintf(stderr, "Symbol = '%s', location = %" PRIuMAX ",%" PRIuMAX ", record->rec_id = %" PRIu64 "\n", symbol->name, (uintmax_t)start[0], (uintmax_t)start[1], record->rec_id);
return -1;
} /* end if */
@@ -162,7 +162,7 @@ check_dataset(hid_t fid, unsigned verbose, const symbol_info_t *symbol, symbol_t
* The amount of time to sleep (s).
*
* unsigned reopen_count
- *
+ *
*
* Return: Success: 0
* Failure: -1
@@ -185,7 +185,7 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords,
HDassert(filename);
HDassert(poll_time != 0);
-
+
/* Create file access property list */
if((fapl = h5_fileaccess()) < 0)
return -1;
@@ -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 2d5c3f9..fc7e7a5 100644
--- a/test/swmr_start_write.c
+++ b/test/swmr_start_write.c
@@ -40,11 +40,6 @@ static hid_t create_file(const char *filename, hbool_t verbose,
FILE *verbose_file, unsigned random_seed);
static int create_datasets(hid_t fid, int comp_level, hbool_t verbose,
FILE *verbose_file, const char *index_type);
-static int create_close_datasets(hid_t fid, int comp_level, hbool_t verbose,
- FILE *verbose_file);
-static int open_datasets(hid_t fid, hbool_t verbose, FILE *verbose_file);
-static hid_t open_file(const char *filename, hbool_t verbose,
- FILE *verbose_file);
static int add_records(hid_t fid, hbool_t verbose, FILE *verbose_file,
unsigned long nrecords, unsigned long flush_count);
static void usage(void);
@@ -58,11 +53,11 @@ static void usage(void);
* Purpose: Creates the HDF5 file (without SWMR access) which
* which will be used for testing H5Fstart_swmr_write().
*
- * Parameters:
+ * Parameters:
* filename: The SWMR test file's name.
* verbose: whether verbose console output is desired.
* verbose_file: file pointer for verbose output
- * random_seed: The random seed to store in the file.
+ * random_seed: The random seed to store in the file.
* The sparse tests use this value.
*
* Return: Success: the file ID
@@ -139,10 +134,10 @@ create_file(const char *filename, hbool_t verbose, FILE *verbose_file,
/*-------------------------------------------------------------------------
* Function: create_datasets
*
- * Purpose: Create datasets (and keep them opened) which will be used for testing
+ * Purpose: Create datasets (and keep them opened) which will be used for testing
* H5Fstart_swmr_write().
*
- * Parameters:
+ * Parameters:
* fid: file ID for the SWMR test file
* comp_level: the compresssion level
* index_type: The chunk index type (b1 | b2 | ea | fa)
@@ -212,172 +207,12 @@ create_datasets(hid_t fid, int comp_level, hbool_t verbose, FILE *verbose_file,
/*-------------------------------------------------------------------------
- * Function: create_close_datasets
- *
- * Purpose: Create and close datasets which will be used for testing
- * H5Fstart_swmr_write().
- *
- * Parameters:
- * fid: file ID for the SWMR test file
- * comp_level: the compresssion level
- * verbose: whether verbose console output is desired.
- * verbose_file: file pointer for verbose output
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-create_close_datasets(hid_t fid, int comp_level, hbool_t verbose, FILE *verbose_file)
-{
- hid_t dcpl; /* Dataset creation property list */
- hid_t tid; /* Datatype for dataset elements */
- hid_t sid; /* Dataspace ID */
- hsize_t dims[2] = {1, 0}; /* Dataset starting dimensions */
- hsize_t max_dims[2] = {1, H5S_UNLIMITED}; /* Dataset maximum dimensions */
- hsize_t chunk_dims[2] = {1, CHUNK_SIZE}; /* Chunk dimensions */
- unsigned u, v; /* Local index variable */
-
- /* Create datatype for creating datasets */
- if((tid = create_symbol_datatype()) < 0)
- return -1;
-
- /* Create dataspace for creating datasets */
- if((sid = H5Screate_simple(2, dims, max_dims)) < 0)
- return -1;
-
- /* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- return -1;
- if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0)
- return -1;
- if(comp_level >= 0) {
- if(H5Pset_deflate(dcpl, (unsigned)comp_level) < 0)
- return -1;
- } /* end if */
-
- /* Emit informational message */
- if(verbose)
- HDfprintf(verbose_file, "Creating datasets\n");
-
- /* Create the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++) {
- hid_t dsid; /* Dataset ID */
- char name_buf[64];
-
- generate_name(name_buf, u, v);
- if((dsid = H5Dcreate2(fid, name_buf, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- return -1;
-
- if(H5Dclose(dsid) < 0)
- return -1;
- } /* end for */
-
- /* Closing */
- if(H5Pclose(dcpl) < 0)
- return -1;
- if(H5Sclose(sid) < 0)
- return -1;
- if(H5Tclose(tid) < 0)
- return -1;
-
- return 0;
-} /* create_close_datasets() */
-
-
-/*-------------------------------------------------------------------------
- * Function: open_file
- *
- * Purpose: Opens the HDF5 test file without SWMR access.
- *
- * Parameters:
- * filename: The filename of the HDF5 file to open
- * verbose: whether or not to emit verbose console messages
- * verbose_file: file pointer for verbose output
- *
- * Return: Success: The file ID of the opened SWMR file
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static hid_t
-open_file(const char *filename, hbool_t verbose, FILE *verbose_file)
-{
- hid_t fid; /* File ID for new HDF5 file */
- hid_t fapl; /* File access property list */
-
- HDassert(filename);
-
- /* Create file access property list */
- if((fapl = h5_fileaccess()) < 0)
- return -1;
-
- /* Set to use the latest library format */
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
-
- /* Emit informational message */
- if(verbose)
- HDfprintf(verbose_file, "Opening the file without SWMR access: %s\n", filename);
-
- /* Open the file */
- if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
- return -1;
-
- /* Close file access property list */
- if(H5Pclose(fapl) < 0)
- return -1;
-
- return fid;
-} /* Open file() */
-
-
-
-/*-------------------------------------------------------------------------
- * Function: open_datasets
- *
- * Purpose: Opens the datasets.
- *
- * Parameters:
- * filename: the filename of the SWMR HDF5 file to open
- * verbose: whether or not to emit verbose console messages
- * verbose_file: file pointer for verbose output
- *
- * Return: Success: 0
- * Failure: -1
- *
- *-------------------------------------------------------------------------
- */
-static int
-open_datasets(hid_t fid, hbool_t verbose, FILE *verbose_file)
-{
- unsigned u, v; /* Local index variable */
-
- /* Emit informational message */
- if(verbose)
- HDfprintf(verbose_file, "Opening datasets\n");
-
- /* Open the datasets */
- for(u = 0; u < NLEVELS; u++)
- for(v = 0; v < symbol_count[u]; v++) {
- if((symbol_info[u][v].dsid = H5Dopen2(fid, symbol_info[u][v].name, H5P_DEFAULT)) < 0)
- return -1;
- symbol_info[u][v].nrecords = 0;
- } /* end for */
-
- return 0;
-} /* open_datasets() */
-
-
-/*-------------------------------------------------------------------------
* Function: add_records
*
* Purpose: Writes a specified number of records to random datasets in
* the SWMR test file.
*
- * Parameters:
+ * Parameters:
* fid: The file ID of the SWMR HDF5 file
* verbose: Whether or not to emit verbose console messages
* verbose_file: file pointer for verbose output
@@ -502,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() */
/*
@@ -584,7 +419,7 @@ int main(int argc, const char *argv[])
verbose = FALSE;
u++;
break;
-
+
/* Random # seed */
case 'r':
use_seed = TRUE;
@@ -633,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 */
@@ -652,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 */
@@ -666,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 */
@@ -685,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 */
@@ -695,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 */
@@ -705,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..d4387aa 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[])
@@ -328,7 +328,7 @@ int main(int argc, const char *argv[])
verbose = FALSE;
u++;
break;
-
+
/* Random # seed */
case 'r':
use_seed = TRUE;
@@ -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 a35b8a3..e643fb0 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: tarray
+* Test program: tarray
*
* Test the Array Datatype functionality
*
@@ -22,14 +22,12 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "hdf5.h"
-
#define FILENAME "tarray1.h5"
#define TESTFILE "tarrold.h5"
/* 1-D array datatype */
-#define ARRAY1_RANK 1
-#define ARRAY1_DIM1 4
+#define ARRAY1_RANK 1
+#define ARRAY1_DIM1 4
/* 3-D array datatype */
#define ARRAY2_RANK 3
@@ -67,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
*
@@ -191,7 +189,7 @@ test_array_atomic_1d(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_atomic_1d() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_funcs
*
@@ -254,7 +252,7 @@ test_array_funcs(void)
CHECK(ret, FAIL, "H5Tclose");
} /* end test_array_funcs() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_atomic_3d
*
@@ -383,7 +381,7 @@ test_array_atomic_3d(void)
} /* end test_array_atomic_3d() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_array_atomic
*
@@ -542,7 +540,7 @@ test_array_array_atomic(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_array_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_compound_atomic
*
@@ -679,7 +677,7 @@ test_array_compound_atomic(void)
/* Check the 1st field's name */
mname = H5Tget_member_name(tid2, 0);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname, "i") != 0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname);
H5free_memory(mname);
@@ -698,7 +696,7 @@ test_array_compound_atomic(void)
/* Check the 2nd field's name */
mname = H5Tget_member_name(tid2, 1);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname, "f") != 0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n", mname);
H5free_memory(mname);
@@ -749,7 +747,7 @@ test_array_compound_atomic(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_array_compound_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_compound_array
*
@@ -897,7 +895,7 @@ test_array_compound_array(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid2,0);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
H5free_memory(mname);
@@ -916,7 +914,7 @@ test_array_compound_array(void)
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid2,1);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
H5free_memory(mname);
@@ -1008,7 +1006,7 @@ test_array_compound_array(void)
** allocated.
**
****************************************************************/
-
+
/*-------------------------------------------------------------------------
* Function: test_array_alloc_custom
*
@@ -1047,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
*
@@ -1076,14 +1074,14 @@ test_array_free_custom(void *_mem, void *info)
if(_mem != NULL) {
mem = ((unsigned char *)_mem) - extra;
- *mem_used -= *(size_t *)mem;
+ *mem_used -= *(size_t *)((void *)mem);
HDfree(mem);
} /* end if */
return;
} /* end test_array_free_custom() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_vlen_atomic
*
@@ -1270,15 +1268,15 @@ test_array_vlen_atomic(void)
} /* end for */
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
@@ -1298,7 +1296,7 @@ test_array_vlen_atomic(void)
} /* end test_array_vlen_atomic() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_vlen_array
*
@@ -1343,7 +1341,7 @@ test_array_vlen_array(void)
for(k=0; k<(i+j+1); k++)
for(l=0; l<ARRAY1_DIM1; l++)
((unsigned int *)wdata[i][j].p)[k*ARRAY1_DIM1+l] = (unsigned int)(i*1000+j*100+k*10+l);
- } /* end for */
+ }
/* Create file */
fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1525,15 +1523,15 @@ test_array_vlen_array(void)
} /* end for */
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close dataset transfer property list */
ret = H5Pclose(xfer_pid);
@@ -1553,7 +1551,7 @@ test_array_vlen_array(void)
} /* end test_array_vlen_array() */
-
+
/*-------------------------------------------------------------------------
* Function: test_array_bkg
*
@@ -1582,9 +1580,9 @@ test_array_bkg(void)
unsigned ndims[3] = {1,1,1};
typedef struct {
- int a[ALEN];
- float b[ALEN];
- double c[ALEN];
+ int a[ALEN];
+ float b[ALEN];
+ double c[ALEN];
} CmpField;
CmpField cf[LENGTH];
@@ -1604,7 +1602,7 @@ test_array_bkg(void)
/* Initialize the data */
/* ------------------- */
dtsinfo = (CmpDTSinfo *)HDmalloc(sizeof(CmpDTSinfo));
- CHECK(dtsinfo, NULL, "HDmalloc");
+ CHECK_PTR(dtsinfo, "HDmalloc");
HDmemset(dtsinfo, 0, sizeof(CmpDTSinfo));
for (i = 0; i < LENGTH; i++) {
for (j = 0; j < ALEN; j++) {
@@ -1857,7 +1855,7 @@ test_array_bkg(void)
HDfree(dtsinfo);
} /* end test_array_bkg() */
-
+
/*-------------------------------------------------------------------------
* Function: test_compat
*
@@ -1927,7 +1925,7 @@ test_compat(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid1,0);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
H5free_memory(mname);
@@ -1946,7 +1944,7 @@ test_compat(void)
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid1,1);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
H5free_memory(mname);
@@ -1965,7 +1963,7 @@ test_compat(void)
/* Check the 3rd field's name */
mname=H5Tget_member_name(tid1,2);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
H5free_memory(mname);
@@ -2009,7 +2007,7 @@ test_compat(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid1,0);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
if(mname) H5free_memory(mname);
@@ -2028,7 +2026,7 @@ test_compat(void)
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid1,1);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
if(mname) H5free_memory(mname);
@@ -2073,7 +2071,7 @@ test_compat(void)
/* Check the 3rd field's name */
mname=H5Tget_member_name(tid1,2);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
if(mname) H5free_memory(mname);
@@ -2118,7 +2116,7 @@ test_compat(void)
/* Check the 4th field's name */
mname=H5Tget_member_name(tid1,3);
- CHECK(mname, NULL, "H5Tget_member_name");
+ CHECK_PTR(mname, "H5Tget_member_name");
if(mname && HDstrcmp(mname,"d")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
if(mname) H5free_memory(mname);
@@ -2148,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
*
@@ -2185,7 +2183,7 @@ test_array(void)
} /* end test_array() */
-
+
/*-------------------------------------------------------------------------
* Function: cleanup_array
*
diff --git a/test/tattr.c b/test/tattr.c
index 3b0c90e..dab03a7 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -13,39 +13,38 @@
/***********************************************************
*
-* Test program: tattr
+* Test program: tattr
*
* Test the attribute functionality
*
*************************************************************/
#include "testhdf5.h"
-#include "h5test.h"
-#include "hdf5.h"
+#include "H5VLnative_private.h"
/*
* This file needs to access private information from the H5O package.
* This file also needs to access the object header testing code.
*/
-#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
#define H5O_TESTING
-#include "H5Opkg.h" /* Object headers */
+#include "H5Opkg.h" /* Object headers */
/*
* This file needs to access private information from the H5A package.
* This file also needs to access the attribute testing code.
*/
-#define H5A_FRIEND /*suppress error about including H5Apkg */
+#define H5A_FRIEND /*suppress error about including H5Apkg */
#define H5A_TESTING
-#include "H5Apkg.h" /* Attributes */
+#include "H5Apkg.h" /* Attributes */
/*
* This file needs to access private information from the H5F package.
* This file also needs to access the file testing code.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
+#include "H5Fpkg.h" /* File access */
#define FILENAME "tattr.h5"
#define NAME_BUF_SIZE 1024
@@ -55,10 +54,10 @@
#define CORDER_ITER_STOP 3
/* 3-D dataset with fixed dimensions */
-#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
/* Dataset Information */
#define DSET1_NAME "Dataset1"
@@ -76,8 +75,8 @@
/* Attribute Rank & Dimensions */
#define ATTR1_NAME "Attr1"
-#define ATTR1_RANK 1
-#define ATTR1_DIM1 3
+#define ATTR1_RANK 1
+#define ATTR1_DIM1 3
int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */
/* rank & dimensions for another attribute */
@@ -85,25 +84,25 @@ int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */
int attr_data1a[ATTR1_DIM1]={256,11945,-22107};
#define ATTR2_NAME "Attr2"
-#define ATTR2_RANK 2
-#define ATTR2_DIM1 2
-#define ATTR2_DIM2 2
+#define ATTR2_RANK 2
+#define ATTR2_DIM1 2
+#define ATTR2_DIM2 2
int attr_data2[ATTR2_DIM1][ATTR2_DIM2]={{7614,-416},{197814,-3}}; /* Test data for 2nd attribute */
#define ATTR3_NAME "Attr3"
-#define ATTR3_RANK 3
-#define ATTR3_DIM1 2
-#define ATTR3_DIM2 2
-#define ATTR3_DIM3 2
+#define ATTR3_RANK 3
+#define ATTR3_DIM1 2
+#define ATTR3_DIM2 2
+#define ATTR3_DIM3 2
double attr_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3]={{{2.3F,-26.1F}, {0.123F,-10.0F}},{{973.23F,-0.91827F},{2.0F,23.0F}}}; /* Test data for 3rd attribute */
#define ATTR4_NAME "Attr4"
-#define ATTR4_RANK 2
-#define ATTR4_DIM1 2
-#define ATTR4_DIM2 2
-#define ATTR4_FIELDNAME1 "i"
-#define ATTR4_FIELDNAME2 "d"
-#define ATTR4_FIELDNAME3 "c"
+#define ATTR4_RANK 2
+#define ATTR4_DIM1 2
+#define ATTR4_DIM2 2
+#define ATTR4_FIELDNAME1 "i"
+#define ATTR4_FIELDNAME2 "d"
+#define ATTR4_FIELDNAME3 "c"
size_t attr4_field1_off=0;
size_t attr4_field2_off=0;
size_t attr4_field3_off=0;
@@ -115,13 +114,13 @@ struct attr4_struct {
{{-23,981724.2F,'Q'},{0,2.0F,'\n'}}}; /* Test data for 4th attribute */
#define ATTR5_NAME "Attr5"
-#define ATTR5_RANK 0
+#define ATTR5_RANK 0
float attr_data5=-5.123F; /* Test data for 5th attribute */
-#define ATTR6_RANK 3
-#define ATTR6_DIM1 100
-#define ATTR6_DIM2 100
-#define ATTR6_DIM3 100
+#define ATTR6_RANK 3
+#define ATTR6_DIM1 100
+#define ATTR6_DIM2 100
+#define ATTR6_DIM3 100
#define ATTR7_NAME "attr 1 - 000000"
#define ATTR8_NAME "attr 2"
@@ -138,6 +137,23 @@ float attr_data5=-5.123F; /* Test data for 5th attribute */
#define BUG3_DT_NAME "dt"
#define BUG3_ATTR_NAME "attr"
+/* Used by test_attr_delete_last_dense() */
+#define GRPNAME "grp"
+#define ATTRNAME "attr"
+#define DIM0 100
+#define DIM1 100
+#define RANK 2
+
+/* Used by test_attr_info_null_info_pointer() */
+#define GET_INFO_NULL_POINTER_ATTR_NAME "NullInfoPointerAttr"
+
+/* Used by test_attr_rename_invalid_name() */
+#define INVALID_RENAME_TEST_ATTR_NAME "InvalidRenameTestAttr"
+#define INVALID_RENAME_TEST_NEW_ATTR_NAME "InvalidRenameTestNewAttr"
+
+/* Used by test_attr_get_name_invalid_buf() */
+#define GET_NAME_INVALID_BUF_TEST_ATTR_NAME "InvalidNameBufferTestAttr"
+
/* Attribute iteration struct */
typedef struct {
H5_iter_order_t order; /* Direction of iteration */
@@ -152,8 +168,14 @@ typedef struct {
static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
void *op_data);
+/* Global dcpl ID, can be re-set as a generated dcpl for various operations
+ * across multiple tests.
+ * e.g., minimized dataset object headers
+ */
+static hid_t dcpl_g = H5P_DEFAULT;
+
+
-
/****************************************************************
**
** test_attr_basic_write(): Test basic H5A (attribute) code.
@@ -163,21 +185,21 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo,
static void
test_attr_basic_write(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t group; /* Group ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr, attr2; /* Attribute ID */
- hsize_t attr_size; /* storage size for attribute */
- ssize_t attr_name_size; /* size of attribute name */
- char *attr_name=NULL; /* name of attribute */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR1_DIM1};
- hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
- int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */
- int i;
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t attr, attr2; /* Attribute ID */
+ hsize_t attr_size; /* storage size for attribute */
+ ssize_t attr_name_size; /* size of attribute name */
+ char *attr_name=NULL; /* name of attribute */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR1_DIM1};
+ hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
+ int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */
+ int i;
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Scalar Attribute Writing Functions\n"));
@@ -191,7 +213,7 @@ test_attr_basic_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@@ -277,8 +299,8 @@ test_attr_basic_write(hid_t fapl)
if(attr_name_size > 0) {
attr_name = (char*)HDcalloc((size_t)(attr_name_size + 1), sizeof(char));
- CHECK(attr_name, NULL, "HDcalloc");
-
+ CHECK_PTR(attr_name, "HDcalloc");
+
if(attr_name) {
ret = (herr_t)H5Aget_name(attr, (size_t)(attr_name_size + 1), attr_name);
CHECK(ret, FAIL, "H5Aget_name");
@@ -313,8 +335,8 @@ test_attr_basic_write(hid_t fapl)
if(attr_name_size > 0) {
attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char));
- CHECK(attr_name, NULL, "HDcalloc");
-
+ CHECK_PTR(attr_name, "HDcalloc");
+
if(attr_name) {
ret = (herr_t)H5Aget_name(attr2, (size_t)(attr_name_size + 1), attr_name);
CHECK(ret, FAIL, "H5Aget_name");
@@ -393,7 +415,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.
@@ -402,15 +424,15 @@ test_attr_basic_write(hid_t fapl)
static void
test_attr_basic_read(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t group; /* Group ID */
- hid_t attr; /* Attribute ID */
- H5O_info_t oinfo; /* Object info */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t attr; /* Attribute ID */
+ H5O_info2_t oinfo; /* Object info */
int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */
int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */
- int i, j; /* Local index variables */
- herr_t ret; /* Generic return value */
+ int i, j; /* Local index variables */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
@@ -424,9 +446,9 @@ test_attr_basic_read(hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 2, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 2, "H5Oget_info3");
/* Open first attribute for the dataset */
attr = H5Aopen(dataset, ATTR_TMP_NAME, H5P_DEFAULT);
@@ -453,9 +475,9 @@ test_attr_basic_read(hid_t fapl)
CHECK(group, FAIL, "H5Gopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(group, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 1, "H5Oget_info");
+ ret = H5Oget_info3(group, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 1, "H5Oget_info3");
/* Open the attribute for the group */
attr = H5Aopen(group, ATTR2_NAME, H5P_DEFAULT);
@@ -484,7 +506,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
@@ -500,7 +522,7 @@ test_attr_flush(hid_t fapl)
set; /* Dataset ID */
double wdata=3.14159F; /* Data to write */
double rdata; /* Data read in */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Flushing\n"));
@@ -511,7 +533,7 @@ test_attr_flush(hid_t fapl)
spc = H5Screate(H5S_SCALAR);
CHECK(spc, FAIL, "H5Screate");
- set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(set, FAIL, "H5Dcreate2");
att = H5Acreate2(set, ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT);
@@ -520,7 +542,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!H5_DBL_ABS_EQUAL(rdata, H5_DOUBLE(0.0)))
+ if(!H5_DBL_ABS_EQUAL(rdata, 0.0))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Fflush(fil, H5F_SCOPE_GLOBAL);
@@ -529,7 +551,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
- if(!H5_DBL_ABS_EQUAL(rdata, H5_DOUBLE(0.0)))
+ if(!H5_DBL_ABS_EQUAL(rdata, 0.0))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata);
@@ -551,7 +573,7 @@ test_attr_flush(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_flush() */
-
+
/****************************************************************
**
** test_attr_plist(): Test Attribute Creation Property Lists
@@ -560,111 +582,122 @@ test_attr_flush(hid_t fapl)
static void
test_attr_plist(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t plist; /* Property list ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR1_DIM1};
- H5T_cset_t cset; /* Character set for attributes */
- herr_t ret; /* Generic return value */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t dsid = H5I_INVALID_HID; /* Dataspace ID (for dataset) */
+ hid_t asid = H5I_INVALID_HID; /* Dataspace ID (for attribute) */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t acpl_id = H5I_INVALID_HID; /* Attribute creation property list ID */
+ hid_t aapl_id = H5I_INVALID_HID; /* Attribute access property list ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR1_DIM1};
+ H5T_cset_t cset; /* Character set for attributes */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Property Lists\n"));
/* Create file */
- fid1 = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for dataset */
- sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ dsid = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(dsid, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ did = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, dsid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Create dataspace for attribute */
- sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL);
- CHECK(sid2, FAIL, "H5Screate_simple");
+ asid = H5Screate_simple(ATTR1_RANK, dims2, NULL);
+ CHECK(asid, H5I_INVALID_HID, "H5Screate_simple");
- /* Create default property list for attribute */
- plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(plist, FAIL, "H5Pcreate");
+ /* Create default creation property list for attribute */
+ acpl_id = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create default access property list for attribute
+ * This currently has no properties, but we need to test its creation
+ * and use.
+ */
+ aapl_id = H5Pcreate(H5P_ATTRIBUTE_ACCESS);
+ CHECK(aapl_id, H5I_INVALID_HID, "H5Pcreate");
/* Get the character encoding and ensure that it is the default (ASCII) */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the property list */
- attr = H5Acreate2(dataset, ATTR1_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ aid = H5Acreate2(did, ATTR1_NAME, H5T_NATIVE_INT, asid, acpl_id, aapl_id);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
- /* Close the property list, and get the attribute's property list */
- ret = H5Pclose(plist);
+ /* Close the property list, and get the attribute's creation property list */
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- plist = H5Aget_create_plist(attr);
- CHECK(plist, FAIL, "H5Aget_create_plist");
+ acpl_id = H5Aget_create_plist(aid);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Aget_create_plist");
/* Get the character encoding and ensure that it is the default (ASCII) */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_ASCII, "H5Pget_char_encoding");
/* Close the property list and attribute */
- ret = H5Pclose(plist);
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
/* Create a new property list and modify it to use a different encoding */
- plist = H5Pcreate(H5P_ATTRIBUTE_CREATE);
- CHECK(plist, FAIL, "H5Pcreate");
- ret = H5Pset_char_encoding(plist, H5T_CSET_UTF8);
+ acpl_id = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_char_encoding(acpl_id, H5T_CSET_UTF8);
CHECK(ret, FAIL, "H5Pset_char_encoding");
/* Get the character encoding and ensure that it has been changed */
- ret = H5Pget_char_encoding(plist, &cset);
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Create an attribute for the dataset using the modified property list */
- attr = H5Acreate2(dataset, ATTR2_NAME, H5T_NATIVE_INT, sid2, plist, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ aid = H5Acreate2(did, ATTR2_NAME, H5T_NATIVE_INT, asid, acpl_id, aapl_id);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
/* Close the property list and attribute */
- ret = H5Pclose(plist);
+ ret = H5Pclose(acpl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Aclose(attr);
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
/* Re-open the second attribute and ensure that its character encoding is correct */
- attr = H5Aopen(dataset, ATTR2_NAME, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Aopen");
- plist = H5Aget_create_plist(attr);
- CHECK(plist, FAIL, "H5Aget_create_plist");
- ret = H5Pget_char_encoding(plist, &cset);
+ aid = H5Aopen(did, ATTR2_NAME, H5P_DEFAULT);
+ CHECK(aid, H5I_INVALID_HID, "H5Aopen");
+ acpl_id = H5Aget_create_plist(aid);
+ CHECK(acpl_id, H5I_INVALID_HID, "H5Aget_create_plist");
+ ret = H5Pget_char_encoding(acpl_id, &cset);
CHECK(ret, FAIL, "H5Pget_char_encoding");
VERIFY(cset, H5T_CSET_UTF8, "H5Pget_char_encoding");
/* Close everything */
- ret=H5Sclose(sid1);
+ ret = H5Sclose(dsid);
CHECK(ret, FAIL, "H5Sclose");
- ret=H5Sclose(sid2);
+ ret = H5Sclose(asid);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Pclose(plist);
+ ret = H5Pclose(aapl_id);
CHECK(ret, FAIL, "H5Pclose");
- ret=H5Aclose(attr);
+ ret = H5Pclose(acpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Aclose(aid);
CHECK(ret, FAIL, "H5Aclose");
- ret=H5Dclose(dataset);
+ ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- ret=H5Fclose(fid1);
+ ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_plist() */
-
+
/****************************************************************
**
** test_attr_compound_write(): Test H5A (attribute) code.
@@ -674,15 +707,15 @@ test_attr_plist(hid_t fapl)
static void
test_attr_compound_write(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t tid1; /* Attribute datatype ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2};
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t tid1; /* Attribute datatype ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR4_DIM1,ATTR4_DIM2};
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Multiple Attribute Functions\n"));
@@ -696,7 +729,7 @@ test_attr_compound_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset's dataspace */
@@ -753,7 +786,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.
@@ -762,11 +795,11 @@ test_attr_compound_write(hid_t fapl)
static void
test_attr_compound_read(hid_t fapl)
{
- hid_t fid1; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
+ hid_t fid1; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
hid_t space; /* Attribute dataspace */
hid_t type; /* Attribute datatype */
- hid_t attr; /* Attribute ID */
+ hid_t attr; /* Attribute ID */
char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */
int rank; /* Attribute rank */
hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */
@@ -779,9 +812,9 @@ test_attr_compound_read(hid_t fapl)
hid_t field; /* Attribute field datatype */
struct attr4_struct read_data4[ATTR4_DIM1][ATTR4_DIM2]; /* Buffer for reading 4th attribute */
ssize_t name_len; /* Length of attribute name */
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
int i, j; /* Local index variables */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
@@ -795,9 +828,9 @@ test_attr_compound_read(hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 1, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 1, "H5Oget_info3");
/* Open 1st attribute for the dataset */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT);
@@ -830,7 +863,7 @@ test_attr_compound_read(hid_t fapl)
HDstrcmp(fieldname, ATTR4_FIELDNAME3)))
TestErrPrintf("invalid field name for field #%d: %s\n", i, fieldname);
H5free_memory(fieldname);
- } /* end for */
+ } /* end for */
offset = H5Tget_member_offset(type, 0);
VERIFY(offset, attr4_field1_off, "H5Tget_member_offset");
offset = H5Tget_member_offset(type, 1);
@@ -875,10 +908,10 @@ 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 */
+ } /* end if */
/* Verify Name */
name_len = H5Aget_name(attr, (size_t)ATTR_NAME_LEN, attr_name);
@@ -903,7 +936,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.
@@ -912,13 +945,13 @@ test_attr_compound_read(hid_t fapl)
static void
test_attr_scalar_write(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
@@ -932,7 +965,7 @@ test_attr_scalar_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@@ -969,7 +1002,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.
@@ -978,14 +1011,14 @@ test_attr_scalar_write(hid_t fapl)
static void
test_attr_scalar_read(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
H5S_class_t stype; /* Dataspace class */
- float rdata = 0.0F; /* Buffer for reading 1st attribute */
- H5O_info_t oinfo; /* Object info */
- herr_t ret; /* Generic return value */
+ float rdata = 0.0F; /* Buffer for reading 1st attribute */
+ H5O_info2_t oinfo; /* Object info */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Scalar Attribute Reading Functions\n"));
@@ -999,9 +1032,9 @@ test_attr_scalar_read(hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 1, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 1, "H5Oget_info3");
/* Open an attribute for the dataset */
attr = H5Aopen(dataset, ATTR5_NAME, H5P_DEFAULT);
@@ -1013,8 +1046,8 @@ 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",
- "H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__);
+ 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 */
sid = H5Aget_space(attr);
@@ -1040,7 +1073,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.
@@ -1050,16 +1083,16 @@ test_attr_scalar_read(hid_t fapl)
static void
test_attr_mult_write(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR1_DIM1};
- hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
- hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3};
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR1_DIM1};
+ hsize_t dims3[] = {ATTR2_DIM1,ATTR2_DIM2};
+ hsize_t dims4[] = {ATTR3_DIM1,ATTR3_DIM2,ATTR3_DIM3};
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Multiple Attribute Functions\n"));
@@ -1073,7 +1106,7 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset's dataspace */
@@ -1161,7 +1194,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.
@@ -1170,11 +1203,11 @@ test_attr_mult_write(hid_t fapl)
static void
test_attr_mult_read(hid_t fapl)
{
- hid_t fid1; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
+ hid_t fid1; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
hid_t space; /* Attribute dataspace */
hid_t type; /* Attribute datatype */
- hid_t attr; /* Attribute ID */
+ hid_t attr; /* Attribute ID */
char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */
char temp_name[ATTR_NAME_LEN]; /* Buffer for mangling attribute names */
int rank; /* Attribute rank */
@@ -1185,10 +1218,10 @@ test_attr_mult_read(hid_t fapl)
int read_data1[ATTR1_DIM1] = {0}; /* Buffer for reading 1st attribute */
int read_data2[ATTR2_DIM1][ATTR2_DIM2] = {{0}}; /* Buffer for reading 2nd attribute */
double read_data3[ATTR3_DIM1][ATTR3_DIM2][ATTR3_DIM3] = {{{0}}}; /* Buffer for reading 3rd attribute */
- ssize_t name_len; /* Length of attribute name */
- H5O_info_t oinfo; /* Object info */
+ ssize_t name_len; /* Length of attribute name */
+ H5O_info2_t oinfo; /* Object info */
int i, j, k; /* Local index values */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
@@ -1202,9 +1235,9 @@ test_attr_mult_read(hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 3, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 3, "H5Oget_info3");
/* Open 1st attribute for the dataset */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT);
@@ -1383,7 +1416,7 @@ test_attr_mult_read(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_mult_read() */
-
+
/****************************************************************
**
** attr_op1(): Attribute operator
@@ -1423,7 +1456,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.
@@ -1432,12 +1465,12 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR
static void
test_attr_iterate(hid_t fapl)
{
- hid_t file; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
+ hid_t file; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
int count; /* operator data for the iterator */
- H5O_info_t oinfo; /* Object info */
- herr_t ret; /* Generic return value */
+ H5O_info2_t oinfo; /* Object info */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
@@ -1451,7 +1484,7 @@ test_attr_iterate(hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a new dataset */
- dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataspace */
@@ -1459,9 +1492,9 @@ test_attr_iterate(hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 0, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 0, "H5Oget_info3");
/* Iterate over attributes on dataset */
count = 0;
@@ -1477,9 +1510,9 @@ test_attr_iterate(hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 3, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 3, "H5Oget_info3");
/* Iterate over attributes on dataset */
count = 0;
@@ -1495,7 +1528,7 @@ test_attr_iterate(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_iterate() */
-
+
/****************************************************************
**
** test_attr_delete(): Test H5A (attribute) code for deleting objects.
@@ -1504,13 +1537,13 @@ test_attr_iterate(hid_t fapl)
static void
test_attr_delete(hid_t fapl)
{
- hid_t fid1; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t attr; /* Attribute ID */
+ hid_t fid1; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t attr; /* Attribute ID */
char attr_name[ATTR_NAME_LEN]; /* Buffer for attribute names */
ssize_t name_len; /* Length of attribute name */
- H5O_info_t oinfo; /* Object info */
- herr_t ret; /* Generic return value */
+ H5O_info2_t oinfo; /* Object info */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Attribute Functions\n"));
@@ -1524,27 +1557,27 @@ test_attr_delete(hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 3, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 3, "H5Oget_info3");
/* Try to delete bogus attribute */
ret = H5Adelete(dataset, "Bogus");
VERIFY(ret, FAIL, "H5Adelete");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 3, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 3, "H5Oget_info3");
/* Delete middle (2nd) attribute */
ret = H5Adelete(dataset, ATTR2_NAME);
CHECK(ret, FAIL, "H5Adelete");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 2, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 2, "H5Oget_info3");
/* Open 1st attribute for the dataset */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT);
@@ -1579,9 +1612,9 @@ test_attr_delete(hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 1, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 1, "H5Oget_info3");
/* Open last (formally 3rd) attribute for the dataset */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT);
@@ -1602,9 +1635,9 @@ test_attr_delete(hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Verify the correct number of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, 0, "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, 0, "H5Oget_info3");
/* Close dataset */
ret = H5Dclose(dataset);
@@ -1615,7 +1648,7 @@ test_attr_delete(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_attr_delete() */
-
+
/****************************************************************
**
** test_attr_dtype_shared(): Test H5A (attribute) code for using
@@ -1632,10 +1665,10 @@ test_attr_dtype_shared(hid_t fapl)
hid_t attr_id; /* Attribute ID */
int data = 8; /* Data to write */
int rdata = 0; /* Read read in */
- H5O_info_t oinfo; /* Object's information */
+ H5O_info2_t oinfo; /* Object's information */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Shared Datatypes with Attributes\n"));
@@ -1653,7 +1686,6 @@ test_attr_dtype_shared(hid_t fapl)
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
-
/* Re-open file */
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
CHECK(file_id, FAIL, "H5Fopen");
@@ -1667,31 +1699,31 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "H5Oget_info_by_name3");
/* Create dataspace for dataset */
space_id = H5Screate(H5S_SCALAR);
CHECK(space_id, FAIL, "H5Screate");
/* Create dataset */
- dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dset_id, FAIL, "H5Dcreate2");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "H5Oget_info_by_name3");
/* Create attribute on dataset */
attr_id = H5Acreate2(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr_id, FAIL, "H5Acreate2");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 3, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 3, "H5Oget_info_by_name3");
/* Close attribute */
ret = H5Aclose(attr_id);
@@ -1702,18 +1734,18 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "H5Oget_info_by_name3");
/* Create attribute on dataset */
attr_id = H5Acreate2(dset_id, ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
CHECK(attr_id, FAIL, "H5Acreate2");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 3, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 3, "H5Oget_info_by_name3");
/* Write data into the attribute */
ret = H5Awrite(attr_id, H5T_NATIVE_INT, &data);
@@ -1766,18 +1798,18 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(ret, FAIL, "H5Dclose");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 3, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 3, "H5Oget_info_by_name3");
/* Unlink the dataset */
ret = H5Ldelete(file_id, DSET1_NAME, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
/* Check reference count on named datatype */
- ret = H5Oget_info_by_name(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file_id, TYPE1_NAME, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "H5Oget_info_by_name3");
/* Unlink the named datatype */
ret = H5Ldelete(file_id, TYPE1_NAME, H5P_DEFAULT);
@@ -1792,7 +1824,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
@@ -1802,17 +1834,17 @@ test_attr_dtype_shared(hid_t fapl)
static void
test_attr_duplicate_ids(hid_t fapl)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t gid1, gid2; /* Group ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hid_t attr, attr2; /* Attribute ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {ATTR1_DIM1};
- int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */
- int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */
- int i;
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t gid1, gid2; /* Group ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hid_t attr, attr2; /* Attribute ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {ATTR1_DIM1};
+ int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading 1st attribute */
+ int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */
+ int i;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing operations with two ID handles\n"));
@@ -1830,7 +1862,7 @@ test_attr_duplicate_ids(hid_t fapl)
/* Create a dataset */
dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
+ dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
@@ -2037,7 +2069,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.
@@ -2047,12 +2079,12 @@ test_attr_duplicate_ids(hid_t fapl)
static int
test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
{
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
- hid_t attr; /* Attribute ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t attr; /* Attribute ID */
unsigned value; /* Attribute value */
unsigned u; /* Local index variable */
int old_nerrs; /* Number of errors when entering this check */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Retrieve the current # of reported errors */
old_nerrs = GetTestNumErrs();
@@ -2060,7 +2092,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");
@@ -2084,7 +2116,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))
@@ -2107,7 +2139,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.
@@ -2117,19 +2149,19 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr)
static void
test_attr_dense_create(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dense Attribute Storage Creation\n"));
@@ -2155,9 +2187,14 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -2172,13 +2209,13 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -2192,18 +2229,18 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2238,7 +2275,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.
@@ -2248,19 +2285,19 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
static void
test_attr_dense_open(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Opening Attributes in Dense Storage\n"));
@@ -2286,9 +2323,14 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@@ -2307,13 +2349,13 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -2331,18 +2373,18 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Write data into the attribute */
ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
@@ -2377,7 +2419,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.
@@ -2387,27 +2429,38 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
static void
test_attr_dense_delete(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- H5O_info_t oinfo; /* Object info */
- herr_t ret; /* Generic return value */
+ H5O_info2_t oinfo; /* Object info */
+ int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deleting Attributes in Dense Storage\n"));
- /* Create file */
+ if (use_min_dset_oh) { /* using minimized dataset headers */
+ /* modify fcpl...
+ * sidestep "bug" where file space is lost with minimized dset ohdrs
+ */
+ fcpl = H5Pcopy(fcpl);
+ CHECK(fcpl, FAIL, "H5Pcopy");
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
+ CHECK(ret, FAIL, "H5Pset_file_space_strategy");
+ }
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
CHECK(fid, FAIL, "H5Fcreate");
+ if (use_min_dset_oh)
+ CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
/* Close file */
ret = H5Fclose(fid);
@@ -2426,9 +2479,14 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ }
/* Enable creation order tracking on attributes, so creation order tests work */
ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED);
@@ -2447,13 +2505,13 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -2466,14 +2524,14 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check # of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info3");
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -2499,7 +2557,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");
@@ -2509,30 +2567,30 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ 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");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Verify attributes still left */
ret = test_attr_dense_verify(dataset, (u - 1));
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");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Verify attributes still left */
ret = test_attr_dense_verify(dataset, (u - 2));
@@ -2555,7 +2613,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.
@@ -2565,28 +2623,40 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
static void
test_attr_dense_rename(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
- char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char new_attrname[NAME_BUF_SIZE]; /* New name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
+ unsigned use_corder; /* Track creation order or not */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Renaming Attributes in Dense Storage\n"));
- /* Create file */
+ if (use_min_dset_oh) { /* using minimized dataset headers */
+ /* modify fcpl...
+ * sidestep "bug" where file space is lost with minimized dset ohdrs
+ */
+ fcpl = H5Pcopy(fcpl);
+ CHECK(fcpl, FAIL, "H5Pcopy");
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
+ CHECK(ret, FAIL, "H5Pset_file_space_strategy");
+ }
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
- CHECK(fid, FAIL, "H5Fcreate");
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+ if (use_min_dset_oh)
+ CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
/* Close file */
ret = H5Fclose(fid);
@@ -2599,71 +2669,92 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Re-open file */
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
- CHECK(fid, FAIL, "H5Fopen");
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Create dataspace for dataset */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
-
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
- /* Create a dataset */
- dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ }
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
CHECK(ret, FAIL, "H5Pget_attr_phase_change");
- /* Close property list */
- ret = H5Pclose(dcpl);
- CHECK(ret, FAIL, "H5Pclose");
+ /* Using creation order or not */
+ for(use_corder = FALSE; use_corder <= TRUE; use_corder++) {
- /* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ if(use_corder) {
+ ret = H5Pset_attr_creation_order(dcpl, H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED);
+ CHECK(ret, FAIL, "H5Pset_attr_creation_order");
+ }
- /* Add attributes, until well into dense storage */
- for(u = 0; u < (max_compact * 2); u++) {
- /* Create attribute */
- sprintf(attrname, "attr %02u", u);
- attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(attr, FAIL, "H5Acreate2");
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
- /* Write data into the attribute */
- ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
- CHECK(ret, FAIL, "H5Awrite");
+ /* Check on dataset's attribute storage status */
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
- /* Close attribute */
- ret = H5Aclose(attr);
- CHECK(ret, FAIL, "H5Aclose");
+ /* Add attributes, until well into dense storage */
+ for(u = 0; u < (max_compact * 2); u++) {
+ /* Create attribute */
+ HDsprintf(attrname, "attr %02u", u);
+ attr = H5Acreate2(dataset, attrname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
- /* Rename attribute */
- sprintf(new_attrname, "new attr %02u", u);
+ /* Write data into the attribute */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, &u);
+ CHECK(ret, FAIL, "H5Awrite");
- /* Rename attribute */
- ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Arename_by_name");
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
- /* Check # of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
- } /* end for */
+ /* Rename attribute */
+ HDsprintf(new_attrname, "new attr %02u", u);
- /* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ /* Rename attribute */
+ ret = H5Arename_by_name(fid, DSET1_NAME, attrname, new_attrname, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Arename_by_name");
+
+ /* Check # of attributes */
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info3");
+ } /* end for */
+
+ /* Check on dataset's attribute storage status */
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ if(!use_corder) {
+ /* Unlink dataset with attributes */
+ ret = H5Ldelete(fid, DSET1_NAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ }
+
+ } /* end for use_corder */
/* Close dataspace */
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
- /* Close Dataset */
- ret = H5Dclose(dataset);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
/* Close file */
ret = H5Fclose(fid);
@@ -2672,20 +2763,20 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
/* Re-open file */
fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
- CHECK(fid, FAIL, "H5Fopen");
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Open dataset */
dataset = H5Dopen2(fid, DSET1_NAME, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dopen2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
/* Verify renamed attributes */
for(u = 0; u < (max_compact * 2); u++) {
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, FAIL, "H5Aopen");
+ CHECK(attr, H5I_INVALID_HID, "H5Aopen");
/* Read data from the attribute */
ret = H5Aread(attr, H5T_NATIVE_UINT, &value);
@@ -2714,7 +2805,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.
@@ -2724,34 +2815,43 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
static void
test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
size_t mesg_count; /* # of shared messages */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ int use_min_dset_oh = (dcpl_g != H5P_DEFAULT);
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Unlinking Object with Attributes in Dense Storage\n"));
- /* Create file */
+ if (use_min_dset_oh) { /* using minimized dataset headers */
+ /* modify fcpl...
+ * sidestep "bug" where file space is lost with minimized dset ohdrs
+ */
+ fcpl = H5Pcopy(fcpl);
+ CHECK(fcpl, FAIL, "H5Pcopy");
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, 1);
+ CHECK(ret, FAIL, "H5Pset_file_space_strategy");
+ }
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
CHECK(fid, FAIL, "H5Fcreate");
+ if (use_min_dset_oh)
+ CHECK(H5Pclose(fcpl), FAIL, "H5Pclose");
- /* Close file */
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Get size of file */
empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2764,9 +2864,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (use_min_dset_oh) {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ } else {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -2781,13 +2886,13 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -2800,14 +2905,14 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check # of attributes */
- ret = H5Oget_info(dataset, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info");
+ ret = H5Oget_info3(dataset, &oinfo, H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.num_attrs, (u + 1), "H5Oget_info3");
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -2831,9 +2936,9 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Ldelete");
/* Check on dataset's attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Close file */
ret = H5Fclose(fid);
@@ -2844,7 +2949,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.
@@ -2854,19 +2959,19 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
static void
test_attr_dense_limits(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact, rmax_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense, rmin_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Phase Change Limits For Attributes in Dense Storage\n"));
@@ -2892,9 +2997,14 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Change limits on compact/dense attribute storage */
max_compact = 0;
@@ -2918,15 +3028,15 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add first attribute, which should be immediately in dense storage */
/* 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");
@@ -2939,15 +3049,15 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Add second attribute, to allow deletions to be checked easily */
/* 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");
@@ -2960,8 +3070,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Delete second attribute, attributes should still be stored densely */
@@ -2971,21 +3081,21 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Delete first attribute, attributes should not be stored densely */
/* Delete attribute */
u = 0;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Close dataspace */
@@ -3009,7 +3119,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
@@ -3019,23 +3129,23 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
static void
test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t gid1, gid2; /* Group ID */
- hid_t sid, sid2; /* Dataspace ID */
- hid_t attr, attr2, add_attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
- hsize_t dims[] = {ATTR1_DIM1};
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t gid1, gid2; /* Group ID */
+ hid_t sid, sid2; /* Dataspace ID */
+ hid_t attr, attr2, add_attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hsize_t dims[] = {ATTR1_DIM1};
int read_data1[ATTR1_DIM1]={0}; /* Buffer for reading attribute */
int rewrite_data[ATTR1_DIM1]={1234, -423, 9907256}; /* Test data for rewrite */
unsigned scalar_data = 1317; /* scalar data for attribute */
unsigned read_scalar; /* variable for reading attribute*/
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_dense; /* Are attributes stored densely? */
unsigned u, i; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing operations with two IDs for Dense Storage\n"));
@@ -3059,9 +3169,14 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create a dataset */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -3076,13 +3191,13 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -3096,8 +3211,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
} /* end for */
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add one more attribute, to push into "dense" storage */
/* Create dataspace for attribute */
@@ -3105,13 +3220,13 @@ 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");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open the attribute just created and get a second ID */
attr2 = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -3145,8 +3260,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open first attribute for the dataset */
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -3198,8 +3313,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open first attribute for the dataset */
attr = H5Aopen(dataset, attrname, H5P_DEFAULT);
@@ -3259,8 +3374,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open first attribute for the dataset */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)4,
@@ -3315,8 +3430,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open attribute of the dataset for the first time */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2,
@@ -3331,8 +3446,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
}
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Open attribute for the second time */
attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)2,
@@ -3382,8 +3497,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Open attribute of the dataset for the first time */
attr = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3,
@@ -3393,7 +3508,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");
@@ -3407,8 +3522,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
}
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open attribute for the second time */
attr2 = H5Aopen_by_idx(dataset, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)3,
@@ -3463,7 +3578,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");
@@ -3481,8 +3596,8 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check on group's attribute storage status */
- is_dense = H5O_is_attr_dense_test(gid1);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(gid1);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Open the hard link just created */
gid2 = H5Gopen2(fid, GROUP2_NAME, H5P_DEFAULT);
@@ -3532,7 +3647,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.
@@ -3542,24 +3657,24 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl)
static void
test_attr_big(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t big_sid; /* "Big" dataspace ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t big_sid; /* "Big" dataspace ID */
hsize_t dims[ATTR6_RANK] = {ATTR6_DIM1, ATTR6_DIM2, ATTR6_DIM3}; /* Attribute dimensions */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
unsigned nshared_indices; /* # of shared message indices */
H5F_libver_t low, high; /* File format bounds */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Storing 'Big' Attributes in Dense Storage\n"));
@@ -3589,9 +3704,14 @@ test_attr_big(hid_t fcpl, hid_t fapl)
big_sid = H5Screate_simple(ATTR6_RANK, dims, NULL);
CHECK(big_sid, FAIL, "H5Screate_simple");
- /* Query the group creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ /* need DCPL to query the group creation properties */
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -3615,17 +3735,17 @@ test_attr_big(hid_t fcpl, hid_t fapl)
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add first "small" attribute, which should be in compact storage */
/* 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");
@@ -3634,17 +3754,17 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add second "small" attribute, which should stay in compact storage */
/* 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");
@@ -3653,17 +3773,17 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Add first "big" attribute, which should push storage into dense form */
/* 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");
@@ -3677,17 +3797,17 @@ test_attr_big(hid_t fcpl, hid_t fapl)
* message heap instead of forcing the attribute storage into the dense
* form - QAK)
*/
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Add second "big" attribute, which should leave storage in dense form */
/* 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");
@@ -3700,68 +3820,68 @@ test_attr_big(hid_t fcpl, hid_t fapl)
* message heap instead of forcing the attribute storage into the dense
* form - QAK)
*/
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Delete second "small" attribute, attributes should still be stored densely */
/* Delete attribute */
u = 1;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Delete second "big" attribute, attributes should still be stored densely */
/* Delete attribute */
u = 3;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, (nshared_indices ? FALSE : TRUE), "H5O__is_attr_dense_test");
/* Delete first "big" attribute, attributes should _not_ be stored densely */
/* Delete attribute */
u = 2;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Delete first "small" attribute, should be no attributes now */
/* Delete attribute */
u = 0;
- sprintf(attrname, "attr %02u", u);
+ HDsprintf(attrname, "attr %02u", u);
ret = H5Adelete(dataset, attrname);
CHECK(ret, FAIL, "H5Adelete");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
} /* end if */
else {
/* Shouldn't be able to create "big" attributes with older version of format */
@@ -3772,10 +3892,10 @@ test_attr_big(hid_t fcpl, hid_t fapl)
* message heap instead of forcing the attribute storage into the dense
* form - QAK)
*/
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end else */
@@ -3802,7 +3922,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.
@@ -3812,20 +3932,20 @@ test_attr_big(hid_t fcpl, hid_t fapl)
static void
test_attr_null_space(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t null_sid; /* "null" dataspace ID */
- hid_t attr_sid; /* Attribute's dataspace ID */
- hid_t attr; /* Attribute ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t null_sid; /* "null" dataspace ID */
+ hid_t attr_sid; /* Attribute's dataspace ID */
+ hid_t attr; /* Attribute ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned value; /* Attribute value */
htri_t cmp; /* Results of comparison */
hsize_t storage_size; /* Size of storage for attribute */
H5A_info_t ainfo; /* Attribute info */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Storing Attributes with 'null' dataspace\n"));
@@ -3856,7 +3976,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
CHECK(null_sid, FAIL, "H5Screate");
/* Create a dataset */
- dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@@ -4020,7 +4140,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.
@@ -4031,11 +4151,11 @@ static void
test_attr_deprec(hid_t fcpl, hid_t fapl)
{
#ifndef H5_NO_DEPRECATED_SYMBOLS
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deprecated Attribute Routines\n"));
@@ -4049,7 +4169,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset */
- dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
@@ -4063,7 +4183,6 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
ret = H5Aclose(attr);
CHECK(ret, FAIL, "H5Aclose");
-
/* Close dataspaces */
ret = H5Sclose(sid);
@@ -4129,7 +4248,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.
@@ -4139,15 +4258,15 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
static void
test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t gid; /* Group ID */
- hid_t sid; /* Dataspace ID */
- hid_t aid; /* Attribute ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* HDF5 File ID */
+ hid_t gid; /* Group ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t aid; /* Attribute ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned nattr = (new_format ? NATTR_MANY_NEW : NATTR_MANY_OLD); /* Number of attributes */
htri_t exists; /* Whether the attribute exists or not */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Storing Many Attributes\n"));
@@ -4166,7 +4285,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");
@@ -4219,7 +4338,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");
@@ -4258,7 +4377,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.
@@ -4268,14 +4387,14 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl)
static void
test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t dcpl; /* Dataset creation property list ID */
unsigned crt_order_flags;/* Creation order flags */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
- herr_t ret; /* Generic return value */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Code for Attributes with Creation Order Info\n"));
@@ -4285,8 +4404,13 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Get creation order indexing on object */
ret = H5Pget_attr_creation_order(dcpl, &crt_order_flags);
@@ -4320,10 +4444,10 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -4347,10 +4471,10 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(dataset, FAIL, "H5Dopen2");
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Retrieve dataset creation property list for group */
dcpl = H5Dget_create_plist(dataset);
@@ -4374,7 +4498,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.
@@ -4384,21 +4508,21 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
static void
test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Compact Storage of Attributes with Creation Order Info\n"));
@@ -4408,8 +4532,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -4451,15 +4580,15 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -4472,13 +4601,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (u + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (u + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end for */
} /* end for */
@@ -4535,13 +4664,13 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Loop through attributes, checking their creation order values */
/* (the name index is used, but the creation order value is in the same order) */
@@ -4549,7 +4678,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");
@@ -4572,7 +4701,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.
@@ -4582,23 +4711,23 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
static void
test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dense Storage of Attributes with Creation Order Info\n"));
@@ -4608,8 +4737,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -4651,15 +4785,15 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -4672,17 +4806,17 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (u + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (u + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* 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");
@@ -4695,18 +4829,18 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Close Datasets */
@@ -4762,13 +4896,13 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Loop through attributes, checking their creation order values */
/* (the name index is used, but the creation order value is in the same order) */
@@ -4776,7 +4910,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");
@@ -4799,7 +4933,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.
@@ -4816,7 +4950,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl)
hid_t sid = -1; /* Dataspace ID */
hid_t aid = -1; /* Attribute ID */
int buf; /* Attribute data */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Creating Attributes w/New & Old Format\n"));
@@ -4907,7 +5041,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.
@@ -4917,23 +5051,23 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl)
static void
test_attr_corder_transition(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Storage Transitions of Attributes with Creation Order Info\n"));
@@ -4943,8 +5077,13 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fcreate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -4990,10 +5129,10 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* end for */
/* Close Datasets */
@@ -5047,7 +5186,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");
@@ -5060,17 +5199,17 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (u + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (u + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
} /* 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");
@@ -5083,58 +5222,58 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
/* 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");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, u, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, u, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* 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");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (min_dense - 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -5148,18 +5287,18 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Close Datasets */
@@ -5207,58 +5346,58 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
/* 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");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, u, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, u, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* 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");
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (min_dense - 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (min_dense - 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -5272,26 +5411,26 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact + 1), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact + 1), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
/* 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 */
@@ -5313,7 +5452,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.
@@ -5323,28 +5462,28 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
static void
test_attr_corder_delete(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
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 */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
#ifdef LATER
h5_stat_size_t empty_size; /* Size of empty file */
h5_stat_size_t file_size; /* Size of file after operating on it */
#endif /* LATER */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deleting Object w/Dense Attribute Storage and Creation Order Info\n"));
@@ -5354,8 +5493,13 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Set attribute creation order tracking & indexing for object */
ret = H5Pset_attr_creation_order(dcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED));
@@ -5420,15 +5564,15 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -5442,18 +5586,18 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
} /* end for */
/* Close Datasets */
@@ -5514,14 +5658,14 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Sclose");
} /* test_attr_corder_delete() */
-
+
/*-------------------------------------------------------------------------
* Function: attr_info_by_idx_check
*
* Purpose: Support routine for attr_info_by_idx, to verify the attribute
* info is correct for a attribute
*
- * Note: This routine assumes that the attributes have been added to the
+ * Note: This routine assumes that the attributes have been added to the
* object in alphabetical order.
*
* Return: Success: 0
@@ -5539,7 +5683,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n,
char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */
H5A_info_t ainfo; /* Attribute info struct */
int old_nerrs; /* Number of errors when entering this check */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Retrieve the current # of reported errors */
old_nerrs = GetTestNumErrs();
@@ -5661,7 +5805,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.
@@ -5671,34 +5815,39 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n,
static void
test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
H5A_info_t ainfo; /* Attribute information */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
unsigned use_index; /* Use index on creation order values */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create dataspace for dataset & attributes */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -5750,10 +5899,10 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for query on non-existant attribute */
ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, &ainfo, H5P_DEFAULT);
@@ -5764,7 +5913,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");
@@ -5782,13 +5931,13 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound offset queries */
ret = H5Aget_info_by_idx(my_dataset, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)u, &ainfo, H5P_DEFAULT);
@@ -5801,7 +5950,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");
@@ -5814,8 +5963,8 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Verify state of object */
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
/* Verify information for new attribute */
ret = attr_info_by_idx_check(my_dataset, attrname, (hsize_t)u, use_index);
@@ -5823,21 +5972,21 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound offset queries */
@@ -5871,7 +6020,209 @@ 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
+** passing a NULL attribute info pointer to H5Aget_info
+** (_by_name/_by_idx) doesn't cause bad behavior.
+**
+****************************************************************/
+static void
+test_attr_info_null_info_pointer(hid_t fcpl, hid_t fapl)
+{
+ herr_t err_ret = -1;
+ hid_t fid;
+ hid_t attr;
+ hid_t sid;
+
+ /* Create dataspace for attribute */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create attribute */
+ attr = H5Acreate2(fid, GET_INFO_NULL_POINTER_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Aget_info(attr, NULL);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Aget_info");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Aget_info_by_name(fid, ".", GET_INFO_NULL_POINTER_ATTR_NAME, NULL, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Aget_info_by_name");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Aget_info_by_idx(fid, ".", H5_INDEX_NAME, H5_ITER_INC, 0, NULL, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Aget_info_by_idx");
+
+ /* Close dataspace */
+ err_ret = H5Sclose(sid);
+ CHECK(err_ret, FAIL, "H5Sclose");
+
+ /* Close attribute */
+ err_ret = H5Aclose(attr);
+ CHECK(err_ret, FAIL, "H5Aclose");
+
+ /* Close file */
+ err_ret = H5Fclose(fid);
+ CHECK(err_ret, FAIL, "H5Fclose");
+}
+
+
+/***************************************************************
+**
+** test_attr_rename_invalid_name(): A test to ensure that
+** passing a NULL or empty attribute name to
+** H5Arename(_by_name) doesn't cause bad behavior.
+**
+****************************************************************/
+static void
+test_attr_rename_invalid_name(hid_t fcpl, hid_t fapl)
+{
+ herr_t err_ret = -1;
+ hid_t fid;
+ hid_t attr;
+ hid_t sid;
+
+ /* Create dataspace for attribute */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create attribute */
+ attr = H5Acreate2(fid, INVALID_RENAME_TEST_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename(fid, NULL, INVALID_RENAME_TEST_NEW_ATTR_NAME);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename(fid, "", INVALID_RENAME_TEST_NEW_ATTR_NAME);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, NULL);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, "");
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename_by_name(fid, ".", NULL, INVALID_RENAME_TEST_NEW_ATTR_NAME, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename_by_name");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename_by_name(fid, ".", "", INVALID_RENAME_TEST_NEW_ATTR_NAME, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename_by_name");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, NULL, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename_by_name");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, "", H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ CHECK(err_ret, SUCCEED, "H5Arename_by_name");
+
+ /* Close dataspace */
+ err_ret = H5Sclose(sid);
+ CHECK(err_ret, FAIL, "H5Sclose");
+
+ /* Close attribute */
+ err_ret = H5Aclose(attr);
+ CHECK(err_ret, FAIL, "H5Aclose");
+
+ /* Close file */
+ err_ret = H5Fclose(fid);
+ CHECK(err_ret, FAIL, "H5Fclose");
+}
+
+
+/***************************************************************
+**
+** test_attr_get_name_invalid_buf(): A test to ensure that
+** passing a NULL buffer to H5Aget_name(_by_idx) when
+** the 'size' parameter is non-zero doesn't cause bad
+** behavior.
+**
+****************************************************************/
+static void
+test_attr_get_name_invalid_buf(hid_t fcpl, hid_t fapl)
+{
+ ssize_t err_ret = -1;
+ hid_t fid;
+ hid_t attr;
+ hid_t sid;
+
+ /* Create dataspace for attribute */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create attribute */
+ attr = H5Acreate2(fid, GET_NAME_INVALID_BUF_TEST_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, FAIL, "H5Acreate2");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Aget_name(attr, 1, NULL);
+ } H5E_END_TRY;
+
+ VERIFY(err_ret, FAIL, "H5Aget_name");
+
+ H5E_BEGIN_TRY {
+ err_ret = H5Aget_name_by_idx(fid, ".", H5_INDEX_NAME, H5_ITER_INC, 0, NULL, 1, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ VERIFY(err_ret, FAIL, "H5Aget_name_by_idx");
+
+ /* Close dataspace */
+ err_ret = H5Sclose(sid);
+ CHECK(err_ret, FAIL, "H5Sclose");
+
+ /* Close attribute */
+ err_ret = H5Aclose(attr);
+ CHECK(err_ret, FAIL, "H5Aclose");
+
+ /* Close file */
+ err_ret = H5Fclose(fid);
+ CHECK(err_ret, FAIL, "H5Fclose");
+}
+
+
/****************************************************************
**
** test_attr_delete_by_idx(): Test basic H5A (attribute) code.
@@ -5881,45 +6232,50 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
static void
test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
H5A_info_t ainfo; /* Attribute information */
unsigned max_compact; /* Maximum # of links to store in group compactly */
unsigned min_dense; /* Minimum # of links to store in group "densely" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
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 */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
char tmpname[NAME_BUF_SIZE]; /* Temporary attribute name */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create dataspace for dataset & attributes */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
CHECK(ret, FAIL, "H5Pget_attr_phase_change");
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <= H5_ITER_DEC; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -5990,10 +6346,10 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for deleting non-existant attribute */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -6002,7 +6358,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");
@@ -6020,13 +6376,13 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound deletions */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT);
@@ -6074,9 +6430,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 */
@@ -6086,8 +6442,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete_by_idx");
/* Verify state of attribute storage (empty) */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
} /* end for */
/* Work on all the datasets */
@@ -6112,7 +6468,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");
@@ -6126,8 +6482,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -6136,21 +6492,21 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound deletion */
@@ -6199,9 +6555,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 */
@@ -6211,8 +6567,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete_by_idx");
/* Verify state of attribute storage (empty) */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
/* Check for deletion on empty attribute storage again */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -6245,7 +6601,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");
@@ -6259,8 +6615,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -6310,9 +6666,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 */
@@ -6359,9 +6715,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 */
@@ -6371,8 +6727,8 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Adelete_by_idx");
/* Verify state of attribute storage (empty) */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
/* Check for deletion on empty attribute storage again */
ret = H5Adelete_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT);
@@ -6403,7 +6759,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
@@ -6451,7 +6807,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);
@@ -6477,7 +6833,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
@@ -6490,7 +6846,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
*
@@ -6512,7 +6868,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
*
@@ -6812,7 +7168,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.
@@ -6822,16 +7178,16 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id,
static void
test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
@@ -6842,18 +7198,23 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
hsize_t idx; /* Start index for iteration */
unsigned use_index; /* Use index on creation order values */
const char *dsetname; /* Name of dataset for attributes */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create dataspace for dataset & attributes */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -6862,13 +7223,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Allocate the "visited link" array */
iter_info.max_visit = max_compact * 2;
visited = (hbool_t*)HDmalloc(sizeof(hbool_t) * iter_info.max_visit);
- CHECK(visited, NULL, "HDmalloc");
+ CHECK_PTR(visited, "HDmalloc");
iter_info.visited = visited;
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <= H5_ITER_DEC; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -6942,10 +7303,10 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for iterating over object with no attributes (should be OK) */
ret = H5Aiterate2(my_dataset, idx_type, order, NULL, attr_iterate2_cb, NULL);
@@ -6960,7 +7321,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");
@@ -6978,13 +7339,13 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound iteration */
idx = u;
@@ -7030,7 +7391,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");
@@ -7044,8 +7405,8 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7054,21 +7415,21 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound iteration */
@@ -7116,7 +7477,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
*
@@ -7138,7 +7499,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
H5A_info_t ainfo; /* Attribute info */
int old_nerrs; /* Number of errors when entering this check */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Retrieve the current # of reported errors */
old_nerrs = GetTestNumErrs();
@@ -7176,7 +7537,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.
@@ -7186,44 +7547,49 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
static void
test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
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 */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Create dataspace for dataset & attributes */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
CHECK(ret, FAIL, "H5Pget_attr_phase_change");
/* Loop over operating on different indices on link fields */
- for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; H5_INC_ENUM(H5_index_t, idx_type)) {
+ for(idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
- for(order = H5_ITER_INC; order <= H5_ITER_DEC; H5_INC_ENUM(H5_iter_order_t, order)) {
+ for(order = H5_ITER_INC; order <= H5_ITER_DEC; order++) {
/* Loop over using index for creation order value */
for(use_index = FALSE; use_index <= TRUE; use_index++) {
/* Print appropriate test message */
@@ -7294,10 +7660,10 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for opening an attribute on an object with no attributes */
ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT);
@@ -7306,7 +7672,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");
@@ -7324,13 +7690,13 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for out of bound opening an attribute on an object */
ret_id = H5Aopen_by_idx(my_dataset, ".", idx_type, order, (hsize_t)u, H5P_DEFAULT, H5P_DEFAULT);
@@ -7364,7 +7730,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");
@@ -7378,8 +7744,8 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7388,21 +7754,21 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for out of bound opening an attribute on an object */
@@ -7438,7 +7804,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
*
@@ -7458,10 +7824,10 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id,
{
hid_t attr_id; /* ID of attribute to test */
H5A_info_t ainfo; /* Attribute info */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
int old_nerrs; /* Number of errors when entering this check */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Retrieve the current # of reported errors */
old_nerrs = GetTestNumErrs();
@@ -7469,7 +7835,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");
@@ -7524,7 +7890,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.
@@ -7534,34 +7900,39 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id,
static void
test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
unsigned use_index; /* Use index on creation order values */
const char *dsetname; /* Name of dataset for attributes */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- hid_t ret_id; /* Generic hid_t return value */
- herr_t ret; /* Generic return value */
+ hid_t ret_id; /* Generic hid_t return value */
+ herr_t ret; /* Generic return value */
/* Create dataspace for dataset & attributes */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7616,10 +7987,10 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for opening a non-existant attribute on an object with no attributes */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
@@ -7634,7 +8005,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");
@@ -7652,13 +8023,13 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Check for opening a non-existant attribute on an object with compact attribute storage */
ret_id = H5Aopen(my_dataset, "foo", H5P_DEFAULT);
@@ -7701,7 +8072,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");
@@ -7715,8 +8086,8 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7725,21 +8096,21 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Check for opening a non-existant attribute on an object with dense attribute storage */
@@ -7779,7 +8150,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.
@@ -7789,33 +8160,38 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
static void
test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t dset1, dset2, dset3; /* Dataset IDs */
- hid_t my_dataset; /* Current dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
+ hid_t fid; /* HDF5 File ID */
+ hid_t dset1, dset2, dset3; /* Dataset IDs */
+ hid_t my_dataset; /* Current dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset 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" */
- htri_t is_empty; /* Are there any attributes? */
- htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_empty; /* Are there any attributes? */
+ htri_t is_dense; /* Are attributes stored densely? */
hsize_t nattrs; /* Number of attributes on object */
hsize_t name_count; /* # of records in name index */
hsize_t corder_count; /* # of records in creation order index */
unsigned use_index; /* Use index on creation order values */
const char *dsetname; /* Name of dataset for attributes */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned curr_dset; /* Current dataset to work on */
unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create dataspace for dataset & attributes */
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
/* Create dataset creation property list */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Query the attribute creation properties */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -7870,15 +8246,15 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end switch */
/* Check on dataset's attribute storage status */
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, TRUE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, TRUE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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");
@@ -7896,13 +8272,13 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, max_compact, "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, max_compact, "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* Test opening attributes stored compactly */
ret = attr_open_check(fid, dsetname, my_dataset, u);
@@ -7935,7 +8311,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");
@@ -7949,8 +8325,8 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
/* Verify state of object */
if(u >= max_compact) {
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
} /* end if */
/* Verify information for new attribute */
@@ -7959,21 +8335,21 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end for */
/* Verify state of object */
- ret = H5O_num_attrs_test(my_dataset, &nattrs);
- CHECK(ret, FAIL, "H5O_num_attrs_test");
- VERIFY(nattrs, (max_compact * 2), "H5O_num_attrs_test");
- is_empty = H5O_is_attr_empty_test(my_dataset);
- VERIFY(is_empty, FALSE, "H5O_is_attr_empty_test");
- is_dense = H5O_is_attr_dense_test(my_dataset);
- VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O_is_attr_dense_test");
+ ret = H5O__num_attrs_test(my_dataset, &nattrs);
+ CHECK(ret, FAIL, "H5O__num_attrs_test");
+ VERIFY(nattrs, (max_compact * 2), "H5O__num_attrs_test");
+ is_empty = H5O__is_attr_empty_test(my_dataset);
+ VERIFY(is_empty, FALSE, "H5O__is_attr_empty_test");
+ is_dense = H5O__is_attr_dense_test(my_dataset);
+ VERIFY(is_dense, (new_format ? TRUE : FALSE), "H5O__is_attr_dense_test");
if(new_format) {
/* Retrieve & verify # of records in the name & creation order indices */
- ret = H5O_attr_dense_info_test(my_dataset, &name_count, &corder_count);
- CHECK(ret, FAIL, "H5O_attr_dense_info_test");
+ ret = H5O__attr_dense_info_test(my_dataset, &name_count, &corder_count);
+ CHECK(ret, FAIL, "H5O__attr_dense_info_test");
if(use_index)
- VERIFY(name_count, corder_count, "H5O_attr_dense_info_test");
- VERIFY(name_count, (max_compact * 2), "H5O_attr_dense_info_test");
+ VERIFY(name_count, corder_count, "H5O__attr_dense_info_test");
+ VERIFY(name_count, (max_compact * 2), "H5O__attr_dense_info_test");
} /* end if */
/* Test opening attributes stored compactly */
@@ -8012,35 +8388,35 @@ test_attr_create_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl)
static void
test_attr_shared_write(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* File ID */
- hid_t my_fcpl; /* File creation property list ID */
- hid_t dataset, dataset2; /* Dataset IDs */
- hid_t attr_tid; /* Attribute's datatype ID */
- hid_t sid, big_sid; /* Dataspace IDs */
- hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute */
+ hid_t fid; /* File ID */
+ hid_t my_fcpl; /* File creation property list ID */
+ hid_t dataset, dataset2; /* Dataset IDs */
+ hid_t attr_tid; /* Attribute's datatype ID */
+ hid_t sid, big_sid; /* Dataspace IDs */
+ hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
- htri_t is_shared; /* Is attributes shared? */
+ htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_shared; /* Is attributes shared? */
hsize_t shared_refcount; /* Reference count of shared attribute */
unsigned attr_value; /* Attribute value */
- unsigned *big_value; /* Data for "big" attribute */
+ unsigned *big_value; /* Data for "big" attribute */
size_t mesg_count; /* # of shared messages */
unsigned test_shared; /* Index over shared component type */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Writing Shared & Unshared Attributes in Compact & Dense Storage\n"));
/* Allocate & initialize "big" attribute data */
big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned));
- CHECK(big_value, NULL, "HDmalloc");
+ CHECK_PTR(big_value, "HDmalloc");
HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3));
/* Create dataspace for dataset */
@@ -8115,8 +8491,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8127,14 +8508,14 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -8146,15 +8527,15 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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) {
@@ -8163,8 +8544,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -8177,13 +8558,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -8191,9 +8572,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8201,11 +8582,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -8215,8 +8596,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -8229,13 +8610,13 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -8243,9 +8624,9 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8253,11 +8634,11 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
} /* end for */
/* Close attribute's datatype */
@@ -8274,15 +8655,15 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
if(test_shared != 0) {
if(test_shared == 1) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Unlink datasets with attributes */
@@ -8298,20 +8679,20 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -8342,36 +8723,36 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
static void
test_attr_shared_rename(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* HDF5 File ID */
- hid_t my_fcpl; /* File creation property list ID */
- hid_t dataset, dataset2; /* Dataset ID2 */
- hid_t attr_tid; /* Attribute's datatype ID */
- hid_t sid, big_sid; /* Dataspace IDs */
- hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */
- char attrname2[NAME_BUF_SIZE]; /* Name of attribute on second dataset */
+ hid_t fid; /* HDF5 File ID */
+ hid_t my_fcpl; /* File creation property list ID */
+ hid_t dataset, dataset2; /* Dataset ID2 */
+ hid_t attr_tid; /* Attribute's datatype ID */
+ hid_t sid, big_sid; /* Dataspace IDs */
+ hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */
+ char attrname2[NAME_BUF_SIZE]; /* Name of attribute on second dataset */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
- htri_t is_shared; /* Is attributes shared? */
+ htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_shared; /* Is attributes shared? */
hsize_t shared_refcount; /* Reference count of shared attribute */
unsigned attr_value; /* Attribute value */
- unsigned *big_value; /* Data for "big" attribute */
+ unsigned *big_value; /* Data for "big" attribute */
size_t mesg_count; /* # of shared messages */
unsigned test_shared; /* Index over shared component type */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Renaming Shared & Unshared Attributes in Compact & Dense Storage\n"));
/* Allocate & initialize "big" attribute data */
big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned));
- CHECK(big_value, NULL, "HDmalloc");
+ CHECK_PTR(big_value, "HDmalloc");
HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3));
/* Create dataspace for dataset */
@@ -8446,8 +8827,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8458,14 +8844,14 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -8477,15 +8863,15 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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) {
@@ -8494,8 +8880,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -8508,13 +8894,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -8522,9 +8908,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8532,11 +8918,11 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -8546,8 +8932,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -8560,13 +8946,13 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -8574,9 +8960,9 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8584,15 +8970,15 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* 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);
@@ -8607,18 +8993,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
if(u % 2) {
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
} /* end if */
else {
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8631,18 +9017,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
if(u % 2) {
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
} /* end if */
else {
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8663,18 +9049,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
if(u % 2) {
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
} /* end if */
else {
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8687,18 +9073,18 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
if(u % 2) {
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
} /* end if */
else {
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8721,15 +9107,15 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
if(test_shared != 0) {
if(test_shared == 1) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Unlink datasets with attributes */
@@ -8745,20 +9131,20 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -8789,35 +9175,35 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
static void
test_attr_shared_delete(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* File ID */
- hid_t my_fcpl; /* File creation property list ID */
- hid_t dataset, dataset2; /* Dataset IDs */
- hid_t attr_tid; /* Attribute's datatype ID */
- hid_t sid, big_sid; /* Dataspace IDs */
- hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */
+ hid_t fid; /* File ID */
+ hid_t my_fcpl; /* File creation property list ID */
+ hid_t dataset, dataset2; /* Dataset IDs */
+ hid_t attr_tid; /* Attribute's datatype ID */
+ hid_t sid, big_sid; /* Dataspace IDs */
+ hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
- htri_t is_shared; /* Is attributes shared? */
+ htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_shared; /* Is attributes shared? */
hsize_t shared_refcount; /* Reference count of shared attribute */
unsigned attr_value; /* Attribute value */
- unsigned *big_value; /* Data for "big" attribute */
+ unsigned *big_value; /* Data for "big" attribute */
size_t mesg_count; /* # of shared messages */
unsigned test_shared; /* Index over shared component type */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deleting Shared & Unshared Attributes in Compact & Dense Storage\n"));
/* Allocate & initialize "big" attribute data */
big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned));
- CHECK(big_value, NULL, "HDmalloc");
+ CHECK_PTR(big_value, "HDmalloc");
HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3));
/* Create dataspace for dataset */
@@ -8892,8 +9278,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -8904,14 +9295,14 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -8923,15 +9314,15 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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) {
@@ -8940,8 +9331,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -8954,13 +9345,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -8968,9 +9359,9 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -8978,11 +9369,11 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -8992,8 +9383,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -9006,13 +9397,13 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -9020,9 +9411,9 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -9030,18 +9421,18 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
} /* end for */
/* 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);
@@ -9056,18 +9447,18 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
if(u % 2) {
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
} /* end if */
else {
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -9090,15 +9481,15 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
if(test_shared != 0) {
if(test_shared == 1) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 2, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 2, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Unlink datasets with attributes */
@@ -9114,20 +9505,20 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -9158,35 +9549,35 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
static void
test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* File ID */
- hid_t my_fcpl; /* File creation property list ID */
- hid_t dataset, dataset2; /* Dataset IDs */
- hid_t attr_tid; /* Attribute's datatype ID */
- hid_t sid, big_sid; /* Dataspace IDs */
- hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
- hid_t attr; /* Attribute ID */
- hid_t dcpl; /* Dataset creation property list ID */
- char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */
+ hid_t fid; /* File ID */
+ hid_t my_fcpl; /* File creation property list ID */
+ hid_t dataset, dataset2; /* Dataset IDs */
+ hid_t attr_tid; /* Attribute's datatype ID */
+ hid_t sid, big_sid; /* Dataspace IDs */
+ hsize_t big_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; /* Dimensions for "big" attribute */
+ hid_t attr; /* Attribute ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ char attrname[NAME_BUF_SIZE]; /* Name of attribute on first dataset */
unsigned max_compact; /* Maximum # of attributes to store compactly */
unsigned min_dense; /* Minimum # of attributes to store "densely" */
- htri_t is_dense; /* Are attributes stored densely? */
- htri_t is_shared; /* Is attributes shared? */
+ htri_t is_dense; /* Are attributes stored densely? */
+ htri_t is_shared; /* Is attributes shared? */
hsize_t shared_refcount; /* Reference count of shared attribute */
unsigned attr_value; /* Attribute value */
- unsigned *big_value; /* Data for "big" attribute */
+ unsigned *big_value; /* Data for "big" attribute */
size_t mesg_count; /* # of shared messages */
unsigned test_shared; /* Index over shared component type */
unsigned u; /* Local index variable */
h5_stat_size_t empty_filesize; /* Size of empty file */
h5_stat_size_t filesize; /* Size of file after modifications */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Unlinking Object with Shared Attributes in Compact & Dense Storage\n"));
/* Allocate & initialize "big" attribute data */
big_value = (unsigned *)HDmalloc((size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3) * sizeof(unsigned));
- CHECK(big_value, NULL, "HDmalloc");
+ CHECK_PTR(big_value, "HDmalloc");
HDmemset(big_value, 1, sizeof(unsigned) * (size_t)(SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3));
/* Create dataspace for dataset */
@@ -9261,8 +9652,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
/* Set up to query the object creation properties */
- dcpl = H5Pcreate(H5P_DATASET_CREATE);
- CHECK(dcpl, FAIL, "H5Pcreate");
+ if (dcpl_g == H5P_DEFAULT) {
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ } else {
+ dcpl = H5Pcopy(dcpl_g);
+ CHECK(dcpl, FAIL, "H5Pcopy");
+ }
/* Create datasets */
dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
@@ -9273,14 +9669,14 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Check on dataset's message storage status */
if(test_shared != 0) {
/* Datasets' datatypes can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
/* Datasets' dataspace can be shared */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 1, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Retrieve limits for compact/dense attribute storage */
@@ -9292,15 +9688,15 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pclose");
/* Check on datasets' attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
- is_dense = H5O_is_attr_dense_test(dataset2);
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset2);
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
/* 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) {
@@ -9309,8 +9705,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -9323,13 +9719,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* ChecFk that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -9337,9 +9733,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -9347,11 +9743,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
+ is_dense = H5O__is_attr_dense_test(dataset);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* Alternate between creating "small" & "big" attributes */
@@ -9361,8 +9757,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
/* Write data into the attribute */
attr_value = u + 1;
@@ -9375,13 +9771,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(attr, FAIL, "H5Acreate2");
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
/* Write data into the attribute */
big_value[0] = u + 1;
@@ -9389,9 +9785,9 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Awrite");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 2, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 2, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -9399,11 +9795,11 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Aclose");
/* Check on dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset2);
+ is_dense = H5O__is_attr_dense_test(dataset2);
if(u < max_compact)
- VERIFY(is_dense, FALSE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, FALSE, "H5O__is_attr_dense_test");
else
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
} /* end for */
@@ -9421,13 +9817,13 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
/* Check on first dataset's attribute storage status */
- is_dense = H5O_is_attr_dense_test(dataset);
- VERIFY(is_dense, TRUE, "H5O_is_attr_dense_test");
+ is_dense = H5O__is_attr_dense_test(dataset);
+ VERIFY(is_dense, TRUE, "H5O__is_attr_dense_test");
/* 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);
@@ -9435,18 +9831,18 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
if(u % 2) {
/* Check that attribute is not shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, FALSE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, FALSE, "H5A__is_shared_test");
} /* end if */
else {
/* Check that attribute is shared */
- is_shared = H5A_is_shared_test(attr);
- VERIFY(is_shared, TRUE, "H5A_is_shared_test");
+ is_shared = H5A__is_shared_test(attr);
+ VERIFY(is_shared, TRUE, "H5A__is_shared_test");
/* Check refcount for attribute */
- ret = H5A_get_shared_rc_test(attr, &shared_refcount);
- CHECK(ret, FAIL, "H5A_get_shared_rc_test");
- VERIFY(shared_refcount, 1, "H5A_get_shared_rc_test");
+ ret = H5A__get_shared_rc_test(attr, &shared_refcount);
+ CHECK(ret, FAIL, "H5A__get_shared_rc_test");
+ VERIFY(shared_refcount, 1, "H5A__get_shared_rc_test");
} /* end else */
/* Close attribute */
@@ -9469,20 +9865,20 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
} /* end if */
/* Check on attribute storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_ATTR_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
if(test_shared != 0) {
/* Check on datatype storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_DTYPE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
/* Check on dataspace storage status */
- ret = H5F_get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(mesg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(fid, H5O_SDSPACE_ID, &mesg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(mesg_count, 0, "H5F__get_sohm_mesg_count_test");
} /* end if */
/* Close file */
@@ -9670,7 +10066,7 @@ test_attr_bug2(hid_t fcpl, hid_t fapl)
hid_t tid; /* Datatype ID */
hid_t gcpl; /* Group creation property list */
hsize_t dims[2] = {10, 100}; /* Attribute dimensions */
- char aname[4]; /* Attribute name */
+ char aname[16]; /* Attribute name */
unsigned i; /* index */
herr_t ret; /* Generic return status */
htri_t tri_ret; /* htri_t return status */
@@ -9702,7 +10098,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");
@@ -9712,7 +10108,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");
}
@@ -9736,7 +10132,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");
@@ -9779,7 +10175,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");
@@ -9789,7 +10185,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");
}
@@ -9853,7 +10249,7 @@ test_attr_bug3(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Create dataset */
- did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ did = H5Dcreate2(fid, "dset", tid2, sid2, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
/* Create attribute on datatype, using that datatype as its datatype */
@@ -9988,7 +10384,7 @@ test_attr_bug4(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Create dataset */
- did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");
/* Create attributes on group and dataset */
@@ -10070,7 +10466,7 @@ test_attr_bug5(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Tcommit2");
/* Create dataset */
- did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ did1 = H5Dcreate2(fid1, BUG3_DSET_NAME, tid1, sid, H5P_DEFAULT, dcpl_g, H5P_DEFAULT);
CHECK(did1, FAIL, "H5Dcreate2");
/* Create attribute on root group */
@@ -10468,9 +10864,10 @@ test_attr_bug8(hid_t fcpl, hid_t fapl)
hid_t gid; /* Group ID */
hid_t oid; /* Object ID */
hsize_t dims = 256; /* Attribute dimensions */
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
H5A_info_t ainfo; /* Attribute info */
haddr_t root_addr; /* Root group address */
+ haddr_t link_addr; /* Link (to root group) address */
herr_t ret; /* Generic return status */
/* Output message about test being performed */
@@ -10486,9 +10883,10 @@ test_attr_bug8(hid_t fcpl, hid_t fapl)
CHECK(gid, FAIL, "H5Gcreate2");
/* Get root group address */
- ret = H5Oget_info(fid, &oinfo);
+ ret = H5Oget_info3(fid, &oinfo, H5O_INFO_BASIC);
CHECK(ret, FAIL, "H5Oget_info");
- root_addr = oinfo.addr;
+ ret = H5VLnative_token_to_addr(fid, oinfo.token, &root_addr);
+ CHECK(ret, FAIL, "H5VLnative_token_to_addr");
/*
* Create link to root group
@@ -10511,10 +10909,12 @@ test_attr_bug8(hid_t fcpl, hid_t fapl)
CHECK(gid, FAIL, "H5Gopen2");
oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT);
CHECK(oid, FAIL, "H5Oopen");
- ret = H5Oget_info(oid, &oinfo);
+ ret = H5Oget_info3(oid, &oinfo, H5O_INFO_BASIC);
CHECK(ret, FAIL, "H5Oget_info");
- if(oinfo.addr != root_addr)
- TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr);
+ ret = H5VLnative_token_to_addr(fid, oinfo.token, &link_addr);
+ CHECK(ret, FAIL, "H5VLnative_token_to_addr");
+ if(link_addr != root_addr)
+ TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)link_addr, (long long unsigned)root_addr);
/* Close file */
ret = H5Fclose(fid);
@@ -10556,10 +10956,12 @@ test_attr_bug8(hid_t fcpl, hid_t fapl)
CHECK(gid, FAIL, "H5Gopen2");
oid = H5Oopen(gid, LINK1_NAME, H5P_DEFAULT);
CHECK(oid, FAIL, "H5Oopen");
- ret = H5Oget_info(oid, &oinfo);
+ ret = H5Oget_info3(oid, &oinfo, H5O_INFO_BASIC);
CHECK(ret, FAIL, "H5Oget_info");
- if(oinfo.addr != root_addr)
- TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)oinfo.addr, (long long unsigned)root_addr);
+ ret = H5VLnative_token_to_addr(fid, oinfo.token, &link_addr);
+ CHECK(ret, FAIL, "H5VLnative_token_to_addr");
+ if(link_addr != root_addr)
+ TestErrPrintf("incorrect link target address: addr: %llu, expected: %llu\n", (long long unsigned)link_addr, (long long unsigned)root_addr);
ret = H5Aget_info_by_name(gid, ".", ATTR1_NAME, &ainfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Aget_info_by_name");
if(ainfo.data_size != dims)
@@ -10578,126 +10980,296 @@ test_attr_bug8(hid_t fcpl, hid_t fapl)
/****************************************************************
**
+** test_attr_bug9(): Test basic H5A (attribute) code.
+** (Really tests object header code).
+** Tests adding several large attributes to an object until
+** they convert to dense storage. The total size of all
+** attributes is larger than 64K, causing the internal
+** object header code to, after merging the deleted
+** messages in to a NULL message, shrink the object header
+** chunk. Do this twice: once with only attributes in the
+** object header chunk and once with a (small) soft link in
+** the chunk as well. In both cases, the shrunk chunk will
+** initally be too small and a new NULL message must be
+** created.
+**
+****************************************************************/
+static void
+test_attr_bug9(hid_t fcpl, hid_t fapl)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hsize_t dims[1] = {32768}; /* Attribute dimensions */
+ int create_link; /* Whether to create a soft link */
+ unsigned max_compact; /* Setting from fcpl */
+ unsigned min_dense; /* Setting from fcpl */
+ char aname[11]; /* Attribute name */
+ unsigned i; /* Local index variable */
+ herr_t ret; /* Generic return status */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing that attributes can always be added to named datatypes\n"));
+
+ /* Create dataspace */
+ sid = H5Screate_simple(1, dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Obtain attribute phase change settings */
+ ret = H5Pget_attr_phase_change(fcpl, &max_compact, &min_dense);
+ CHECK(ret, FAIL, "H5Pget_attr_phase_change");
+
+ /* Run with and without the soft link */
+ for(create_link = 0; create_link < 2; create_link++) {
+ /* Create file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create second group */
+ gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Close second group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open root group */
+ gid = H5Gopen2(fid, "/", H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen2");
+
+ /* Create enough attributes to cause a change to dense storage */
+ for(i = 0; i < max_compact + 1; i++) {
+ /* Create attribute */
+ HDsnprintf(aname, sizeof(aname), "%u", i);
+ aid = H5Acreate2(gid, aname, H5T_NATIVE_CHAR, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Close attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Create enough soft links that exactly one goes into chunk 1 if
+ * requested */
+ if(i == 0 && create_link) {
+ ret = H5Lcreate_soft("b", gid, "a", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lcreate_soft");
+ ret = H5Lcreate_soft("d", gid, "c", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lcreate_soft");
+ ret = H5Lcreate_soft("f", gid, "e", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lcreate_soft");
+ } /* end if */
+ } /* end for */
+
+ /* Close IDs */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ } /* end for */
+
+ /* Close dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+} /* test_attr_bug9() */
+
+/****************************************************************
+**
+** 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.
+**
+****************************************************************/
+static void
+test_attr_delete_last_dense(hid_t fcpl, hid_t fapl)
+{
+ hid_t fid; /* File ID */
+ hid_t gid; /* Group ID */
+ hid_t aid; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hsize_t dim2[2] = {DIM0, DIM1}; /* Dimension sizes */
+ int i, j; /* Local index variables */
+ double *data = NULL; /* Pointer to the data buffer */
+ herr_t ret; /* Generic return status */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Deleting the last large attribute stored densely\n"));
+
+ /* Create the file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create the group */
+ gid = H5Gcreate2(fid, GRPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate");
+
+ /* Create the dataspace */
+ sid = H5Screate_simple(RANK, dim2, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Attach the attribute to the group */
+ aid = H5Acreate2(gid, ATTRNAME, H5T_IEEE_F64LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Allocate the data buffer */
+ data = (double *)HDmalloc((size_t)(DIM0 * DIM1) * sizeof(double));
+ CHECK_PTR(data, "HDmalloc");
+
+ /* Initialize the data */
+ for(i = 0; i < DIM0; i++)
+ for(j = 0; j < DIM1; j++)
+ *(data + i * DIM1 + j) = i + j;
+
+ /* Write to the attribute */
+ ret = H5Awrite(aid, H5T_NATIVE_DOUBLE, data);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Closing */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Open the group */
+ gid = H5Gopen2(fid, GRPNAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen");
+
+ /* Delete the attribute */
+ ret = H5Adelete(gid, ATTRNAME);
+ CHECK(ret, FAIL, "H5Adelete");
+
+ /* Closing */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free the data buffer */
+ if(data)
+ HDfree(data);
+
+} /* test_attr_delete_last_dense() */
+
+/****************************************************************
+**
** test_attr(): Main H5A (attribute) testing routine.
**
****************************************************************/
void
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 fapl = (-1), fapl2 = (-1); /* File access property lists */
+ hid_t fcpl = (-1), fcpl2 = (-1); /* File creation property lists */
+ 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 */
- /* Output message about test being performed */
MESSAGE(5, ("Testing Attributes\n"));
- /* Create a default file access property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
- /* Copy the file access property list */
+ /* fapl2 uses "latest version of the format" for creating objects in the file */
fapl2 = H5Pcopy(fapl);
CHECK(fapl2, FAIL, "H5Pcopy");
-
- /* Set the "use the latest version of the format" bounds for creating objects in the file */
ret = H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
- /* Create a default file creation property list */
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK(fcpl, FAIL, "H5Pcreate");
- /* Copy the file creation property list */
+ /* files with fcpl2 make all attributes ( > 1 byte) shared
+ * (i.e. all of them :-) */
fcpl2 = H5Pcopy(fcpl);
CHECK(fcpl2, FAIL, "H5Pcopy");
-
- /* Make attributes > 1 byte shared (i.e. all of them :-) */
ret = H5Pset_shared_mesg_nindexes(fcpl2, (unsigned)1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
ret = H5Pset_shared_mesg_index(fcpl2, (unsigned)0, H5O_SHMESG_ATTR_FLAG, (unsigned)1);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- /* Loop over using new group format */
- 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;
- } /* end if */
- else {
- MESSAGE(7, ("testing with old file format\n"));
- my_fapl = fapl;
- } /* end else */
+ for(minimize_dset_oh = 0; minimize_dset_oh <= 1; minimize_dset_oh++) {
+ if(minimize_dset_oh == 0) {
+ MESSAGE(7, ("testing with default dataset object headers\n"));
+ dcpl_g = H5P_DEFAULT;
+ } else {
+ MESSAGE(7, ("testing with minimzied dataset object headers\n"));
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+ ret = H5Pset_dset_no_attrs_hint(dcpl, TRUE);
+ CHECK_I(ret, "H5Pset_dset_no_attrs_hint");
+ dcpl_g = dcpl;
+ }
+
+ 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;
+ } else {
+ MESSAGE(7, ("testing with old file format\n"));
+ my_fapl = fapl;
+ }
- /* These next two tests use the same file information */
- test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
- test_attr_basic_read(my_fapl); /* Test basic H5A reading code */
+ /* These next two tests use the same file information */
+ test_attr_basic_write(my_fapl); /* Test basic H5A writing code */
+ test_attr_basic_read(my_fapl); /* Test basic H5A reading code */
- /* These next two tests use their own file information */
- test_attr_flush(my_fapl); /* Test H5A I/O in the presence of H5Fflush calls */
- test_attr_plist(my_fapl); /* Test attribute property lists */
+ /* These next two tests use their own file information */
+ test_attr_flush(my_fapl); /* Test H5A I/O in the presence of H5Fflush calls */
+ test_attr_plist(my_fapl); /* Test attribute property lists */
- /* These next two tests use the same file information */
- test_attr_compound_write(my_fapl); /* Test complex datatype H5A writing code */
- test_attr_compound_read(my_fapl); /* Test complex datatype H5A reading code */
+ /* These next two tests use the same file information */
+ test_attr_compound_write(my_fapl); /* Test complex datatype H5A writing code */
+ test_attr_compound_read(my_fapl); /* Test complex datatype H5A reading code */
- /* These next two tests use the same file information */
- test_attr_scalar_write(my_fapl); /* Test scalar dataspace H5A writing code */
- test_attr_scalar_read(my_fapl); /* Test scalar dataspace H5A reading code */
+ /* These next two tests use the same file information */
+ test_attr_scalar_write(my_fapl); /* Test scalar dataspace H5A writing code */
+ test_attr_scalar_read(my_fapl); /* Test scalar dataspace H5A reading code */
- /* These next four tests use the same file information */
- test_attr_mult_write(my_fapl); /* Test H5A writing code for multiple attributes */
- test_attr_mult_read(my_fapl); /* Test H5A reading code for multiple attributes */
- test_attr_iterate(my_fapl); /* Test H5A iterator code */
- test_attr_delete(my_fapl); /* Test H5A code for deleting attributes */
+ /* These next four tests use the same file information */
+ test_attr_mult_write(my_fapl); /* Test H5A writing code for multiple attributes */
+ test_attr_mult_read(my_fapl); /* Test H5A reading code for multiple attributes */
+ test_attr_iterate(my_fapl); /* Test H5A iterator code */
+ test_attr_delete(my_fapl); /* Test H5A code for deleting attributes */
- /* This next test uses its own file information */
- test_attr_dtype_shared(my_fapl); /* Test using shared dataypes in attributes */
+ /* This next test uses its own file information */
+ test_attr_dtype_shared(my_fapl); /* Test using shared dataypes in attributes */
- /* This next test uses its own file information */
- test_attr_duplicate_ids(my_fapl);
+ /* This next test uses its own file information */
+ test_attr_duplicate_ids(my_fapl);
- /* Tests on "new format" attribute storage */
- if(new_format == TRUE) {
- /* Loop over using shared attributes */
for(use_shared = FALSE; use_shared <= TRUE; use_shared++) {
hid_t my_fcpl;
- /* Set the FCPL for shared or not */
- if(use_shared) {
+ if(new_format == TRUE && use_shared) {
MESSAGE(7, ("testing with shared attributes\n"));
my_fcpl = fcpl2;
- } /* end if */
- else {
+ } else {
MESSAGE(7, ("testing without shared attributes\n"));
my_fcpl = fcpl;
- } /* end else */
-
- /* General attribute tests */
- test_attr_dense_create(my_fcpl, my_fapl); /* Test dense attribute storage creation */
- test_attr_dense_open(my_fcpl, my_fapl); /* Test opening attributes in dense storage */
- test_attr_dense_delete(my_fcpl, my_fapl); /* Test deleting attributes in dense storage */
- test_attr_dense_rename(my_fcpl, my_fapl); /* Test renaming attributes in dense storage */
- test_attr_dense_unlink(my_fcpl, my_fapl); /* Test unlinking object with attributes in dense storage */
- 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 */
+ }
test_attr_big(my_fcpl, my_fapl); /* Test storing big attribute */
test_attr_null_space(my_fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */
-
- /* 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 */
- test_attr_corder_create_reopen(my_fcpl, my_fapl);/* Test creating attributes w/reopening file from using new format to using old format */
- 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 */
+ test_attr_info_null_info_pointer(my_fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */
+ 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 */
test_attr_info_by_idx(new_format, my_fcpl, my_fapl); /* Test querying attribute info by index */
@@ -10707,14 +11279,6 @@ 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 */
- /* More complex tests with 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 */
- test_attr_shared_delete(my_fcpl, my_fapl); /* Test deleting shared attributes in compact & dense storage */
- test_attr_shared_unlink(my_fcpl, my_fapl); /* Test unlinking object with shared attributes in compact & dense storage */
- } /* end if */
-
/* 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 */
@@ -10722,38 +11286,57 @@ test_attr(void)
test_attr_bug4(my_fcpl, my_fapl); /* Test attributes on named datatypes */
test_attr_bug5(my_fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
test_attr_bug6(my_fcpl, my_fapl); /* Test reading empty attribute */
- test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
+ /* test_attr_bug7 is specific to the "new" object header format,
+ * and in fact fails if used with the old format due to the
+ * attributes being larger than 64K */
test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
- } /* end for */
- } /* end if */
- else {
- /* General attribute tests */
- test_attr_big(fcpl, my_fapl); /* Test storing big attribute */
- test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
- test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
- test_attr_many(new_format, fcpl, my_fapl); /* Test storing lots of attributes */
-
- /* New attribute API routine tests, on old-format storage */
- test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */
- test_attr_delete_by_idx(new_format, fcpl, my_fapl); /* Test deleting attribute by index */
- test_attr_iterate2(new_format, fcpl, my_fapl); /* Test iterating over attributes by index */
- test_attr_open_by_idx(new_format, fcpl, my_fapl); /* Test opening attributes by index */
- test_attr_open_by_name(new_format, fcpl, my_fapl); /* Test opening attributes by name */
- test_attr_create_by_name(new_format, fcpl, my_fapl); /* Test creating attributes by name */
-
- /* Tests that address specific bugs */
- test_attr_bug1(fcpl, my_fapl); /* Test odd allocation operations */
- test_attr_bug2(fcpl, my_fapl); /* Test many deleted attributes */
- test_attr_bug3(fcpl, my_fapl); /* Test "self referential" attributes */
- test_attr_bug4(fcpl, my_fapl); /* Test attributes on named datatypes */
- test_attr_bug5(fcpl, my_fapl); /* Test opening/closing attributes through different file handles */
- test_attr_bug6(fcpl, my_fapl); /* Test reading empty attribute */
- /* Skip test_attr_bug7 because it is specific to the new object
- * header format and in fact fails if used with the old format, due
- * to the attributes being larger than 64K */
- test_attr_bug8(fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
- } /* end else */
- } /* end for */
+ test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */
+
+ /* 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 */
+ test_attr_dense_open(my_fcpl, my_fapl); /* Test opening attributes in dense storage */
+ test_attr_dense_delete(my_fcpl, my_fapl); /* Test deleting attributes in dense storage */
+ test_attr_dense_rename(my_fcpl, my_fapl); /* Test renaming attributes in dense storage */
+ test_attr_dense_unlink(my_fcpl, my_fapl); /* Test unlinking object with attributes in dense storage */
+ 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 */
+ 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 */
+ test_attr_corder_create_reopen(my_fcpl, my_fapl);/* Test creating attributes w/reopening file from using new format to using old format */
+ 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 */
+ 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 */
+ test_attr_shared_delete(my_fcpl, my_fapl); /* Test deleting shared attributes in compact & dense storage */
+ test_attr_shared_unlink(my_fcpl, my_fapl); /* Test unlinking object with shared attributes in compact & dense storage */
+ } /* if using shared attributes */
+
+ test_attr_delete_last_dense(my_fcpl, my_fapl);
+
+ /* test_attr_bug7 is specific to the "new" object header format,
+ * and in fact fails if used with the old format due to the
+ * attributes being larger than 64K */
+ test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
+
+ } /* if using "new format" */
+ } /* for unshared/shared attributes */
+ } /* for old/new format */
+
+ if (minimize_dset_oh != 0) {
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ dcpl_g = H5P_DEFAULT;
+ }
+
+ } /* for default/minimized dataset object headers */
/* Close FCPLs */
ret = H5Pclose(fcpl);
@@ -10768,15 +11351,15 @@ test_attr(void)
CHECK(ret, FAIL, "H5Pclose");
} /* test_attr() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_attr
+ * Function: cleanup_attr
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
@@ -10786,6 +11369,6 @@ test_attr(void)
void
cleanup_attr(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tbogus.h5 b/test/tbogus.h5
index 91ab76f..efcbd79 100644
--- a/test/tbogus.h5
+++ b/test/tbogus.h5
Binary files differ
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/tchecksum.c b/test/tchecksum.c
index febaacc..6e509fb 100644
--- a/test/tchecksum.c
+++ b/test/tchecksum.c
@@ -187,7 +187,7 @@ test_chksum_large(void)
/* Allocate the buffer */
large_buf = (uint8_t *)HDmalloc((size_t)BUF_LEN);
- CHECK(large_buf, NULL, "HDmalloc");
+ CHECK_PTR(large_buf, "HDmalloc");
/* Initialize buffer w/known data */
for(u = 0; u < BUF_LEN; u++)
@@ -252,7 +252,7 @@ test_checksum(void)
*
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE H5_ATTR_CONST void
+void
cleanup_checksum(void)
{
/* no file to clean */
diff --git a/test/tconfig.c b/test/tconfig.c
index a9f3378..1a81d50 100644
--- a/test/tconfig.c
+++ b/test/tconfig.c
@@ -19,7 +19,6 @@
*
*************************************************************/
-#include "hdf5.h"
#include "testhdf5.h"
/* macros definitions */
@@ -40,22 +39,22 @@
/* Needs this extra step so that we can print the macro name. */
#define vrfy_macrosize(type, macro, macroname) \
if (sizeof(type) != macro) \
- TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \
- #type, sizeof(type), macroname, (int)macro);
+ TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \
+ #type, sizeof(type), macroname, (int)macro);
/* local routine prototypes */
void test_config_ctypes(void);
void test_exit_definitions(void);
-
+
/*-------------------------------------------------------------------------
- * Function: test_configure
+ * Function: test_configure
*
- * Purpose: Main configure definitions testing routine
+ * Purpose: Main configure definitions testing routine
*
- * Return: none (error is fed back via global variable num_errs)
+ * Return: none (error is fed back via global variable num_errs)
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* September 25, 2001
*
*-------------------------------------------------------------------------
@@ -69,45 +68,45 @@ test_configure(void)
test_exit_definitions();
}
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_configure
+ * Function: cleanup_configure
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* September 25, 2001
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE void
+void
cleanup_configure(void)
{
/* no file to clean */
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_config_ctypes
+ * Function: test_config_ctypes
*
- * Purpose: test C language data type sizes
+ * Purpose: test C language data type sizes
*
- * Return: none (error is fed back via global variable num_errs)
+ * Return: none (error is fed back via global variable num_errs)
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* September 25, 2001
*
* Modifications:
- * Albert Cheng, 2004/10/14
- * Verified both signed and unsigned int types.
+ * Albert Cheng, 2004/10/14
+ * Verified both signed and unsigned int types.
*
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE void
+void
test_config_ctypes(void)
{
/* standard C89 basic types */
@@ -201,30 +200,30 @@ test_config_ctypes(void)
}
-
+
/*-------------------------------------------------------------------------
- * Function: test_exit_definitions
+ * Function: test_exit_definitions
*
- * Purpose: test the exit macros values
+ * Purpose: test the exit macros values
*
- * Return: none (error is fed back via global variable num_errs)
+ * Return: none (error is fed back via global variable num_errs)
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* October 12, 2009
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE void
+void
test_exit_definitions(void)
{
/* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */
/* This should be true for POSIX compliant systems. */
if (EXIT_SUCCESS != 0) \
- TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \
- EXIT_SUCCESS, 0);
+ TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \
+ EXIT_SUCCESS, 0);
if (EXIT_FAILURE != 1) \
- TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \
- EXIT_FAILURE, 1);
+ TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \
+ EXIT_FAILURE, 1);
}
diff --git a/test/tcoords.c b/test/tcoords.c
index d729d4b..f639d4b 100644
--- a/test/tcoords.c
+++ b/test/tcoords.c
@@ -669,22 +669,22 @@ static void test_multiple_ends(hid_t file, hbool_t is_chunked)
void test_coords(void)
{
hid_t fid;
+ hbool_t is_chunk[2] = {TRUE, FALSE};
int i;
- hbool_t is_chunk;
herr_t ret; /* Generic error return */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
- for(i=0, is_chunk=FALSE; i<2; i++, is_chunk++) {
+ for (i = 0; i < 2; i++) {
/* Test H5Sselect_elements with selection of one block of data */
- test_singleEnd_selElements(fid, is_chunk);
+ test_singleEnd_selElements(fid, is_chunk[i]);
/* Test H5Sselect_hyperslab with selection of one block of data */
- test_singleEnd_selHyperslab(fid, is_chunk);
+ test_singleEnd_selHyperslab(fid, is_chunk[i]);
/* Test H5Sselect_hyperslab with selection of multiple blocks of data */
- test_multiple_ends(fid, is_chunk);
+ test_multiple_ends(fid, is_chunk[i]);
}
ret = H5Fclose(fid);
diff --git a/test/test_plugin.sh.in b/test/test_filter_plugin.sh.in
index c90a978..e8c53e4 100644
--- a/test/test_plugin.sh.in
+++ b/test/test_filter_plugin.sh.in
@@ -1,10 +1,10 @@
#! /bin/sh
#
-# 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
+# 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
@@ -13,7 +13,7 @@
srcdir=@srcdir@
TOP_BUILDDIR=@top_builddir@
-# Determine backward compatibility options enabled
+# Determine if backward compatibility options enabled
DEPRECATED_SYMBOLS="@DEPRECATED_SYMBOLS@"
EXIT_SUCCESS=0
@@ -23,21 +23,21 @@ nerrors=0
verbose=yes
exit_code=$EXIT_SUCCESS
-TEST_NAME=plugin
+TEST_NAME=filter_plugin
TEST_BIN=`pwd`/$TEST_NAME
FROM_DIR=`pwd`/.libs
case $(uname) in
CYGWIN* )
- PLUGIN_LIB1="$FROM_DIR/cygdynlib1* $FROM_DIR/cygdynlib3*"
- PLUGIN_LIB2="$FROM_DIR/cygdynlib2* $FROM_DIR/cygdynlib4*"
+ PLUGINS_FOR_DIR1="$FROM_DIR/cygfilter_plugin1* $FROM_DIR/cygfilter_plugin3*"
+ PLUGINS_FOR_DIR2="$FROM_DIR/cygfilter_plugin2* $FROM_DIR/cygfilter_plugin4*"
;;
*)
- PLUGIN_LIB1="$FROM_DIR/libdynlib1.* $FROM_DIR/libdynlib3.*"
- PLUGIN_LIB2="$FROM_DIR/libdynlib2.* $FROM_DIR/libdynlib4.*"
+ PLUGINS_FOR_DIR1="$FROM_DIR/libfilter_plugin1* $FROM_DIR/libfilter_plugin3*"
+ PLUGINS_FOR_DIR2="$FROM_DIR/libfilter_plugin2* $FROM_DIR/libfilter_plugin4*"
;;
esac
-PLUGIN_LIBDIR1=testdir1
-PLUGIN_LIBDIR2=testdir2
+PLUGIN_DIR1=filter_plugin_dir1
+PLUGIN_DIR2=filter_plugin_dir2
CP="cp -p" # Use -p to preserve mode,ownership,timestamps
RM="rm -rf"
@@ -50,34 +50,34 @@ TESTING() {
}
# Main Body
-# Create test directories if not exists yet.
-test -d $PLUGIN_LIBDIR1 || mkdir -p $PLUGIN_LIBDIR1
+# Create test directories if necessary.
+test -d $PLUGIN_DIR1 || mkdir -p $PLUGIN_DIR1
if [ $? != 0 ]; then
- echo "Failed to create test directory($PLUGIN_LIBDIR1)"
+ echo "Failed to create filter plugin test directory ($PLUGIN_DIR1)"
exit $EXIT_FAILURE
fi
-test -d $PLUGIN_LIBDIR2 || mkdir -p $PLUGIN_LIBDIR2
+test -d $PLUGIN_DIR2 || mkdir -p $PLUGIN_DIR2
if [ $? != 0 ]; then
- echo "Failed to create test directory($PLUGIN_LIBDIR2)"
+ echo "Failed to create filter plugin test directory ($PLUGIN_DIR2)"
exit $EXIT_FAILURE
fi
-# copy plugin library for test
-$CP $PLUGIN_LIB1 $PLUGIN_LIBDIR1
+# Copy plugins for the tests.
+$CP $PLUGINS_FOR_DIR1 $PLUGIN_DIR1
if [ $? != 0 ]; then
- echo "Failed to copy plugin library ($PLUGIN_LIB1) for test."
+ echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR1) to test directory."
exit $EXIT_FAILURE
fi
-$CP $PLUGIN_LIB2 $PLUGIN_LIBDIR2
+$CP $PLUGINS_FOR_DIR2 $PLUGIN_DIR2
if [ $? != 0 ]; then
- echo "Failed to copy plugin library ($PLUGIN_LIB2) for test."
+ echo "Failed to copy filter plugins ($PLUGINS_FOR_DIR2) to test directory."
exit $EXIT_FAILURE
fi
# setup plugin path
-ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_LIBDIR1}:${PLUGIN_LIBDIR2}"
+ENVCMD="env HDF5_PLUGIN_PATH=${PLUGIN_DIR1}:${PLUGIN_DIR2}"
# Run the test
$ENVCMD $TEST_BIN
@@ -87,9 +87,9 @@ fi
############################################
# HDFFV-9655 test for relative path disabled
-# setup plugin path relative to test
+# setup filter plugin path relative to test
# actual executable is in the .libs folder
-#ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_LIBDIR1}:@/../${PLUGIN_LIBDIR2}"
+#ENVCMD="env HDF5_PLUGIN_PATH=@/../${PLUGIN_DIR1}:@/../${PLUGIN_DIR2}"
#
# Run the test
#$ENVCMD $TEST_BIN
@@ -103,11 +103,11 @@ if test $nerrors -ne 0 ; then
echo "$nerrors errors encountered"
exit_code=$EXIT_FAILURE
else
- echo "All Plugin API tests passed."
+ echo "All filter plugin tests passed."
exit_code=$EXIT_SUCCESS
fi
# Clean up temporary files/directories and leave
-$RM $PLUGIN_LIBDIR1 $PLUGIN_LIBDIR2
+$RM $PLUGIN_DIR1 $PLUGIN_DIR2
exit $exit_code
diff --git a/test/test_mirror.sh.in b/test/test_mirror.sh.in
new file mode 100644
index 0000000..9635c38
--- /dev/null
+++ b/test/test_mirror.sh.in
@@ -0,0 +1,100 @@
+#! /bin/bash
+#
+# 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.
+#
+# Tests for the Mirror VFD feature.
+#
+# Created:
+# Jacob Smith, 2019-12-30
+
+###############################################################################
+## test parameters
+###############################################################################
+
+nerrors=0
+
+SERVER_VERBOSITY="--verbosity=1"
+SERVER_PORT="--port=3000"
+
+
+###############################################################################
+## Main
+###############################################################################
+
+## TODO: arguments for main port, port range, verbosity?
+# Parse options (none accepted at this time)
+while [ $# -gt 0 ]; do
+ case "$1" in
+ *) # unknown option
+ echo "$0: Unknown option ($1)"
+ exit 1
+ ;;
+ esac
+done
+
+
+
+RUN_DIR=mirror_vfd_test
+MIRROR_UTILS=../utils/mirror_vfd # TODO: presupposes from test/
+
+mkdir $RUN_DIR
+
+# Copy program files into dedicated test directory
+for FILE in $MIRROR_UTILS/mirror_* ; do
+ case "$FILE" in
+ *.o) continue ;; # Don't copy .o files
+ esac
+ cp $FILE $RUN_DIR
+done
+cp mirror_vfd $RUN_DIR
+
+# With the --disable-shared option, program files are built in their main
+# directories; otherwise they are built in dir/.libs with a corresponding
+# wrapper script. Copy these libs builds if appropriate.
+if [ -f $MIRROR_UTILS/.libs/mirror_server ] ; then
+ RUN_LIBS=$RUN_DIR/.libs
+ mkdir $RUN_LIBS
+ for FILE in $MIRROR_UTILS/.libs/mirror_* ; do
+ case "$FILE" in
+ *.o) continue ;; # Don't copy .o files
+ esac
+ cp $FILE $RUN_LIBS
+ done
+ cp .libs/mirror_vfd $RUN_LIBS
+fi
+
+cd $RUN_DIR
+
+echo "Launching Mirror Server"
+SERVER_ARGS="$SERVER_PORT $SERVER_VERBOSITY"
+./mirror_server $SERVER_ARGS &
+
+./mirror_vfd
+nerrors=$?
+
+echo "Stopping Mirror Server"
+./mirror_server_stop $SERVER_PORT
+
+###############################################################################
+## Report and exit
+###############################################################################
+cd ..
+if test $nerrors -eq 0 ; then
+ echo "Mirror VFD tests passed."
+ if test -z "$HDF5_NOCLEANUP" ; then
+ rm -rf $RUN_DIR
+ fi
+ exit 0
+else
+ echo "Mirror VFD tests FAILED."
+ exit 1
+fi
+
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/test_vol_plugin.sh.in b/test/test_vol_plugin.sh.in
new file mode 100644
index 0000000..32d1c12
--- /dev/null
+++ b/test/test_vol_plugin.sh.in
@@ -0,0 +1,84 @@
+#! /bin/sh
+#
+# 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.
+#
+# This shell script is for testing VOL connector plugins.
+#
+srcdir=@srcdir@
+TOP_BUILDDIR=@top_builddir@
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+nerrors=0
+verbose=yes
+exit_code=$EXIT_SUCCESS
+
+TEST_NAME=vol_plugin
+TEST_BIN=`pwd`/$TEST_NAME
+FROM_DIR=`pwd`/.libs
+case $(uname) in
+ CYGWIN* )
+ NULL_VOL_PLUGIN="$FROM_DIR/cygnull_vol_connector*"
+ ;;
+ *)
+ NULL_VOL_PLUGIN="$FROM_DIR/libnull_vol_connector*"
+ ;;
+esac
+TEMP_PLUGIN_DIR=null_vol_plugin_dir
+CP="cp -p" # Use -p to preserve mode,ownership, timestamps
+RM="rm -rf"
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+TESTING() {
+ SPACES=" "
+ echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# Main Body
+# Create test directory if necessary.
+test -d $TEMP_PLUGIN_DIR || mkdir -p $TEMP_PLUGIN_DIR
+if [ $? != 0 ]; then
+ echo "Failed to create VOL connector plugin test directory ($TEMP_PLUGIN_DIR)"
+ exit $EXIT_FAILURE
+fi
+
+# Copy plugin for the tests.
+$CP $NULL_VOL_PLUGIN $TEMP_PLUGIN_DIR
+if [ $? != 0 ]; then
+ echo "Failed to copy NULL VOL plugin ($NULL_VOL_PLUGIN) to test directory."
+ exit $EXIT_FAILURE
+fi
+
+# setup plugin path
+ENVCMD="env HDF5_PLUGIN_PATH=${TEMP_PLUGIN_DIR}"
+
+# Run the test
+$ENVCMD $TEST_BIN
+if [ $? != 0 ]; then
+ nerrors=`expr $nerrors + 1`
+fi
+
+# print results
+if test $nerrors -ne 0 ; then
+ echo "$nerrors errors encountered"
+ exit_code=$EXIT_FAILURE
+else
+ echo "All VOL plugin tests passed."
+ exit_code=$EXIT_SUCCESS
+fi
+
+# Clean up temporary files/directories and leave
+$RM $TEMP_PLUGIN_DIR
+
+exit $exit_code
diff --git a/test/testabort_fail.sh.in b/test/testabort_fail.sh.in
new file mode 100644
index 0000000..c86bf8a
--- /dev/null
+++ b/test/testabort_fail.sh.in
@@ -0,0 +1,66 @@
+#! /bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# Test to verify that the assertion/abort failure is fixed when the application
+# does not close the file. (See HDFFV-10160)
+#
+# Test to verify that the infinite loop closing library/abort failure is fixed
+# when the application creates and removes dense attributes (See HDFFV-10659)
+
+srcdir=@srcdir@
+
+nerrors=0
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+#
+#
+echo "Testing file not closed assertion/abort failure"
+TEST_NAME=filenotclosed # The test name
+TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+#
+# Run the test
+$RUNSERIAL $TEST_BIN >/dev/null 2>&1
+exitcode=$?
+if [ $exitcode -eq 0 ]; then
+ echo "Test PASSED"
+else
+ echo "Test FAILED"
+ nerrors="`expr $nerrors + 1`"
+fi
+#
+#
+echo "Testing infinite loop closing library/abort failure"
+TEST_NAME=del_many_dense_attrs # The test name
+TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+# Run the test
+$RUNSERIAL $TEST_BIN >/dev/null 2>&1
+exitcode=$?
+if [ $exitcode -eq 0 ]; then
+ echo "Test PASSED"
+else
+ echo "Test FAILED"
+ nerrors="`expr $nerrors + 1`"
+fi
+#
+#
+if test $nerrors -eq 0 ; then
+ echo "All tests for abort failure passed."
+ exit 0
+else
+ echo "Tests for abort failure failed with $nerrors errors."
+ exit 1
+fi
diff --git a/test/testcheck_version.sh.in b/test/testcheck_version.sh.in
index a5641f5..0c2c4cd 100644
--- a/test/testcheck_version.sh.in
+++ b/test/testcheck_version.sh.in
@@ -71,7 +71,7 @@ WarnMesg(){
test -n "$H5_HAVE_EMBEDDED_LIBINFO" && cat $h5libsettings
echo "Bye..."
}
-
+
# Print warning message2 of version mismatch.
WarnMesg2(){
@@ -88,13 +88,13 @@ WarnMesg2(){
echo "Headers are $xxh5versmajor.$xxh5versminor.$xxh5versrelease, library is $h5versmajor.$h5versminor.$h5versrelease"
test -n "$H5_HAVE_EMBEDDED_LIBINFO" && cat $h5libsettings
}
-
+
# Run a test and print PASS or *FAIL*. If a test fails then increment
# the `nerrors' global variable and (if $verbose is set) display the
# difference between the actual output and the expected output. The
# expected output generated according to the parameter values and compared
-# against actual output.
+# against actual output.
# The expected and actual output files are removed unless $HDF5_NOCLEANUP
# has a non-zero value.
# $1: the set value of $HDF5_DISABLE_VERSION_CHECK. (unset means not to set
@@ -175,7 +175,7 @@ TESTING() {
) >$actual 2>$actual_err
ret_code=$?
cat $actual_err >> $actual
-
+
if [ $h5haveexitcode = 'yes' -a \( $expect_code -ne $ret_code \) ]; then
echo "*FAILED*"
echo " Expected exit code ($expect_code) differs from actual code ($ret_code)"
@@ -189,7 +189,7 @@ TESTING() {
test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
- # Clean up output file.
+ # Clean up output file.
# Also clean the core file generated by H5check_version's abort.
if test -z "$HDF5_NOCLEANUP"; then
$RM $expect $actual $actual_err
@@ -211,14 +211,14 @@ nerrors=0
verbose=yes # default on
debugmode= # default off
H5_HAVE_EMBEDDED_LIBINFO=`grep '#define H5_HAVE_EMBEDDED_LIBINFO ' ../src/H5pubconf.h`
-h5libsettings=../src/libhdf5.settings
+h5libsettings=../src/libhdf5.settings
PURPOSE
# Figure out library version numbers from the header file.
-h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | cut -f2`
-h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | cut -f2`
-h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | cut -f2`
+h5versmajor=`grep '#define H5_VERS_MAJOR' $srcdir/../src/H5public.h | awk '{print $3}'`
+h5versminor=`grep '#define H5_VERS_MINOR' $srcdir/../src/H5public.h | awk '{print $3}'`
+h5versrelease=`grep '#define H5_VERS_RELEASE' $srcdir/../src/H5public.h | awk '{print $3}'`
DEBUGPRINT $h5versmajor.$h5versminor.$h5versrelease
case "$h5versmajor$h5versminor$h5versrelease" in
[0-9]*) # good. noop.
diff --git a/test/testerror.sh.in b/test/testerror.sh.in
index 734b051..b5ec853 100644
--- a/test/testerror.sh.in
+++ b/test/testerror.sh.in
@@ -11,7 +11,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-# Tests for test_error and err_compat
+# Tests for test_error and err_compat
srcdir=@srcdir@
@@ -22,7 +22,9 @@ CMP='cmp -s'
DIFF='diff -c'
# Skip plugin module to test missing filter
-ENVCMD="env HDF5_PLUGIN_PRELOAD=::"
+# Also reset the VOL connector to only use the native connector, because of the
+# error stack checking. QAK - 2019/03/09
+ENVCMD="env HDF5_PLUGIN_PRELOAD=:: HDF5_VOL_CONNECTOR=native"
nerrors=0
verbose=yes
@@ -60,7 +62,7 @@ TEST() {
TESTING $TEST_ERR
(
# Skip the plugin for testing missing filter.
- $ENVCMD $RUNSERIAL $TEST_ERR_BIN
+ $ENVCMD $RUNSERIAL $TEST_ERR_BIN
) >$actual 2>$actual_err
# Extract file name, line number, version and thread IDs because they may be different
sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
@@ -71,7 +73,7 @@ TEST() {
-e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
$actual_err > $actual_ext
cat $actual_ext >> $actual
-
+
if $CMP $expect1 $actual; then
echo " PASSED"
elif $CMP $expect2 $actual; then
@@ -94,7 +96,7 @@ SKIP() {
TESTING $@
echo " -SKIP-"
}
-
+
##############################################################################
##############################################################################
### T H E T E S T S ###
diff --git a/test/test_filenotclosed.sh.in b/test/testexternal_env.sh.in
index 0b43c5b..3cc140d 100644
--- a/test/test_filenotclosed.sh.in
+++ b/test/testexternal_env.sh.in
@@ -11,8 +11,7 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
-# Test to verify that the assertion/abort failure is fixed when the application
-# does not close the file. (See HDFFV-10160)
+# Test for external file with environment variable: HDF5_EXTFILE_PREFIX
srcdir=@srcdir@
@@ -20,22 +19,24 @@ nerrors=0
##############################################################################
##############################################################################
-### T H E T E S T ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
-echo "Testing file not closed assertion/abort failure"
-TEST_NAME=filenotclosed # The test name
-TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+# test for external file with HDF5_EXTFILE_PREFIX
+echo "Testing external file with HDF5_EXTFILE_PREFIX"
+TEST_NAME=external_env # The test name
+TEST_BIN=`pwd`/$TEST_NAME # The path of the test binary
+ENVCMD="env HDF5_EXTFILE_PREFIX=\${ORIGIN}" # The environment variable & value
#
# Run the test
-#$RUNSERIAL $TEST_BIN >/dev/null 2>&1
-$RUNSERIAL $TEST_BIN 2>&1
+# echo "$ENVCMD $RUNSERIAL $TEST_BIN"
+$ENVCMD $RUNSERIAL $TEST_BIN
exitcode=$?
if [ $exitcode -eq 0 ]; then
- echo "Test PASSED"
-else
+ echo "Test prefix for HDF5_EXTFILE_PREFIX PASSED"
+ else
nerrors="`expr $nerrors + 1`"
- echo "***Error encountered***"
+ echo "***Error encountered for HDF5_EXTFILE_PREFIX test***"
fi
exit $nerrors
diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1
index d471e13..fc99f77 100644
--- a/test/testfiles/err_compat_1
+++ b/test/testfiles/err_compat_1
@@ -1,5 +1,5 @@
Testing error API H5Eset/get_auto Testing error API based on data I/O All error API tests passed.
- This program tests the Error API compatible with HDF5 version (number). There're supposed to be some error messages
+ This program tests the Error API compatible with HDF5 version (number). There are supposed to be some error messages
********* Print error stack in HDF5 default way *********
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in main(): Error test failed
@@ -12,18 +12,12 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Dcreate2(): not a location ID
+ #000: (file name) line (number) in H5Dcreate2(): invalid location identifier
major: Invalid arguments to routine
minor: Inappropriate type
- #001: (file name) line (number) in H5G_loc(): invalid object ID
- major: Invalid arguments to routine
- minor: Bad value
********* Print error stack in customized way *********
- error #000: (file name) in H5G_loc(): line (number)
- major: Invalid arguments to routine
- minor: Bad value
- error #001: (file name) in H5Dcreate2(): line (number)
+ error #000: (file name) in H5Dcreate2(): line (number)
major: Invalid arguments to routine
minor: Inappropriate type
@@ -33,19 +27,13 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
minor: Can't get value
********* Print error stack in customized way *********
- error #000: (file name) in H5G_loc(): line (number)
- major: Invalid arguments to routine
- minor: Bad value
- error #001: (file name) in H5Dcreate2(): line (number)
+ error #000: (file name) in H5Dcreate2(): line (number)
major: Invalid arguments to routine
minor: Inappropriate type
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Dcreate2(): not a location ID
+ #000: (file name) line (number) in H5Dcreate2(): invalid location identifier
major: Invalid arguments to routine
minor: Inappropriate type
- #001: (file name) line (number) in H5G_loc(): invalid object ID
- major: Invalid arguments to routine
- minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in main(): Error test failed
@@ -54,6 +42,6 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#001: (file name) line (number) in test_error2(): H5Dwrite shouldn't succeed
major: Error API
minor: Write failed
- #002: (file name) line (number) in H5Dwrite(): not a dataset
+ #002: (file name) line (number) in H5Dwrite(): dset_id is not a dataset ID
major: Invalid arguments to routine
minor: Inappropriate type
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_1 b/test/testfiles/error_test_1
index 0acd288..f0e4a62 100644
--- a/test/testfiles/error_test_1
+++ b/test/testfiles/error_test_1
@@ -21,7 +21,7 @@ Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs):
Testing error API based on data I/O
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #000: (file name) line (number) in H5Dwrite(): not a dataset
+ #000: (file name) line (number) in H5Dwrite(): dset_id is not a dataset ID
major: Invalid arguments to routine
minor: Inappropriate type
Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs):
@@ -32,7 +32,7 @@ Error Test-DIAG: Error detected in Error Program (1.0) thread (IDs):
major: Error in IO
minor: Error in H5Dwrite
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
- #002: (file name) line (number) in H5Dwrite(): not a dataset
+ #002: (file name) line (number) in H5Dwrite(): dset_id is not a dataset ID
major: Invalid arguments to routine
minor: Inappropriate type
@@ -41,19 +41,28 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dread(): can't read data
major: Dataset
minor: Read failed
- #001: (file name) line (number) in H5D__read(): can't read data
+ #001: (file name) line (number) in H5VL_dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #002: (file name) line (number) in H5VL__dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #003: (file name) line (number) in H5VL__native_dataset_read(): can't read data
+ major: Dataset
+ minor: Read failed
+ #004: (file name) line (number) in H5D__read(): can't read data
major: Dataset
minor: Read failed
- #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
+ #005: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
major: Low-level I/O
minor: Read failed
- #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
- major: Data filters
+ #006: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
+ major: Dataset
minor: Filter operation failed
- #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
+ #007: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered
major: Data filters
minor: Read failed
- #005: (file name) line (number) in H5PL_load(): required dynamically loaded plugin filter '305' is not available
+ #008: (file name) line (number) in H5PL_load(): filter plugins disabled
major: Plugin for dynamically loaded library
minor: Unable to load metadata into cache
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/testfiles/plist_files/dapl_32be b/test/testfiles/plist_files/dapl_32be
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_32be
+++ b/test/testfiles/plist_files/dapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_32le b/test/testfiles/plist_files/dapl_32le
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_32le
+++ b/test/testfiles/plist_files/dapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_64be b/test/testfiles/plist_files/dapl_64be
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_64be
+++ b/test/testfiles/plist_files/dapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_64le b/test/testfiles/plist_files/dapl_64le
index 4dedda2..8dcf239 100644
--- a/test/testfiles/plist_files/dapl_64le
+++ b/test/testfiles/plist_files/dapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_32be b/test/testfiles/plist_files/def_dapl_32be
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_32be
+++ b/test/testfiles/plist_files/def_dapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_32le b/test/testfiles/plist_files/def_dapl_32le
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_32le
+++ b/test/testfiles/plist_files/def_dapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_64be b/test/testfiles/plist_files/def_dapl_64be
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_64be
+++ b/test/testfiles/plist_files/def_dapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/def_dapl_64le b/test/testfiles/plist_files/def_dapl_64le
index 3df7289..880eae5 100644
--- a/test/testfiles/plist_files/def_dapl_64le
+++ b/test/testfiles/plist_files/def_dapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/def_dxpl_32be b/test/testfiles/plist_files/def_dxpl_32be
index 3b77a32..b13f456 100644
--- a/test/testfiles/plist_files/def_dxpl_32be
+++ b/test/testfiles/plist_files/def_dxpl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/def_dxpl_32le b/test/testfiles/plist_files/def_dxpl_32le
index 3b77a32..b13f456 100644
--- a/test/testfiles/plist_files/def_dxpl_32le
+++ b/test/testfiles/plist_files/def_dxpl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/def_dxpl_64be b/test/testfiles/plist_files/def_dxpl_64be
index 3b77a32..b13f456 100644
--- a/test/testfiles/plist_files/def_dxpl_64be
+++ b/test/testfiles/plist_files/def_dxpl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/def_dxpl_64le b/test/testfiles/plist_files/def_dxpl_64le
index 3b77a32..b13f456 100644
--- a/test/testfiles/plist_files/def_dxpl_64le
+++ b/test/testfiles/plist_files/def_dxpl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_32be b/test/testfiles/plist_files/def_fapl_32be
index 3b35501..53ef572 100644
--- a/test/testfiles/plist_files/def_fapl_32be
+++ b/test/testfiles/plist_files/def_fapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_32le b/test/testfiles/plist_files/def_fapl_32le
index 3b35501..53ef572 100644
--- a/test/testfiles/plist_files/def_fapl_32le
+++ b/test/testfiles/plist_files/def_fapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_64be b/test/testfiles/plist_files/def_fapl_64be
index 3b35501..53ef572 100644
--- a/test/testfiles/plist_files/def_fapl_64be
+++ b/test/testfiles/plist_files/def_fapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/def_fapl_64le b/test/testfiles/plist_files/def_fapl_64le
index 3b35501..53ef572 100644
--- a/test/testfiles/plist_files/def_fapl_64le
+++ b/test/testfiles/plist_files/def_fapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/dxpl_32be b/test/testfiles/plist_files/dxpl_32be
index 22fbdc8..5ff2ea0 100644
--- a/test/testfiles/plist_files/dxpl_32be
+++ b/test/testfiles/plist_files/dxpl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/dxpl_32le b/test/testfiles/plist_files/dxpl_32le
index 22fbdc8..5ff2ea0 100644
--- a/test/testfiles/plist_files/dxpl_32le
+++ b/test/testfiles/plist_files/dxpl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/dxpl_64be b/test/testfiles/plist_files/dxpl_64be
index 22fbdc8..5ff2ea0 100644
--- a/test/testfiles/plist_files/dxpl_64be
+++ b/test/testfiles/plist_files/dxpl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/dxpl_64le b/test/testfiles/plist_files/dxpl_64le
index 22fbdc8..5ff2ea0 100644
--- a/test/testfiles/plist_files/dxpl_64le
+++ b/test/testfiles/plist_files/dxpl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_32be b/test/testfiles/plist_files/fapl_32be
index 43e5e67..d89a44c 100644
--- a/test/testfiles/plist_files/fapl_32be
+++ b/test/testfiles/plist_files/fapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_32le b/test/testfiles/plist_files/fapl_32le
index 43e5e67..d89a44c 100644
--- a/test/testfiles/plist_files/fapl_32le
+++ b/test/testfiles/plist_files/fapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_64be b/test/testfiles/plist_files/fapl_64be
index 43e5e67..d89a44c 100644
--- a/test/testfiles/plist_files/fapl_64be
+++ b/test/testfiles/plist_files/fapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_64le b/test/testfiles/plist_files/fapl_64le
index 43e5e67..d89a44c 100644
--- a/test/testfiles/plist_files/fapl_64le
+++ b/test/testfiles/plist_files/fapl_64le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_32be b/test/testfiles/plist_files/lapl_32be
index f3e9865..eee238e 100644
--- a/test/testfiles/plist_files/lapl_32be
+++ b/test/testfiles/plist_files/lapl_32be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_32le b/test/testfiles/plist_files/lapl_32le
index f3e9865..eee238e 100644
--- a/test/testfiles/plist_files/lapl_32le
+++ b/test/testfiles/plist_files/lapl_32le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_64be b/test/testfiles/plist_files/lapl_64be
index f3e9865..eee238e 100644
--- a/test/testfiles/plist_files/lapl_64be
+++ b/test/testfiles/plist_files/lapl_64be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_64le b/test/testfiles/plist_files/lapl_64le
index f3e9865..eee238e 100644
--- a/test/testfiles/plist_files/lapl_64le
+++ b/test/testfiles/plist_files/lapl_64le
Binary files differ
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 21f9ea3..3c2a335 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -15,7 +15,7 @@
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
* Tuesday, January 6, 2004
*
- * Purpose: Provides support functions for the testing framework.
+ * Purpose: Provides support functions for the testing framework.
*
*/
@@ -28,24 +28,25 @@
#define MAXTESTDESC 64
typedef struct TestStruct {
- int NumErrors;
- char Description[MAXTESTDESC];
- int SkipFlag;
- char Name[MAXTESTNAME];
- void (*Call)(void);
- void (*Cleanup)(void);
- const void *Parameters;
+ int NumErrors;
+ char Description[MAXTESTDESC];
+ int SkipFlag;
+ char Name[MAXTESTNAME];
+ void (*Call)(void);
+ void (*Cleanup)(void);
+ const void *Parameters;
} TestStruct;
/*
* Variables used by testing framework.
*/
-static int num_errs = 0; /* Total number of errors during testing */
+static int enable_error_stack = 0; /* enable error stack; disable=0 enable=1 */
+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 TestExpress = -1; /* Do TestExpress or not. -1 means not set yet. */
+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 */
static unsigned Index = 0;
@@ -54,7 +55,7 @@ static const char *TestProgName = NULL;
static void (*TestPrivateUsage)(void) = NULL;
static int (*TestPrivateParser)(int ac, char *av[]) = NULL;
-
+
/*
* Setup a test function and add it to the list of tests.
* It must have no parameters and returns void.
@@ -73,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 */
@@ -90,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 */
@@ -102,12 +101,12 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
/* Set up test function */
HDstrcpy(Test[Index].Description, TheDescr);
if(*TheName != '-') {
- HDstrcpy(Test[Index].Name, TheName);
- Test[Index].SkipFlag = 0;
+ HDstrcpy(Test[Index].Name, TheName);
+ Test[Index].SkipFlag = 0;
}
- else { /* skip test by default */
- HDstrcpy(Test[Index].Name, TheName+1);
- Test[Index].SkipFlag = 1;
+ else { /* skip test by default */
+ HDstrcpy(Test[Index].Name, TheName+1);
+ Test[Index].SkipFlag = 1;
}
Test[Index].Call = TheCall;
Test[Index].Cleanup = Cleanup;
@@ -118,7 +117,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
Index++;
}
-
+
/*
* Initialize testing framework
*
@@ -130,8 +129,8 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
* private options. Default to NULL which means none is provided.
*
* Modifications:
- * Albert Cheng 2004/08/17
- * Added the ProgName, private_usage and private_parser arguments.
+ * Albert Cheng 2004/08/17
+ * Added the ProgName, private_usage and private_parser arguments.
*/
void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[]))
{
@@ -140,62 +139,63 @@ void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_p
* half the functions this test calls are private, so automatic error
* reporting wouldn't do much good since it's triggered at the API layer.
*/
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+ if (enable_error_stack == 0)
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/*
* Record the program name and private routines if provided.
*/
TestProgName = ProgName;
- if (NULL != private_usage)
- TestPrivateUsage = private_usage;
- if (NULL != private_parser)
- TestPrivateParser = private_parser;
+ if(NULL != private_usage)
+ TestPrivateUsage = private_usage;
+ if(NULL != private_parser)
+ TestPrivateParser = private_parser;
}
-
+
/*
* Print test usage.
- * First print the common test options, then the extra options if provided.
+ * First print the common test options, then the extra options if provided.
*
* Modification:
- * 2004/08/18 Albert Cheng. Add TestPrivateUsage feature.
+ * 2004/08/18 Albert Cheng. Add TestPrivateUsage feature.
*/
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>" : ""));
- print_func(" [-[e]x[clude] name]+ \n");
- print_func(" [-o[nly] name]+ \n");
- print_func(" [-b[egin] name] \n");
- print_func(" [-s[ummary]] \n");
- print_func(" [-c[leanoff]] \n");
- print_func(" [-h[elp]] \n");
- print_func("\n\n");
- print_func("verbose controls the amount of information displayed\n");
- print_func("exclude to exclude tests by name\n");
- print_func("only to name tests which should be run\n");
- print_func("begin start at the name of the test givin\n");
- print_func("summary prints a summary of test results at the end\n");
- print_func("cleanoff does not delete *.hdf files after execution of tests\n");
- print_func("help print out this information\n");
- if (TestPrivateUsage){
- print_func("\nExtra options\n");
- TestPrivateUsage();
- }
- print_func("\n\n");
- print_func("This program currently tests the following: \n\n");
- print_func("%16s %s\n", "Name", "Description");
- print_func("%16s %s\n", "----", "-----------");
-
- for (i = 0; i < Index; i++)
- print_func("%16s %s\n", Test[i].Name, Test[i].Description);
-
- print_func("\n\n");
+ unsigned i;
+
+ print_func("Usage: %s [-v[erbose] (l[ow]|m[edium]|h[igh]|0-9)] %s\n",
+ TestProgName, (TestPrivateUsage ? "<extra options>" : ""));
+ print_func(" [-[e]x[clude] name]+ \n");
+ print_func(" [-o[nly] name]+ \n");
+ print_func(" [-b[egin] name] \n");
+ print_func(" [-s[ummary]] \n");
+ print_func(" [-c[leanoff]] \n");
+ print_func(" [-h[elp]] \n");
+ print_func("\n\n");
+ print_func("verbose controls the amount of information displayed\n");
+ print_func("exclude to exclude tests by name\n");
+ print_func("only to name tests which should be run\n");
+ print_func("begin start at the name of the test givin\n");
+ print_func("summary prints a summary of test results at the end\n");
+ print_func("cleanoff does not delete *.hdf files after execution of tests\n");
+ print_func("help print out this information\n");
+ if (TestPrivateUsage){
+ print_func("\nExtra options\n");
+ TestPrivateUsage();
+ }
+ print_func("\n\n");
+ print_func("This program currently tests the following: \n\n");
+ print_func("%16s %s\n", "Name", "Description");
+ print_func("%16s %s\n", "----", "-----------");
+
+ for (i = 0; i < Index; i++)
+ print_func("%16s %s\n", Test[i].Name, Test[i].Description);
+
+ print_func("\n\n");
}
-
+
/*
* Print test info.
*/
@@ -209,7 +209,7 @@ void TestInfo(const char *ProgName)
print_func("Linked with hdf5 version %u.%u release %u\n", major, minor, release);
}
-
+
/*
* Parse command line information.
* argc, argv: the usual command line argument count and strings
@@ -218,7 +218,7 @@ void TestInfo(const char *ProgName)
* exit EXIT_FAILURE if error is encountered.
*
* Modification:
- * 2004/08/18 Albert Cheng. Add extra_parse feature.
+ * 2004/08/18 Albert Cheng. Add extra_parse feature.
*/
void TestParseCmdLine(int argc, char *argv[])
{
@@ -226,80 +226,84 @@ 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);
- }
- }
- 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, "-begin") == 0) ||
- (HDstrcmp(*argv, "-b") == 0))) {
- if (argc > 0){
- --argc; ++argv;
- SetTest(*argv, BEGINTEST);
- }else{
- TestUsage();
- exit(EXIT_FAILURE);
- }
- }
- else if (((HDstrcmp(*argv, "-only") == 0) ||
- (HDstrcmp(*argv, "-o") == 0))) {
- if(argc > 0) {
- unsigned Loop;
-
- --argc; ++argv;
-
- /* Skip all tests, then activate only one. */
+ 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();
+ HDexit(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;
+
+ --argc; ++argv;
+
+ /* 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);
- }
- }
- else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
+ SetTest(*argv, ONLYTEST);
+ }
+ else{
+ TestUsage();
+ HDexit(EXIT_FAILURE);
+ }
+ }
+ else if ((HDstrcmp(*argv, "-summary") == 0) || (HDstrcmp(*argv, "-s") == 0))
Summary = 1;
- else if ((HDstrcmp(*argv, "-help") == 0) || (HDstrcmp(*argv, "-h") == 0)) {
+ 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);
+ 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, "-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);
}
}
-
+
/*
* Perform Tests.
*/
@@ -314,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));
@@ -332,7 +336,7 @@ void PerformTests(void)
print_func("All tests were successful. \n\n");
}
-
+
/*
* Display test summary.
*/
@@ -354,7 +358,7 @@ void TestSummary(void)
print_func("\n\n");
}
-
+
/*
* Cleanup files from testing
*/
@@ -370,7 +374,7 @@ void TestCleanup(void)
Test[Loop].Cleanup();
}
-
+
/*
* Shutdown the test infrastructure
*/
@@ -380,7 +384,7 @@ void TestShutdown(void)
HDfree(Test);
}
-
+
/*
* Retrieve the verbosity level for the testing framework
*/
@@ -436,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);
@@ -504,16 +508,16 @@ 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));
}
-
+
/*
* Retrieve the number of testing errors for the testing framework
*/
@@ -522,7 +526,7 @@ H5_ATTR_PURE int GetTestNumErrs(void)
return(num_errs);
}
-
+
/*
* Increment the number of testing errors
*/
@@ -531,7 +535,7 @@ void IncTestNumErrs(void)
num_errs++;
}
-
+
/*
* Retrieve the current Test Parameters pointer.
*/
@@ -540,7 +544,7 @@ H5_ATTR_PURE const void *GetTestParameters(void)
return(Test_parameters);
}
-
+
/*
* This routine is designed to provide equivalent functionality to 'printf'
* and also increment the error count for the testing framework.
@@ -555,15 +559,15 @@ 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;
}
-
+
/*
* Set (control) which test will be tested.
* SKIPTEST: skip this test
@@ -576,41 +580,41 @@ void SetTest(const char *testname, int action)
unsigned Loop;
switch (action){
- case SKIPTEST:
- for (Loop = 0; Loop < Index; Loop++)
- 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;
- }
- }
- 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;
- }
- }
- break;
- default:
- /* error */
- printf("*** ERROR: Unknown action (%d) for SetTest\n", action);
- break;
+ case SKIPTEST:
+ for (Loop = 0; Loop < Index; Loop++)
+ 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;
+ }
+ }
+ 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;
+ }
+ }
+ break;
+ default:
+ /* error */
+ HDprintf("*** ERROR: Unknown action (%d) for SetTest\n", action);
+ break;
}
}
-
+
/*
* Enable alarm on test execution, configurable by environment variable
*/
diff --git a/test/testhdf5.c b/test/testhdf5.c
index 713cccf..72acf6c 100644
--- a/test/testhdf5.c
+++ b/test/testhdf5.c
@@ -57,7 +57,8 @@ main(int argc, char *argv[])
AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL);
AddTest("select", test_select, cleanup_select, "Selections", NULL);
AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
- AddTest("reference", test_reference, cleanup_reference, "References", NULL);
+ AddTest("ref_deprec", test_reference_deprec, cleanup_reference_deprec, "Deprecated References", NULL);
+ AddTest("ref", test_reference, cleanup_reference, "References", NULL);
AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL);
AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL);
AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL);
@@ -90,8 +91,8 @@ main(int argc, char *argv[])
/* Exit failure if errors encountered; else exit success. */
/* No need to print anything since PerformTests() already does. */
if (GetTestNumErrs() > 0)
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
else
- exit(EXIT_SUCCESS);
+ HDexit(EXIT_SUCCESS);
} /* end main() */
diff --git a/test/testhdf5.h b/test/testhdf5.h
index 2cbe6c6..6b13cae 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -18,142 +18,152 @@
#ifndef TESTHDF5_H
#define TESTHDF5_H
-/*
- * Include required headers. This file tests internal library functions,
- * so we include the private headers here.
- */
-#include "H5private.h"
-#include "H5Eprivate.h"
-
/* Include generic testing header also */
#include "h5test.h"
/* Use %ld to print the value because long should cover most cases. */
/* Used to make certain a return value _is_not_ a value */
-#define CHECK(ret, val, where) do { \
- if (VERBOSE_HI) print_func(" Call to routine: %15s at line %4d " \
- "in %s returned %ld \n", \
- where, (int)__LINE__, __FILE__, \
- (long)(ret)); \
- if ((ret) == (val)) { \
- TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
- "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+#define CHECK(ret, val, where) do { \
+ if (VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d " \
+ "in %s returned %ld \n", \
+ where, (int)__LINE__, __FILE__, \
+ (long)(ret)); \
+ } \
+ if ((ret) == (val)) { \
+ TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
+ "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
} while(0)
-#define CHECK_I(ret,where) { \
- if (VERBOSE_HI) { \
- print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
- (where), (int)__LINE__, __FILE__, (long)(ret)); \
- } \
- if ((ret)<0) { \
- TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \
- (where), (long)(ret), (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+#define CHECK_I(ret,where) { \
+ if (VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
+ (where), (int)__LINE__, __FILE__, (long)(ret)); \
+ } \
+ if ((ret)<0) { \
+ TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \
+ (where), (long)(ret), (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
+}
+
+/* Check that a pointer is valid (i.e.: not NULL) */
+#define CHECK_PTR(ret,where) { \
+ if (VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
+ (where), (int)__LINE__, __FILE__, (ret)); \
+ } \
+ if (!(ret)) { \
+ TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \
+ (where), (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
}
-#define CHECK_PTR(ret,where) { \
- if (VERBOSE_HI) { \
- print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
- (where), (int)__LINE__, __FILE__, (ret)); \
- } \
- if (!(ret)) { \
- TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \
- (where), (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+/* Check that a pointer is NULL */
+#define CHECK_PTR_NULL(ret,where) { \
+ if (VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
+ (where), (int)__LINE__, __FILE__, (ret)); \
+ } \
+ if (ret) { \
+ TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \
+ (where), (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
}
-#define CHECK_PTR_NULL(ret,where) { \
- if (VERBOSE_HI) { \
- print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
- (where), (int)__LINE__, __FILE__, (ret)); \
- } \
- if (ret) { \
- TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \
- (where), (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+/* Check that two pointers are equal */
+#define CHECK_PTR_EQ(ret, val, where) { \
+ if (VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
+ (where), (int)__LINE__, __FILE__, (const void *)(ret)); \
+ } \
+ if (ret != val) { \
+ TestErrPrintf ("*** UNEXPECTED RETURN from %s: returned value of %p is not equal to %p line %4d in %s\n", \
+ (where), (const void *)(ret), (const void *)(val), (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
}
/* Used to make certain a return value _is_ a value */
-#define VERIFY(_x, _val, where) do { \
- long __x = (long)_x, __val = (long)_val; \
- if(VERBOSE_HI) { \
- print_func(" Call to routine: %15s at line %4d in %s had value " \
- "%ld \n", (where), (int)__LINE__, __FILE__, __x); \
- } \
- if((__x) != (__val)) { \
- TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \
- "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+#define VERIFY(_x, _val, where) do { \
+ long __x = (long)_x, __val = (long)_val; \
+ if(VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s had value " \
+ "%ld \n", (where), (int)__LINE__, __FILE__, __x); \
+ } \
+ if((__x) != (__val)) { \
+ TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \
+ "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
} while(0)
/* Used to make certain a (non-'long' type's) return value _is_ a value */
-#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \
- _type __x = (_type)_x, __val = (_type)_val; \
- if(VERBOSE_HI) { \
- print_func(" Call to routine: %15s at line %4d in %s had value " \
- _format " \n", (where), (int)__LINE__, __FILE__, __x); \
- } \
- if((__x) != (__val)) { \
- TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \
- "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+#define VERIFY_TYPE(_x, _val, _type, _format, where) do { \
+ _type __x = (_type)_x, __val = (_type)_val; \
+ if(VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s had value " \
+ _format " \n", (where), (int)__LINE__, __FILE__, __x); \
+ } \
+ if((__x) != (__val)) { \
+ TestErrPrintf("*** UNEXPECTED VALUE from %s should be " _format ", but is " _format " at line %4d " \
+ "in %s\n", (where), __val, __x, (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
} while(0)
/* Used to make certain a string return value _is_ a value */
-#define VERIFY_STR(x, val, where) do { \
- if (VERBOSE_HI) { \
- print_func(" Call to routine: %15s at line %4d in %s had value " \
- "%s \n", (where), (int)__LINE__, __FILE__, x); \
- } \
- if (HDstrcmp(x, val)) { \
- TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \
- "in %s\n", where, val, x, (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+#define VERIFY_STR(x, val, where) do { \
+ if (VERBOSE_HI) { \
+ print_func(" Call to routine: %15s at line %4d in %s had value " \
+ "%s \n", (where), (int)__LINE__, __FILE__, x); \
+ } \
+ if (HDstrcmp(x, val)) { \
+ TestErrPrintf("*** UNEXPECTED VALUE from %s should be %s, but is %s at line %4d " \
+ "in %s\n", where, val, x, (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
} while(0)
/* Used to document process through a test and to check for errors */
-#define RESULT(ret,func) do { \
- if (VERBOSE_MED) { \
- print_func(" Call to routine: %15s at line %4d in %s returned " \
- "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
- } \
- if (VERBOSE_HI) \
- H5Eprint2(H5E_DEFAULT, stdout); \
- if ((ret) == FAIL) { \
- TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
- "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \
- H5Eprint2(H5E_DEFAULT, stdout); \
- } \
+#define RESULT(ret,func) do { \
+ if (VERBOSE_MED) { \
+ print_func(" Call to routine: %15s at line %4d in %s returned " \
+ "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
+ } \
+ if (VERBOSE_HI) \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ if ((ret) == FAIL) { \
+ TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
+ "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \
+ H5Eprint2(H5E_DEFAULT, stdout); \
+ } \
} while(0)
/* Used to document process through a test */
#if defined(H5_HAVE_PARALLEL) && defined(H5_PARALLEL_TEST)
-#define MESSAGE(V,A) { \
- int mpi_rank; \
- \
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \
- if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \
- print_func A ; \
+#define MESSAGE(V,A) { \
+ int mpi_rank; \
+ \
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); \
+ if(mpi_rank == 0 && HDGetTestVerbosity() > (V)) \
+ print_func A ; \
}
#else /* H5_HAVE_PARALLEL */
#define MESSAGE(V,A) {if (HDGetTestVerbosity() > (V)) print_func A;}
#endif /* H5_HAVE_PARALLEL */
/* Used to indicate an error that is complex to check for */
-#define ERROR(where) do { \
- if(VERBOSE_HI) \
- print_func(" Call to routine: %15s at line %4d in %s returned " \
- "invalid result\n", where, (int)__LINE__, __FILE__); \
- TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \
- where, (int)__LINE__, __FILE__); \
+#define ERROR(where) do { \
+ if(VERBOSE_HI) \
+ print_func(" Call to routine: %15s at line %4d in %s returned " \
+ "invalid result\n", where, (int)__LINE__, __FILE__); \
+ TestErrPrintf("*** UNEXPECTED RESULT from %s at line %4d in %s\n", \
+ where, (int)__LINE__, __FILE__); \
} while(0)
/* definitions for command strings */
@@ -167,53 +177,55 @@ 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_reference_deprec(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_reference_deprec(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/testlibinfo.sh.in b/test/testlibinfo.sh.in
index 1dd744b..b2e8a12 100644
--- a/test/testlibinfo.sh.in
+++ b/test/testlibinfo.sh.in
@@ -47,7 +47,7 @@ SKIP() {
LINEMSG $*
echo " -SKIP-"
}
-
+
# Function definitions
CHECK_LIBINFO(){
LINEMSG $1
@@ -80,9 +80,9 @@ if [ -n $Shared_Lib ]; then
shlib=$(grep dlname ../src/libhdf5.la | sed -e "s/dlname='//" -e "s/'//")
else
h5libdir=../src
-fi
+fi
-h5libsettings=../src/libhdf5.settings
+h5libsettings=../src/libhdf5.settings
# Part 1:
# Verify the HDF5 library does contains an exact copy of the content of the
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
new file mode 100644
index 0000000..e9a27da
--- /dev/null
+++ b/test/testvds_env.sh.in
@@ -0,0 +1,44 @@
+#! /bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+# Test for external file with environment variable: HDF5_VDS_PREFIX
+
+srcdir=@srcdir@
+
+nerrors=0
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+# test for VDS with HDF5_VDS_PREFIX
+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_vds_env" # Set the environment variable & value
+UNENVCMD="unset HDF5_VDS_PREFIX" # Unset the environment variable & value
+#
+# Run the test
+# echo "$ENVCMD $RUNSERIAL $TEST_BIN"
+$ENVCMD $RUNSERIAL $TEST_BIN
+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***"
+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 027ad62..d6047dc 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -13,26 +13,42 @@
/***********************************************************
*
-* Test program: tfile
+* Test program: tfile
*
* Test the low-level file I/O features.
*
*************************************************************/
-#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5Bprivate.h"
+#include "H5Iprivate.h"
#include "H5Pprivate.h"
+#include "H5VLprivate.h" /* Virtual Object Layer */
+#include "H5private.h"
/*
* This file needs to access private information from the H5F package.
* This file also needs to access the file testing code.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
+#include "H5Fpkg.h" /* File access */
+
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#include "H5Dpkg.h" /* Dataset access */
+
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+#include "H5Spkg.h" /* Dataspace */
+
+#define H5T_FRIEND /*suppress error about including H5Tpkg */
+#include "H5Tpkg.h" /* Datatype */
+
+#define H5A_FRIEND /*suppress error about including H5Apkg */
+#include "H5Apkg.h" /* Attributes */
+
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#include "H5Opkg.h" /* Object headers */
#define BAD_USERBLOCK_SIZE1 (hsize_t)1
#define BAD_USERBLOCK_SIZE2 (hsize_t)2
@@ -43,46 +59,46 @@
#define BAD_USERBLOCK_SIZE7 (hsize_t)6144
#define F1_USERBLOCK_SIZE (hsize_t)0
-#define F1_OFFSET_SIZE sizeof(haddr_t)
-#define F1_LENGTH_SIZE sizeof(hsize_t)
-#define F1_SYM_LEAF_K 4
-#define F1_SYM_INTERN_K 16
-#define FILE1 "tfile1.h5"
-#define SFILE1 "sys_file1"
+#define F1_OFFSET_SIZE sizeof(haddr_t)
+#define F1_LENGTH_SIZE sizeof(hsize_t)
+#define F1_SYM_LEAF_K 4
+#define F1_SYM_INTERN_K 16
+#define FILE1 "tfile1.h5"
+#define SFILE1 "sys_file1"
#define REOPEN_FILE "tfile_reopen.h5"
#define REOPEN_DSET "dset"
#define F2_USERBLOCK_SIZE (hsize_t)512
-#define F2_OFFSET_SIZE 8
-#define F2_LENGTH_SIZE 8
-#define F2_SYM_LEAF_K 8
-#define F2_SYM_INTERN_K 32
+#define F2_OFFSET_SIZE 8
+#define F2_LENGTH_SIZE 8
+#define F2_SYM_LEAF_K 8
+#define F2_SYM_INTERN_K 32
#define F2_RANK 2
#define F2_DIM0 4
#define F2_DIM1 6
#define F2_DSET "dset"
-#define FILE2 "tfile2.h5"
+#define FILE2 "tfile2.h5"
#define F3_USERBLOCK_SIZE (hsize_t)0
-#define F3_OFFSET_SIZE F2_OFFSET_SIZE
-#define F3_LENGTH_SIZE F2_LENGTH_SIZE
-#define F3_SYM_LEAF_K F2_SYM_LEAF_K
-#define F3_SYM_INTERN_K F2_SYM_INTERN_K
-#define FILE3 "tfile3.h5"
+#define F3_OFFSET_SIZE F2_OFFSET_SIZE
+#define F3_LENGTH_SIZE F2_LENGTH_SIZE
+#define F3_SYM_LEAF_K F2_SYM_LEAF_K
+#define F3_SYM_INTERN_K F2_SYM_INTERN_K
+#define FILE3 "tfile3.h5"
#define GRP_NAME "/group"
#define DSET_NAME "dataset"
#define ATTR_NAME "attr"
#define TYPE_NAME "type"
-#define FILE4 "tfile4.h5"
+#define FILE4 "tfile4.h5"
#define OBJ_ID_COUNT_0 0
#define OBJ_ID_COUNT_1 1
#define OBJ_ID_COUNT_2 2
#define OBJ_ID_COUNT_3 3
#define OBJ_ID_COUNT_4 4
-#define OBJ_ID_COUNT_6 6
+#define OBJ_ID_COUNT_6 6
#define OBJ_ID_COUNT_8 8
#define GROUP1 "Group1"
@@ -112,22 +128,25 @@
#define FSP_SIZE1G 1024*1024*1024 /* File space page size */
/* Declaration for test_libver_macros2() */
-#define FILE6 "tfile6.h5" /* Test file */
+#define FILE6 "tfile6.h5" /* Test file */
/* Declaration for test_get_obj_ids() */
-#define FILE7 "tfile7.h5" /* Test file */
-#define NGROUPS 2
-#define NDSETS 4
+#define FILE7 "tfile7.h5" /* Test file */
+#define NGROUPS 2
+#define NDSETS 4
+
+/* Declaration for test_incr_filesize() */
+#define FILE8 "tfile8.h5" /* Test file */
/* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */
-const char *OLD_FILENAME[] = {
- "filespace_1_6.h5", /* 1.6 HDF5 file */
- "filespace_1_8.h5" /* 1.8 HDF5 file */
+const char *OLD_FILENAME[] = {
+ "filespace_1_6.h5", /* 1.6 HDF5 file */
+ "filespace_1_8.h5" /* 1.8 HDF5 file */
};
/* Files created in 1.10.0 release --used in test_filespace_1.10.0_compatible() */
/* These files are copied from release 1.10.0 tools/h5format_convert/testfiles */
-const char *OLD_1_10_0_FILENAME[] = {
+const char *OLD_1_10_0_FILENAME[] = {
"h5fc_ext1_i.h5", /* 0 */
"h5fc_ext1_f.h5", /* 1 */
"h5fc_ext2_if.h5", /* 2 */
@@ -152,6 +171,32 @@ const char *FILESPACE_NAME[] = {
};
+/* Declarations for test_libver_bounds_copy(): */
+/* SRC_FILE: source file created under 1.8 branch with latest format */
+/* DST_FILE: destination file for copying the dataset in SRC_FILE */
+/* DSET_DS1: the dataset created in SRC_FILE to be copied to DST_FILE */
+#define SRC_FILE "fill18.h5"
+#define DST_FILE "fill18_copy.h5"
+#define DSET_DS1 "DS1"
+
+/* Local test function declarations for version bounds */
+static void test_libver_bounds_low_high(void);
+static void test_libver_bounds_super(hid_t fapl);
+static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm);
+static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm);
+static void test_libver_bounds_obj(hid_t fapl);
+static void test_libver_bounds_dataset(hid_t fapl);
+static void test_libver_bounds_dataspace(hid_t fapl);
+static void test_libver_bounds_datatype(hid_t fapl);
+static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid);
+static void test_libver_bounds_attributes(hid_t fapl);
+
+#define DSET_NULL "DSET_NULL"
+#define DSET "DSET"
+#define DSETA "DSETA"
+#define DSETB "DSETB"
+#define DSETC "DSETC"
+
static void
create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *);
static void
@@ -172,14 +217,14 @@ static void test_rw_noupdate(void);
static void
test_file_create(void)
{
- hid_t fid1, fid2, fid3; /* HDF5 File IDs */
- hid_t tmpl1, tmpl2; /*file creation templates */
- hsize_t ublock; /*sizeof userblock */
- size_t parm; /*file-creation parameters */
- size_t parm2; /*file-creation parameters */
- unsigned iparm;
- unsigned iparm2;
- herr_t ret; /*generic return value */
+ hid_t fid1, fid2, fid3; /* HDF5 File IDs */
+ hid_t tmpl1, tmpl2; /*file creation templates */
+ hsize_t ublock; /*sizeof userblock */
+ size_t parm; /*file-creation parameters */
+ size_t parm2; /*file-creation parameters */
+ unsigned iparm;
+ unsigned iparm2;
+ herr_t ret; /*generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Creation I/O\n"));
@@ -431,7 +476,7 @@ test_file_create(void)
/* Close third file */
ret = H5Fclose(fid3);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_file_create() */
+} /* test_file_create() */
/****************************************************************
**
@@ -441,17 +486,17 @@ test_file_create(void)
static void
test_file_open(void)
{
- hid_t fid1, fid2; /*HDF5 File IDs */
+ hid_t fid1, fid2; /*HDF5 File IDs */
hid_t did; /*dataset ID */
hid_t fapl_id; /*file access property list ID */
- hid_t tmpl1; /*file creation templates */
- hsize_t ublock; /*sizeof user block */
- size_t parm; /*file-creation parameters */
- size_t parm2; /*file-creation parameters */
- unsigned iparm;
- unsigned iparm2;
- unsigned intent;
- herr_t ret; /*generic return value */
+ hid_t tmpl1; /*file creation templates */
+ hsize_t ublock; /*sizeof user block */
+ size_t parm; /*file-creation parameters */
+ size_t parm2; /*file-creation parameters */
+ unsigned iparm;
+ unsigned iparm2;
+ unsigned intent;
+ herr_t ret; /*generic return value */
/*
* Test single file open
@@ -615,7 +660,7 @@ test_file_close(void)
{
hid_t fid1, fid2;
hid_t fapl_id, access_id;
- hid_t dataset_id, group_id1, group_id2, group_id3;
+ hid_t dataset_id, group_id1, group_id2, group_id3;
H5F_close_degree_t fc_degree;
herr_t ret;
@@ -805,7 +850,7 @@ test_file_close(void)
/* Create more new files and test object count and ID list functions */
test_obj_count_and_id(fid1, fid2, dataset_id, group_id1,
- group_id2, group_id3);
+ group_id2, group_id3);
/* Close first open */
ret = H5Fclose(fid1);
@@ -861,22 +906,22 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Pget_fclose_degree");
switch(fc_degree) {
- case H5F_CLOSE_STRONG:
- /* Close first open */
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
- /* Close second open */
- ret = H5Fclose(fid2);
- CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_SEMI:
+ case H5F_CLOSE_STRONG:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
- ret = H5Dclose(dataset_id);
+ /* Close second open */
+ ret = H5Fclose(fid2);
+ CHECK(ret, FAIL, "H5Fclose");
+ break;
+ case H5F_CLOSE_SEMI:
+ /* Close first open */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Dclose(dataset_id);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Gclose(group_id1);
- CHECK(ret, FAIL, "H5Gclose");
+ CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id2);
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
@@ -884,8 +929,8 @@ test_file_close(void)
/* Close second open */
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- break;
- case H5F_CLOSE_WEAK:
+ break;
+ case H5F_CLOSE_WEAK:
/* Close first open */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
@@ -900,7 +945,7 @@ test_file_close(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
- break;
+ break;
case H5F_CLOSE_DEFAULT:
default:
CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree");
@@ -922,10 +967,10 @@ 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;
+ ssize_t oid_count;
+ herr_t ret;
/* Check reference counts of file IDs and opened object IDs.
* The verification is hard-coded. If in any case, this testing
@@ -1027,7 +1072,7 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
/****************************************************************
**
** test_get_obj_ids(): Test the bug and the fix for Jira 8528.
-** H5Fget_obj_ids overfilled the list of
+** H5Fget_obj_ids overfilled the list of
** object IDs by one. This is an enhancement
** for test_obj_count_and_id().
**
@@ -1054,14 +1099,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");
}
@@ -1072,16 +1117,16 @@ test_get_obj_ids(void)
VERIFY(oid_count, (NGROUPS + NDSETS + 1), "H5Fget_obj_count");
oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t));
- CHECK(oid_list, NULL, "HDcalloc");
+ CHECK_PTR(oid_list, "HDcalloc");
- /* 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
+ /* 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) */
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");
- /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according
+ /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according
* to the library design */
for(i = 0; i< ret_count; i++) {
if(fid != oid_list[i]) {
@@ -1096,7 +1141,7 @@ test_get_obj_ids(void)
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, NGROUPS + 2, "H5Fget_obj_count");
- /* Get the IDs of the left opend objects */
+ /* Get the IDs of the left opend objects */
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");
@@ -1108,20 +1153,20 @@ test_get_obj_ids(void)
CHECK(ret, FAIL, "H5Oclose");
}
}
-
+
H5Sclose(filespace);
H5Fclose(fid);
HDfree(oid_list);
- /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works
- * when the file is closed first */
+ /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works
+ * when the file is closed first */
fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
/* 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");
}
@@ -1135,7 +1180,7 @@ test_get_obj_ids(void)
VERIFY(oid_count, NDSETS, "H5Fget_obj_count");
oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t));
- CHECK(oid_list, NULL, "HDcalloc");
+ CHECK_PTR(oid_list, "HDcalloc");
/* Get the list of all opened objects */
ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list);
@@ -1158,7 +1203,7 @@ static void
test_get_file_id(void)
{
hid_t fid, fid2, fid3;
- hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
+ hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
hid_t plist;
hsize_t dims[F2_RANK];
unsigned intent;
@@ -1316,7 +1361,7 @@ check_file_id(hid_t fid, hid_t object_id)
****************************************************************/
static void
test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
- hid_t gid2, hid_t gid3)
+ hid_t gid2, hid_t gid3)
{
hid_t fid3, fid4;
ssize_t oid_count, ret_count;
@@ -1357,7 +1402,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL);
CHECK(oid_count, FAIL, "H5Fget_obj_count");
VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count");
-
+
if(oid_count > 0) {
hid_t *oid_list;
@@ -1365,8 +1410,8 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
if(oid_list != NULL) {
int i;
- ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list);
- CHECK(ret_count, FAIL, "H5Fget_obj_ids");
+ ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list);
+ CHECK(ret_count, FAIL, "H5Fget_obj_ids");
for(i = 0; i < oid_count; i++) {
H5I_type_t id_type;
@@ -1389,18 +1434,22 @@ 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:
case H5I_DATASPACE:
case H5I_ATTR:
- case H5I_REFERENCE:
case H5I_VFL:
+ case H5I_VOL:
case H5I_GENPROP_CLS:
case H5I_GENPROP_LST:
case H5I_ERROR_CLASS:
case H5I_ERROR_MSG:
case H5I_ERROR_STACK:
+ case H5I_SPACE_SEL_ITER:
case H5I_NTYPES:
default:
ERROR("H5Fget_obj_ids");
@@ -1480,11 +1529,11 @@ test_file_perm(void)
/****************************************************************
**
** test_file_perm2(): low-level file test routine.
-** This test verifies that no object can be created in a
+** This test verifies that no object can be created in a
** file that is opened for read-only.
**
*****************************************************************/
-static void
+static void
test_file_perm2(void)
{
hid_t file; /* File opened with read-write permission */
@@ -1494,7 +1543,7 @@ test_file_perm2(void)
hid_t dset; /* Dataset ID */
hid_t type; /* Datatype ID */
hid_t attr; /* Attribute ID */
- herr_t ret;
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Permissions again\n"));
@@ -1551,72 +1600,244 @@ test_file_perm2(void)
} /* end test_file_perm2() */
-
/****************************************************************
**
-** test_file_ishdf5(): low-level file test routine.
-** This test checks whether the H5Fis_hdf5() routine is working
-** correctly in variuous situations.
+** test_file_is_accessible(): low-level file test routine.
+** Clone of test_file_ishdf5 but uses the newer VOL-enabled
+** H5Fis_accessible() API call.
**
*****************************************************************/
+#define FILE_IS_ACCESSIBLE "tfile_is_accessible"
static void
-test_file_ishdf5(void)
+test_file_is_accessible(const char *env_h5_drvr)
{
- hid_t file; /* File opened with read-write permission */
- hid_t fcpl; /* File creation property list */
- int fd; /* File Descriptor */
- ssize_t nbytes; /* Number of bytes written */
- unsigned u; /* Local index variable */
- unsigned char buf[1024]; /* Buffer of data to write */
- htri_t status; /* Whether a file is an HDF5 file */
- herr_t ret;
+ hid_t fid = H5I_INVALID_HID; /* File opened with read-write permission */
+ hid_t fcpl_id = H5I_INVALID_HID; /* File creation property list */
+ hid_t fapl_id = H5I_INVALID_HID; /* File access property list */
+ int fd; /* POSIX file descriptor */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ char sb_filename[FILENAME_LEN]; /* Name of file w/ superblock */
+ ssize_t nbytes; /* Number of bytes written */
+ unsigned u; /* Local index variable */
+ unsigned char buf[1024]; /* Buffer of data to write */
+ htri_t is_hdf5; /* Whether a file is an HDF5 file */
+ int posix_ret; /* Return value from POSIX calls */
+ herr_t ret; /* Return value from HDF5 calls */
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
+ /* Get FAPL */
+ fapl_id = h5_fileaccess();
+ CHECK(fapl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Fix up filenames
+ * For VFDs that create multiple files, we also need the name
+ * of the file with the superblock. With single-file VFDs, this
+ * will be equal to the one from h5_fixname().
+ */
+ h5_fixname(FILE_IS_ACCESSIBLE, fapl_id, filename, sizeof(filename));
+ h5_fixname_superblock(FILE_IS_ACCESSIBLE, fapl_id, sb_filename, sizeof(filename));
+
+ /****************/
+ /* Normal usage */
+ /****************/
+
/* Create a file */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(file, FAIL, "H5Fcreate");
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Close file */
- ret = H5Fclose(file);
+ ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is an HDF5 file */
- status = H5Fis_hdf5(FILE1);
- VERIFY(status, TRUE, "H5Fis_hdf5");
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+ /*******************************/
+ /* Non-default user block size */
+ /*******************************/
- /* Create a file creation property list with a non-default user block size */
- fcpl = H5Pcreate(H5P_FILE_CREATE);
- CHECK(fcpl, FAIL, "H5Pcreate");
+ /* This test is not currently working for the family VFD.
+ * There are failures when creating files with userblocks.
+ */
+ if(0 != HDstrcmp(env_h5_drvr, "family")) {
+ /* Create a file creation property list with a non-default user block size */
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl_id, H5I_INVALID_HID, "H5Pcreate");
- ret = H5Pset_userblock(fcpl, (hsize_t)2048);
- CHECK(ret, FAIL, "H5Pset_userblock");
+ ret = H5Pset_userblock(fcpl_id, (hsize_t)2048);
+ CHECK(ret, FAIL, "H5Pset_userblock");
- /* Create file with non-default user block */
- file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
- CHECK(file, FAIL, "H5Fcreate");
+ /* Create file with non-default user block */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
- /* Release file-creation property list */
- ret = H5Pclose(fcpl);
+ /* Release file-creation property list */
+ ret = H5Pclose(fcpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+ } /* end if */
+
+ /***********************/
+ /* EMPTY non-HDF5 file */
+ /***********************/
+
+ /* Create non-HDF5 file and check it */
+ fd = HDopen(sb_filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK(fd, (-1), "HDopen");
+
+ /* Close the file */
+ posix_ret = HDclose(fd);
+ CHECK(posix_ret, (-1), "HDclose");
+
+ /* Verify that the file is NOT an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, FALSE, "H5Fis_accessible (empty non-HDF5 file)");
+
+ /***************************/
+ /* Non-empty non-HDF5 file */
+ /***************************/
+
+ /* Create non-HDF5 file and check it */
+ fd = HDopen(sb_filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK(fd, (-1), "HDopen");
+
+ /* Initialize information to write */
+ for (u = 0; u < 1024; u++)
+ buf[u]=(unsigned char)u;
+
+ /* Write some information */
+ nbytes = HDwrite(fd, buf, (size_t)1024);
+ VERIFY(nbytes, 1024, "HDwrite");
+
+ /* Close the file */
+ posix_ret = HDclose(fd);
+ CHECK(posix_ret, (-1), "HDclose");
+
+ /* Verify that the file is not an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, FALSE, "H5Fis_accessible (non-HDF5 file)");
+
+
+ /* Clean up files */
+ h5_delete_test_file(filename, fapl_id);
+
+ /* Close property list */
+ ret = H5Pclose(fapl_id);
CHECK(ret, FAIL, "H5Pclose");
+} /* end test_file_is_accessible() */
+
+
+/****************************************************************
+**
+** test_file_ishdf5(): low-level file test routine.
+** This test checks whether the H5Fis_hdf5() routine is working
+** correctly in variuous situations.
+**
+*****************************************************************/
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+static void
+test_file_ishdf5(const char *env_h5_drvr)
+{
+ hid_t fid = H5I_INVALID_HID; /* File opened with read-write permission */
+ hid_t fcpl_id = H5I_INVALID_HID; /* File creation property list */
+ hid_t fapl_id = H5I_INVALID_HID; /* File access property list */
+ int fd; /* POSIX file descriptor */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ char sb_filename[FILENAME_LEN]; /* Name of file w/ superblock */
+ ssize_t nbytes; /* Number of bytes written */
+ unsigned u; /* Local index variable */
+ unsigned char buf[1024]; /* Buffer of data to write */
+ htri_t is_hdf5; /* Whether a file is an HDF5 file */
+ int posix_ret; /* Return value from POSIX calls */
+ herr_t ret; /* Return value from HDF5 calls */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Detection of HDF5 Files (using deprecated H5Fis_hdf5() call)\n"));
+
+ /* Get FAPL */
+ fapl_id = h5_fileaccess();
+ CHECK(fapl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Fix up filenames
+ * For VFDs that create multiple files, we also need the name
+ * of the file with the superblock. With single-file VFDs, this
+ * will be equal to the one from h5_fixname().
+ */
+ h5_fixname(FILE_IS_ACCESSIBLE, fapl_id, filename, sizeof(filename));
+ h5_fixname_superblock(FILE_IS_ACCESSIBLE, fapl_id, sb_filename, sizeof(filename));
+
+ /****************/
+ /* Normal usage */
+ /****************/
+
+ /* Create a file */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
/* Close file */
- ret = H5Fclose(file);
+ ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is an HDF5 file */
- status = H5Fis_hdf5(FILE1);
- VERIFY(status, TRUE, "H5Fis_hdf5");
+ is_hdf5 = H5Fis_hdf5(sb_filename);
+ VERIFY(is_hdf5, TRUE, "H5Fis_hdf5");
+ /*******************************/
+ /* Non-default user block size */
+ /*******************************/
- /* Create non-HDF5 file and check it */
- fd = HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW);
- CHECK(fd, FAIL, "HDopen");
+ /* This test is not currently working for the family VFD.
+ * There are failures when creating files with userblocks.
+ */
+ if(0 != HDstrcmp(env_h5_drvr, "family")) {
+ /* Create a file creation property list with a non-default user block size */
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ ret = H5Pset_userblock(fcpl_id, (hsize_t)2048);
+ CHECK(ret, FAIL, "H5Pset_userblock");
+
+ /* Create file with non-default user block */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Release file creation property list */
+ ret = H5Pclose(fcpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_hdf5(sb_filename);
+ VERIFY(is_hdf5, TRUE, "H5Fis_hdf5");
+ } /* end if */
+
+ /***************************/
+ /* Non-empty non-HDF5 file */
+ /***************************/
+
+ /* Create non-HDF5 file. Use the calculated superblock
+ * filename to avoid the format strings that will make
+ * open(2) sad.
+ */
+ fd = HDopen(sb_filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK(fd, (-1), "HDopen");
/* Initialize information to write */
- for(u=0; u<1024; u++)
+ for(u = 0; u < 1024; u++)
buf[u]=(unsigned char)u;
/* Write some information */
@@ -1624,14 +1845,119 @@ test_file_ishdf5(void)
VERIFY(nbytes, 1024, "HDwrite");
/* Close the file */
- ret = HDclose(fd);
- CHECK(ret, FAIL, "HDclose");
+ posix_ret = HDclose(fd);
+ CHECK(posix_ret, (-1), "HDclose");
/* Verify that the file is not an HDF5 file */
- status = H5Fis_hdf5(FILE1);
- VERIFY(status, FALSE, "H5Fis_hdf5");
+ is_hdf5 = H5Fis_hdf5(sb_filename);
+ VERIFY(is_hdf5, FALSE, "H5Fis_hdf5");
+
+
+ /* Clean up files */
+ h5_delete_test_file(filename, fapl_id);
+
+ /* Close property list */
+ ret = H5Pclose(fapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
} /* end test_file_ishdf5() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+
+/****************************************************************
+**
+** test_file_delete(): tests H5Fdelete for all VFDs
+**
+*****************************************************************/
+#define FILE_DELETE "test_file_delete"
+#define FILE_DELETE_NOT_HDF5 "test_file_delete_not_hdf5"
+static void
+test_file_delete(hid_t fapl_id)
+{
+ hid_t fid = H5I_INVALID_HID; /* File to be deleted */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ htri_t is_hdf5; /* Whether a file is an HDF5 file */
+ int fd; /* POSIX file descriptor */
+ int iret;
+ herr_t ret;
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Deletion of HDF5 Files\n"));
+
+ /*************/
+ /* HDF5 FILE */
+ /*************/
+
+ /* This is just a placeholder until the native VOL connector supports
+ * H5Fdelete().
+ */
+
+ /* Get fapl-dependent filename */
+ h5_fixname(FILE_DELETE, fapl_id, filename, sizeof(filename));
+
+ /* Create a file */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ VERIFY(ret, SUCCEED, "H5Fclose");
+
+ /* Verify that the file is an HDF5 file */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+
+ /* Attempt to delete the file - should fail */
+ H5E_BEGIN_TRY {
+ ret = H5Fdelete(filename, fapl_id);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Fdelete");
+
+ /* Verify that the file still exists */
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ VERIFY(is_hdf5, TRUE, "H5Fis_accessible");
+
+ /* Actually delete the test file */
+ h5_delete_test_file(FILE_DELETE, fapl_id);
+
+ /*****************/
+ /* NON-HDF5 FILE */
+ /*****************/
+
+ /* Get fapl-dependent filename */
+ h5_fixname(FILE_DELETE_NOT_HDF5, fapl_id, filename, sizeof(filename));
+
+ /* Create a non-HDF5 file */
+ fd = HDopen(filename, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK_I(fd, "HDopen");
+
+ /* Close the file */
+ ret = HDclose(fd);
+ VERIFY(ret, 0, "HDclose");
+
+ /* Verify that the file is not an HDF5 file */
+ /* Note that you can get a FAIL result when h5_fixname()
+ * perturbs the filename as a file with that exact name
+ * may not have been created since we created it with
+ * open(2) and not the library.
+ */
+ H5E_BEGIN_TRY {
+ is_hdf5 = H5Fis_accessible(filename, fapl_id);
+ } H5E_END_TRY;
+ CHECK(is_hdf5, TRUE, "H5Fis_accessible");
+
+ /* Try to delete it (should fail) */
+ H5E_BEGIN_TRY {
+ ret = H5Fdelete(filename, fapl_id);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Fdelete");
+
+ /* Delete the file */
+ iret = HDremove(filename);
+ VERIFY(iret, 0, "HDremove");
+
+} /* end test_file_delete() */
+
/****************************************************************
**
@@ -1772,6 +2098,7 @@ test_file_open_overlap(void)
hid_t sid;
ssize_t nobjs; /* # of open objects */
unsigned intent;
+ unsigned long fileno1, fileno2; /* File number */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1790,6 +2117,19 @@ test_file_open_overlap(void)
CHECK(ret, FAIL, "H5Fget_intent");
VERIFY(intent, H5F_ACC_RDWR, "H5Fget_intent");
+ /* Check the file numbers */
+ fileno1 = 0;
+ ret = H5Fget_fileno(fid1, &fileno1);
+ CHECK(ret, FAIL, "H5Fget_fileno");
+ fileno2 = 0;
+ ret = H5Fget_fileno(fid2, &fileno2);
+ CHECK(ret, FAIL, "H5Fget_fileno");
+ VERIFY(fileno1, fileno2, "H5Fget_fileno");
+
+ /* Check that a file number pointer of NULL is ignored */
+ ret = H5Fget_fileno(fid1, NULL);
+ CHECK(ret, FAIL, "H5Fget_fileno");
+
/* Create a group in file */
gid = H5Gcreate2(fid1, GROUP1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid, FAIL, "H5Gcreate2");
@@ -2086,56 +2426,56 @@ test_file_double_dataset_open(void)
/****************************************************************
**
** test_file_double_file_dataset_open():
-** This test checks multi-opens of files & datasets:
-** It simulates the multi-thread test program from DLS
-** which exposes the file pointer segmentation fault failure.
-** NOTE: The order on when the files and datasets are open/close
-** is important.
+** This test checks multi-opens of files & datasets:
+** It simulates the multi-thread test program from DLS
+** which exposes the file pointer segmentation fault failure.
+** NOTE: The order on when the files and datasets are open/close
+** is important.
**
*****************************************************************/
static void
test_file_double_file_dataset_open(hbool_t new_format)
{
- hid_t fapl = -1; /* File access property list */
- hid_t dcpl = -1; /* Dataset creation property list */
- hid_t fid1 = -1, fid2 = -1; /* File IDs */
- hid_t did1 = -1, did2 = -1; /* Dataset IDs */
- hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */
- hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
- hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */
- hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */
- hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */
- hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */
- hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */
- hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */
- hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */
+ hid_t fapl = -1; /* File access property list */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t fid1 = -1, fid2 = -1; /* File IDs */
+ hid_t did1 = -1, did2 = -1; /* Dataset IDs */
+ hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */
+ hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */
+ hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */
+ hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */
+ hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */
+ hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */
+ hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */
+ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */
+ hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */
hsize_t size; /* File size */
- const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */
- const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */
- char* buffer[5]; /* Output buffer */
- int wbuf[4] = {1, 2, 3, 4}; /* Input data */
- herr_t ret; /* Generic return value */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */
+ const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */
+ char* buffer[5]; /* Output buffer */
+ int wbuf[4] = {1, 2, 3, 4}; /* Input data */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double file and dataset open/close\n"));
/* Setting up test file */
-
- fapl = H5Pcreate(H5P_FILE_ACCESS);
+ fapl = h5_fileaccess();
CHECK(fapl, FAIL, "H5Pcreate");
-
if(new_format) {
ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
} /* end if */
+ h5_fixname(FILE1, fapl, filename, sizeof filename);
/* Create the test file */
- fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(fid1, FAIL, "H5Fcreate");
/* Create a chunked dataset with fixed array indexing */
sid1 = H5Screate_simple(1, dims, max_dims0);
- CHECK(sid1, FAIL, "H5Screate");
+ CHECK(sid1, FAIL, "H5Screate_simple");
tid1 = H5Tcopy(H5T_C_S1);
CHECK(tid1, FAIL, "H5Tcopy");
ret = H5Tset_size(tid1, H5T_VARIABLE);
@@ -2161,7 +2501,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
/* Create a chunked dataset with extensible array indexing */
sid1 = H5Screate_simple(1, dims, max_dims1);
- CHECK(sid1, FAIL, "H5Screate");
+ CHECK(sid1, FAIL, "H5Screate_simple");
tid1 = H5Tcopy(H5T_C_S1);
CHECK(tid1, FAIL, "H5Tcopy");
ret = H5Tset_size(tid1, H5T_VARIABLE);
@@ -2190,7 +2530,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
/* Create a chunked dataset with v2 btree indexing */
sid2 = H5Screate_simple(2, dims2, max_dims2);
- CHECK(sid2, FAIL, "H5Screate");
+ CHECK(sid2, FAIL, "H5Screate_simple");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
@@ -2212,17 +2552,15 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(ret, FAIL, "H5Sclose");
ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Pclose(fapl);
- CHECK(ret, FAIL, "H5Pclose");
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
- /*
- * Scenario 1
+ /*
+ * Scenario 1
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* First file's dataset open */
@@ -2237,7 +2575,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(ret, FAIL, "H5Dwrite");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2273,16 +2611,16 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
- /*
- * Scenario 2
+ /*
+ * Scenario 2
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2303,8 +2641,8 @@ test_file_double_file_dataset_open(hbool_t new_format)
HDmemset(buffer, 0, sizeof(char*) * 5);
ret = H5Dread(did2, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer);
CHECK(ret, FAIL, "H5Dread");
- ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, buffer);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, buffer);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Second file's dataset close */
ret = H5Dclose(did2);
@@ -2318,8 +2656,8 @@ test_file_double_file_dataset_open(hbool_t new_format)
HDmemset(buffer, 0, sizeof(char*) * 5);
ret = H5Dread(did1, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer);
CHECK(ret, FAIL, "H5Dread");
- ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, buffer);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, buffer);
+ CHECK(ret, FAIL, "H5Treclaim");
/* First file's dataset close */
ret = H5Dclose(did1);
@@ -2338,12 +2676,12 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
- /*
+ /*
* Scenario 3
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* First file's dataset open */
@@ -2355,7 +2693,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(size, 0, "H5Dget_storage_size");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDONLY, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2382,13 +2720,13 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
- /*
+ /*
* Scenario 4
* --trigger H5AC_protect: Assertion `f->shared' failed
- * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect
+ * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect
*/
/* First file open */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid1 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid1, FAIL, "H5Fopen");
/* First file's dataset open */
@@ -2407,7 +2745,7 @@ test_file_double_file_dataset_open(hbool_t new_format)
CHECK(ret, FAIL, "H5Dwrite");
/* Second file open */
- fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl);
CHECK(fid2, FAIL, "H5Fopen");
/* Second file's dataset open */
@@ -2438,6 +2776,9 @@ test_file_double_file_dataset_open(hbool_t new_format)
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
+ /* Close FAPL */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
} /* end test_file_double_dataset_open() */
/****************************************************************
@@ -2502,6 +2843,7 @@ test_userblock_file_size(void)
hid_t fcpl2_id;
hsize_t dims[2] = {3, 4};
hsize_t filesize1, filesize2, filesize;
+ unsigned long fileno1, fileno2; /* File number */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -2519,6 +2861,15 @@ test_userblock_file_size(void)
file2_id = H5Fcreate(FILE2, H5F_ACC_TRUNC, fcpl2_id, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fcreate");
+ /* Check the file numbers */
+ fileno1 = 0;
+ ret = H5Fget_fileno(file1_id, &fileno1);
+ CHECK(ret, FAIL, "H5Fget_fileno");
+ fileno2 = 0;
+ ret = H5Fget_fileno(file2_id, &fileno2);
+ CHECK(ret, FAIL, "H5Fget_fileno");
+ CHECK(fileno1, fileno2, "H5Fget_fileno");
+
/* Create groups */
group1_id = H5Gcreate2(file1_id, GROUP1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group1_id, FAIL, "H5Gcreate2");
@@ -2635,8 +2986,8 @@ test_cached_stab_info(void)
CHECK(file_id, FAIL, "H5Fopen");
/* Verify the cached symbol table information */
- ret = H5F_check_cached_stab_test(file_id);
- CHECK(ret, FAIL, "H5F_check_cached_stab_test");
+ ret = H5F__check_cached_stab_test(file_id);
+ CHECK(ret, FAIL, "H5F__check_cached_stab_test");
/* Close file */
ret = H5Fclose(file_id);
@@ -2667,7 +3018,7 @@ cal_chksum(const char *file, uint32_t *chksum)
/* Allocate space for the file data */
file_data = HDmalloc((size_t)sb.st_size);
- CHECK(file_data, NULL, "HDmalloc");
+ CHECK_PTR(file_data, "HDmalloc");
if(file_data) {
/* Read file's data into memory */
@@ -2694,9 +3045,9 @@ cal_chksum(const char *file, uint32_t *chksum)
** This test checks to ensure that opening and closing a file
** with read/write permissions does not write anything to the
** file if the file does not change.
-** Due to the implementation of file locking (status_flags in
-** the superblock is used), this test is changed to use checksum
-** instead of timestamp to verify the file is not changed.
+** Due to the implementation of file locking (status_flags in
+** the superblock is used), this test is changed to use checksum
+** instead of timestamp to verify the file is not changed.
**
** Programmer: Vailin Choi; July 2013
**
@@ -2705,8 +3056,8 @@ static void
test_rw_noupdate(void)
{
herr_t ret; /* Generic return value */
- hid_t fid; /* File ID */
- uint32_t chksum1, chksum2; /* Checksum value */
+ hid_t fid; /* File ID */
+ uint32_t chksum1, chksum2; /* Checksum value */
/* Output message about test being performed */
MESSAGE(5, ("Testing to verify that nothing is written if nothing is changed.\n"));
@@ -3095,8 +3446,8 @@ test_userblock_alignment(void)
** test_userblock_alignment_paged(): low-level file test routine.
** This test checks to ensure that files with both a userblock and
** alignment interact properly:
-** -- alignment via H5Pset_alignment
-** -- alignment via paged aggregation
+** -- alignment via H5Pset_alignment
+** -- alignment via paged aggregation
**
** Programmer: Vailin Choi; March 2013
**
@@ -3112,14 +3463,14 @@ test_userblock_alignment_paged(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing interaction between userblock and alignment (via paged aggregation and H5Pset_alignment)\n"));
- /*
+ /*
* Case 1:
* Userblock size = 0
* Alignment in use = 4096
* Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 4096
* Outcome:
- * Should succeed:
- * userblock is 0 and alignment != 0
+ * Should succeed:
+ * userblock is 0 and alignment != 0
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3150,14 +3501,14 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 2a:
* Userblock size = 1024
* Alignment in use = 512
- * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
+ * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
* H5Pset_alignment() is 3
* Outcome:
- * Should succeed:
+ * Should succeed:
* userblock (1024) is integral mult. of alignment (512)
*/
/* Create file creation property list with user block */
@@ -3186,16 +3537,16 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 2b:
* Userblock size = 1024
* Alignment in use = 3
- * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512
- * (via default file creation property)
+ * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512
+ * (via default file creation property)
* H5Pset_alignment() is 3
* Outcome:
- * Should fail at file creation:
- * userblock (1024) is non-integral mult. of alignment (3)
+ * Should fail at file creation:
+ * userblock (1024) is non-integral mult. of alignment (3)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3222,15 +3573,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 3a:
* Userblock size = 512
* Alignment in use = 512
- * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
+ * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
* H5Pset_alignment() is 3
* Outcome:
- * Should succeed:
- * userblock (512) is equal to alignment (512)
+ * Should succeed:
+ * userblock (512) is equal to alignment (512)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3260,15 +3611,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 3b:
* Userblock size = 512
* Alignment in use = 3
- * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512
+ * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512
* H5Pset_alignment() is 3
* Outcome:
- * Should fail at file creation:
- * userblock (512) is non-integral mult. of alignment (3)
+ * Should fail at file creation:
+ * userblock (512) is non-integral mult. of alignment (3)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3298,15 +3649,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 4a:
* Userblock size = 1024
* Alignment in use = 1023
* Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1023
* H5Pset_alignment() is 16
* Outcome:
- * Should fail at file creation:
- * userblock (1024) is non-integral multiple of alignment (1023)
+ * Should fail at file creation:
+ * userblock (1024) is non-integral multiple of alignment (1023)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3336,15 +3687,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 4b:
* Userblock size = 1024
* Alignment in use = 16
* Strategy is H5F_FILE_SPACE_FSM_AGGR; fsp_size = 1023
* H5Pset_alignment() is 16
* Outcome:
- * Should succeed:
- * userblock (512) is integral multiple of alignment (16)
+ * Should succeed:
+ * userblock (512) is integral multiple of alignment (16)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3374,15 +3725,15 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 5a:
* Userblock size = 512
* Alignment in use = 1024
* Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1024
* H5Pset_alignment() is 16
* Outcome:
- * Should fail at file creation:
- * userblock (512) is less than alignment (1024)
+ * Should fail at file creation:
+ * userblock (512) is less than alignment (1024)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3412,7 +3763,7 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 5b:
* Userblock size = 512
* Alignment in use = 16
@@ -3420,7 +3771,7 @@ test_userblock_alignment_paged(void)
* H5Pset_alignment() is 16
* Outcome:
* Should succed:
- * userblock (512) is integral multiple of alignment (16)
+ * userblock (512) is integral multiple of alignment (16)
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3450,16 +3801,16 @@ test_userblock_alignment_paged(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case 6:
* Userblock size = 512
* Alignment in use = 512
* Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512
* H5Pset_alignment() is 3
- * Reopen the file; H5Pset_alignment() is 1024
+ * Reopen the file; H5Pset_alignment() is 1024
* Outcome:
* Should succed:
- * Userblock (512) is the same as alignment (512);
+ * Userblock (512) is the same as alignment (512);
* The H5Pset_alignment() calls have no effect
*/
/* Create file creation property list with user block */
@@ -3503,19 +3854,19 @@ test_userblock_alignment_paged(void)
/****************************************************************
**
** test_filespace_info():
-** Verify the following public routines retrieve and set file space
-** information correctly:
-** (1) H5Pget/set_file_space_strategy():
-** Retrieve and set file space strategy, persisting free-space,
-** and free-space section threshold as specified
-** (2) H5Pget/set_file_space_page_size():
-** Retrieve and set the page size for paged aggregation
+** Verify the following public routines retrieve and set file space
+** information correctly:
+** (1) H5Pget/set_file_space_strategy():
+** Retrieve and set file space strategy, persisting free-space,
+** and free-space section threshold as specified
+** (2) H5Pget/set_file_space_page_size():
+** Retrieve and set the page size for paged aggregation
**
****************************************************************/
static void
test_filespace_info(const char *env_h5_drvr)
{
- hid_t fid; /* File IDs */
+ hid_t fid; /* File IDs */
hid_t fapl, new_fapl; /* File access property lists */
hid_t fcpl, fcpl1, fcpl2; /* File creation property lists */
H5F_fspace_strategy_t strategy; /* File space strategy */
@@ -3528,7 +3879,7 @@ test_filespace_info(const char *env_h5_drvr)
hsize_t fsp_size; /* File space page size */
char filename[FILENAME_LEN]; /* Filename to use */
hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */
- herr_t ret; /* Return value */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & H5Pget/set_file_space_page_size\n"));
@@ -3546,14 +3897,14 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
CHECK(ret, FAIL, "H5Pset_libver_bounds");
- /*
+ /*
* Case (1)
* Check file space information from a default file creation property list.
* Values expected:
- * strategy--H5F_FILE_SPACE_AGGR
- * persist--FALSE
- * threshold--1
- * file space page size--4096
+ * strategy--H5F_FILE_SPACE_AGGR
+ * persist--FALSE
+ * threshold--1
+ * file space page size--4096
*/
/* Create file creation property list template */
fcpl = H5Pcreate(H5P_FILE_CREATE);
@@ -3576,7 +3927,7 @@ test_filespace_info(const char *env_h5_drvr)
/* Close property list */
H5Pclose(fcpl);
- /*
+ /*
* Case (2)
* File space page size has a minimum size of 512.
* Setting value less than 512 will return an error;
@@ -3625,14 +3976,14 @@ test_filespace_info(const char *env_h5_drvr)
/* Close property list */
H5Pclose(fcpl);
- /*
+ /*
* Case (3)
* Check file space information when creating a file with default properties.
* Values expected:
- * strategy--H5F_FILE_SPACE_AGGR
- * persist--FALSE
- * threshold--1
- * file space page size--4096
+ * strategy--H5F_FILE_SPACE_AGGR
+ * persist--FALSE
+ * threshold--1
+ * file space page size--4096
*/
/* Create a file with default file creation and access property lists */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -3662,15 +4013,15 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pclose(fcpl1);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case (4)
* Check file space information when creating a file with the
* latest library format and default properties.
* Values expected:
- * strategy--H5F_FILE_SPACE_AGGR
- * persist--FALSE
- * threshold--1
- * file space page size--4096
+ * strategy--H5F_FILE_SPACE_AGGR
+ * persist--FALSE
+ * threshold--1
+ * file space page size--4096
*/
/* Create a file with the latest library format */
fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl);
@@ -3700,21 +4051,21 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pclose(fcpl1);
CHECK(ret, FAIL, "H5Pclose");
- /*
+ /*
* Case (5)
* Check file space information with the following combinations:
- * Create file with --
- * New or old format
- * Persist or not persist free-space
- * Different sizes for free-space section threshold (0 to 10)
- * The four file space strategies:
- * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE,
+ * Create file with --
+ * New or old format
+ * Persist or not persist free-space
+ * Different sizes for free-space section threshold (0 to 10)
+ * The four file space strategies:
+ * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE,
* H5F_FSPACE_STRATEGY_AGGR, H5F_FSPACE_STRATEGY_NONE
- * File space page size: set to 512
- *
+ * File space page size: set to 512
+ *
*/
for(new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t my_fapl;
+ hid_t my_fapl;
/* Set the FAPL for the type of format */
if(new_format) {
@@ -3733,7 +4084,7 @@ test_filespace_info(const char *env_h5_drvr)
for(fs_threshold = 0; fs_threshold <= TEST_THRESHOLD10; fs_threshold++) {
/* Test with 4 file space strategies */
- for(fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_strategy < H5F_FSPACE_STRATEGY_NTYPES; H5_INC_ENUM(H5F_fspace_strategy_t, fs_strategy)) {
+ for(fs_strategy = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_strategy < H5F_FSPACE_STRATEGY_NTYPES; fs_strategy++) {
if(!contig_addr_vfd && (fs_strategy == H5F_FSPACE_STRATEGY_PAGE || fs_persist))
continue;
@@ -3748,7 +4099,7 @@ test_filespace_info(const char *env_h5_drvr)
ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512);
CHECK(ret, FAIL, "H5Pset_file_space_strategy");
-
+
/* Retrieve file space information */
ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold);
CHECK(ret, FAIL, "H5Pget_file_space_strategy");
@@ -3858,7 +4209,7 @@ test_filespace_info(const char *env_h5_drvr)
**
*****************************************************************/
static int
-set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
+set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split)
{
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl_arr[H5FD_MEM_NTYPES];
@@ -3867,7 +4218,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
hbool_t relax;
H5FD_mem_t mt;
- HDassert(split || multi);
+ HDassert(split);
HDmemset(memb_name, 0, sizeof memb_name);
@@ -3881,7 +4232,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
memb_addr[H5FD_MEM_DRAW] = ((memb_addr[H5FD_MEM_DRAW] + pagesize - 1) / pagesize) * pagesize;
} else {
/* Set memb_addr aligned */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
memb_addr[mt] = ((memb_addr[mt] + pagesize - 1) / pagesize) * pagesize;
} /* end else */
@@ -3890,7 +4241,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split)
TEST_ERROR
/* Free memb_name */
- for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt))
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++)
free(memb_name[mt]);
return 0;
@@ -3906,14 +4257,6 @@ error:
** This routine checks the free space available in a file as
** returned by the public routine H5Fget_freespace().
**
-** Modifications:
-** Vailin Choi; July 2012
-** Remove datasets in reverse order so that all file spaces are shrunk.
-** (A change due to H5FD_FLMAP_DICHOTOMY.)
-**
-** Vailin Choi; Dec 2012
-** Add changes due to paged aggregation via new format:
-** the amount of freespace is different.
**
*****************************************************************/
static void
@@ -3966,7 +4309,7 @@ test_file_freespace(const char *env_h5_drvr)
my_fapl = new_fapl;
if(multi_vfd || split_vfd) {
- ret = set_multi_split(new_fapl, FSP_SIZE_DEF, multi_vfd, split_vfd);
+ ret = set_multi_split(new_fapl, FSP_SIZE_DEF, split_vfd);
CHECK(ret, FAIL, "set_multi_split");
}
@@ -4022,7 +4365,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");
@@ -4045,7 +4388,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 */
@@ -4053,10 +4396,7 @@ test_file_freespace(const char *env_h5_drvr)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
- if(new_format)
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
- else
- VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
+ VERIFY(free_space, expected_fs_del, "H5Fget_freespace");
/* Close file */
ret = H5Fclose(file);
@@ -4079,7 +4419,7 @@ test_file_freespace(const char *env_h5_drvr)
**
** test_sects_freespace():
** This routine checks free-space section information for the
-** file as returned by the public routine H5Fget_free_sections().
+** file as returned by the public routine H5Fget_free_sections().
**
*****************************************************************/
static void
@@ -4101,9 +4441,9 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
H5F_sect_info_t all_sect_info[15]; /* Array to hold free-space information for all types of data */
H5F_sect_info_t meta_sect_info[15]; /* Array to hold free-space information for metadata */
H5F_sect_info_t raw_sect_info[15]; /* Array to hold free-space information for raw data */
- hsize_t total = 0; /* sum of the free-space section sizes */
+ hsize_t total = 0; /* sum of the free-space section sizes */
hsize_t tmp_tot = 0; /* Sum of the free-space section sizes */
- hsize_t last_size; /* Size of last free-space section */
+ hsize_t last_size; /* Size of last free-space section */
hsize_t dims[1]; /* Dimension sizes */
unsigned u; /* Local index variable */
H5FD_mem_t type;
@@ -4135,14 +4475,14 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
/* Set up paged aligned address space for multi/split driver */
if(multi_vfd || split_vfd) {
- ret = set_multi_split(fapl, FSP_SIZE_DEF, multi_vfd, split_vfd);
+ ret = set_multi_split(fapl, FSP_SIZE_DEF, split_vfd);
CHECK(ret, FAIL, "set_multi_split");
}
} else {
ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1);
CHECK(ret, FAIL, "H5Pget_file_space_strategy");
- }
+ }
/* Create the file */
file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
@@ -4176,7 +4516,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");
@@ -4194,7 +4534,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");
@@ -4266,9 +4606,9 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
HDmemset(meta_sect_info, 0, sizeof(meta_sect_info));
if(multi_vfd) {
- hssize_t ntmp;
+ hssize_t ntmp;
- for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
+ for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; type++) {
if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP)
continue;
/* Get the # of free-space sections in the file for metadata */
@@ -4318,7 +4658,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
CHECK(fcpl, FAIL, "H5Pclose");
h5_clean_files(FILESPACE_NAME, fapl);
- }
+ }
} /* end test_sects_freespace() */
@@ -4326,29 +4666,29 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format)
/****************************************************************
**
** test_filespace_compatible():
-** Verify that the trunk with the latest file space management
-** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file.
-** Also verify the correct file space handling information
-** and the amount of free space.
+** Verify that the trunk with the latest file space management
+** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file.
+** Also verify the correct file space handling information
+** and the amount of free space.
**
****************************************************************/
static void
test_filespace_compatible(void)
{
int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */
- hid_t fid = -1; /* File id */
- hid_t did = -1; /* Dataset id */
- hid_t fcpl; /* File creation property list template */
- int check[100]; /* Temporary buffer for verifying dataset data */
- int rdbuf[100]; /* Temporary buffer for reading in dataset data */
- uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */
- ssize_t nread; /* Number of bytes read in */
- unsigned i, j; /* Local index variable */
- hssize_t free_space; /* Amount of free-space in the file */
- hbool_t persist; /* Persist free-space or not */
- hsize_t threshold; /* Free-space section threshold */
- H5F_fspace_strategy_t strategy; /* File space handling strategy */
- herr_t ret; /* Return value */
+ hid_t fid = -1; /* File id */
+ hid_t did = -1; /* Dataset id */
+ hid_t fcpl; /* File creation property list template */
+ int check[100]; /* Temporary buffer for verifying dataset data */
+ int rdbuf[100]; /* Temporary buffer for reading in dataset data */
+ uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */
+ ssize_t nread; /* Number of bytes read in */
+ unsigned i, j; /* Local index variable */
+ hssize_t free_space; /* Amount of free-space in the file */
+ hbool_t persist; /* Persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
+ H5F_fspace_strategy_t strategy; /* File space handling strategy */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("File space compatibility testing for 1.6 and 1.8 files\n"));
@@ -4357,31 +4697,31 @@ test_filespace_compatible(void)
const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */
/* Open and copy the test file into a temporary file */
- fd_old = HDopen(filename, O_RDONLY);
- CHECK(fd_old, FAIL, "HDopen");
- fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW);
- CHECK(fd_new, FAIL, "HDopen");
+ fd_old = HDopen(filename, O_RDONLY);
+ CHECK(fd_old, FAIL, "HDopen");
+ fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW);
+ CHECK(fd_new, FAIL, "HDopen");
- /* Copy data */
+ /* Copy data */
while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) {
ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread);
CHECK(write_err, -1, "HDwrite");
} /* end while */
- /* Close the files */
- ret = HDclose(fd_old);
- CHECK(ret, FAIL, "HDclose");
- ret = HDclose(fd_new);
- CHECK(ret, FAIL, "HDclose");
+ /* Close the files */
+ ret = HDclose(fd_old);
+ CHECK(ret, FAIL, "HDclose");
+ ret = HDclose(fd_new);
+ CHECK(ret, FAIL, "HDclose");
/* Open the temporary test file */
- fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
+ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
- /* There should not be any free space in the file */
- free_space = H5Fget_freespace(fid);
- CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
+ /* There should not be any free space in the file */
+ free_space = H5Fget_freespace(fid);
+ CHECK(free_space, FAIL, "H5Fget_freespace");
+ VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
/* Get the file's file creation property list */
fcpl = H5Fget_create_plist(fid);
@@ -4398,27 +4738,27 @@ test_filespace_compatible(void)
VERIFY(persist, FALSE, "H5Pget_file_space_strategy");
VERIFY(threshold, 1, "H5Pget_file_space_strategy");
- /* Generate raw data */
- for(i = 0; i < 100; i++)
- check[i] = (int)i;
+ /* Generate raw data */
+ for(i = 0; i < 100; i++)
+ check[i] = (int)i;
- /* Open and read the dataset */
- did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dopen");
- ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf);
- CHECK(ret, FAIL, "H5Dread");
+ /* Open and read the dataset */
+ did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dopen");
+ ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf);
+ CHECK(ret, FAIL, "H5Dread");
- /* Verify the data read is correct */
- for(i = 0; i < 100; i++)
- VERIFY(rdbuf[i], check[i], "test_compatible");
+ /* Verify the data read is correct */
+ for(i = 0; i < 100; i++)
+ VERIFY(rdbuf[i], check[i], "test_compatible");
- /* Close the dataset */
- ret = H5Dclose(did);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
- /* Remove the dataset */
- ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Ldelete");
+ /* Remove the dataset */
+ ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
/* Close the plist */
ret = H5Pclose(fcpl);
@@ -4428,30 +4768,30 @@ test_filespace_compatible(void)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- /* Re-Open the file */
- fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
+ /* Re-Open the file */
+ fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
- /* The dataset should not be there */
- did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
- VERIFY(did, FAIL, "H5Dopen");
+ /* The dataset should not be there */
+ did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
+ VERIFY(did, FAIL, "H5Dopen");
- /* There should not be any free space in the file */
- free_space = H5Fget_freespace(fid);
- CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
+ /* There should not be any free space in the file */
+ free_space = H5Fget_freespace(fid);
+ CHECK(free_space, FAIL, "H5Fget_freespace");
+ VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
- /* Close the file */
- ret = H5Fclose(fid);
- CHECK(ret, FAIL, "H5Fclose");
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
} /* end for */
} /* test_filespace_compatible */
/****************************************************************
**
** test_filespace_1.10.0_compatible():
-** Verify that the latest file space management can open, read and
-** modify 1.10.0 HDF5 files :
+** Verify that the latest file space management can open, read and
+** modify 1.10.0 HDF5 files :
** h5fc_ext1_i.h5: H5F_FILE_SPACE_ALL, default threshold; has superblock extension but no fsinfo message
** h5fc_ext1_f.h5: H5F_FILE_SPACE_ALL_PERSIST, default threshold; has superblock extension with fsinfo message
** h5fc_ext2_if.h5: H5F_FILE_SPACE_ALL, non-default threshold; has superblock extension with fsinfo message
@@ -4465,16 +4805,16 @@ static void
test_filespace_1_10_0_compatible(void)
{
hid_t fid = -1; /* File id */
- hid_t did = -1; /* Dataset id */
+ hid_t did = -1; /* Dataset id */
hid_t fcpl; /* File creation property list */
- hbool_t persist; /* Persist free-space or not */
- hsize_t threshold; /* Free-space section threshold */
+ hbool_t persist; /* Persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
H5F_fspace_strategy_t strategy; /* File space handling strategy */
- int wbuf[24]; /* Buffer for dataset data */
- int rdbuf[24]; /* Buffer for dataset data */
+ int wbuf[24]; /* Buffer for dataset data */
+ int rdbuf[24]; /* Buffer for dataset data */
int status; /* Status from copying the existing file */
unsigned i, j; /* Local index variable */
- herr_t ret; /* Return value */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("File space compatibility testing for 1.10.0 files\n"));
@@ -4482,7 +4822,7 @@ test_filespace_1_10_0_compatible(void)
for(j = 0; j < NELMTS(OLD_1_10_0_FILENAME); j++) {
/* Make a copy of the test file */
status = h5_make_local_copy(OLD_1_10_0_FILENAME[j], FILE5);
- CHECK(status, FAIL, "h5_make_local_copy");
+ CHECK(status, FAIL, "h5_make_local_copy");
/* Open the temporary test file */
fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -4516,7 +4856,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 1:
VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
@@ -4537,7 +4877,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 2:
VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
@@ -4558,7 +4898,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 3:
VERIFY(strategy, H5F_FSPACE_STRATEGY_NONE, "H5Pget_file_space_strategy");
@@ -4579,7 +4919,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 4:
VERIFY(strategy, H5F_FSPACE_STRATEGY_AGGR, "H5Pget_file_space_strategy");
@@ -4600,7 +4940,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 5:
VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
VERIFY(persist, H5F_FREE_SPACE_PERSIST_DEF, "H5Pget_file_space_strategy");
@@ -4620,10 +4960,10 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
default:
- break;
+ break;
}
/* Close the plist */
@@ -4654,7 +4994,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 1:
/* Open and read the dataset */
@@ -4671,7 +5011,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 2:
/* Open and read the dataset */
@@ -4688,7 +5028,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 3:
/* Open and read the dataset */
@@ -4705,7 +5045,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 4:
@@ -4723,7 +5063,7 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
case 5:
@@ -4741,10 +5081,10 @@ test_filespace_1_10_0_compatible(void)
/* Close the dataset */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
- break;
+ break;
default:
- break;
+ break;
}
/* Close the file */
@@ -4757,36 +5097,36 @@ test_filespace_1_10_0_compatible(void)
/****************************************************************
**
** test_filespace_round_compatible():
-** Verify that the trunk can open, read and modify these files--
-** 1) They are initially created (via gen_filespace.c) in the trunk
-** with combinations of file space strategies, default/non-default
-** threshold, and file spacing paging enabled/disbled.
-** The library creates the file space info message with
-** "mark if unknown" in these files.
-** 2) They are copied to the 1.8 branch, and are opened/read/modified
-** there via test_filespace_compatible() in test/tfile.c.
-** The 1.8 library marks the file space info message as "unknown"
-** in these files.
-** 3) They are then copied back from the 1.8 branch to the trunk for
-** compatibility testing via this routine.
-** 4) Upon encountering the file space info message which is marked
-** as "unknown", the library will use the default file space management
-** from then on: non-persistent free-space managers, default threshold,
-** and non-paging file space.
+** Verify that the trunk can open, read and modify these files--
+** 1) They are initially created (via gen_filespace.c) in the trunk
+** with combinations of file space strategies, default/non-default
+** threshold, and file spacing paging enabled/disbled.
+** The library creates the file space info message with
+** "mark if unknown" in these files.
+** 2) They are copied to the 1.8 branch, and are opened/read/modified
+** there via test_filespace_compatible() in test/tfile.c.
+** The 1.8 library marks the file space info message as "unknown"
+** in these files.
+** 3) They are then copied back from the 1.8 branch to the trunk for
+** compatibility testing via this routine.
+** 4) Upon encountering the file space info message which is marked
+** as "unknown", the library will use the default file space management
+** from then on: non-persistent free-space managers, default threshold,
+** and non-paging file space.
**
****************************************************************/
static void
test_filespace_round_compatible(void)
{
- hid_t fid = -1; /* File id */
- hid_t fcpl = -1; /* File creation property list ID */
- unsigned j; /* Local index variable */
- H5F_fspace_strategy_t strategy; /* File space strategy */
- hbool_t persist; /* Persist free-space or not */
- hsize_t threshold; /* Free-space section threshold */
- hssize_t free_space; /* Amount of free space in the file */
+ hid_t fid = -1; /* File id */
+ hid_t fcpl = -1; /* File creation property list ID */
+ unsigned j; /* Local index variable */
+ H5F_fspace_strategy_t strategy; /* File space strategy */
+ hbool_t persist; /* Persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
+ hssize_t free_space; /* Amount of free space in the file */
int status; /* Status from copying the existing file */
- herr_t ret; /* Return value */
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("File space compatibility testing for files from trunk to 1_8 to trunk\n"));
@@ -4794,31 +5134,31 @@ test_filespace_round_compatible(void)
for(j = 0; j < NELMTS(FSPACE_FILENAMES); j++) {
/* Make a copy of the test file */
status = h5_make_local_copy(FSPACE_FILENAMES[j], FILE5);
- CHECK(status, FAIL, "h5_make_local_copy");
-
- /* Open the temporary test file */
- fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
-
- /* Get the file's creation property list */
- fcpl = H5Fget_create_plist(fid);
- CHECK(fcpl, FAIL, "H5Fget_create_plist");
-
- ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold);
- CHECK(ret, FAIL, "H5Pget_file_space_strategy");
- VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
- VERIFY(persist, FALSE, "H5Pget_file_space_strategy");
- VERIFY(threshold, 1, "H5Pget_file_space_strategy");
-
- /* There should not be any free space in the file */
- free_space = H5Fget_freespace(fid);
- CHECK(free_space, FAIL, "H5Fget_freespace");
- VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
-
- /* Closing */
- ret = H5Fclose(fid);
- ret = H5Pclose(fcpl);
- CHECK(ret, FAIL, "H5Fclose");
+ CHECK(status, FAIL, "h5_make_local_copy");
+
+ /* Open the temporary test file */
+ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Get the file's creation property list */
+ fcpl = H5Fget_create_plist(fid);
+ CHECK(fcpl, FAIL, "H5Fget_create_plist");
+
+ ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold);
+ CHECK(ret, FAIL, "H5Pget_file_space_strategy");
+ VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy");
+ VERIFY(persist, FALSE, "H5Pget_file_space_strategy");
+ VERIFY(threshold, 1, "H5Pget_file_space_strategy");
+
+ /* There should not be any free space in the file */
+ free_space = H5Fget_freespace(fid);
+ CHECK(free_space, FAIL, "H5Fget_freespace");
+ VERIFY(free_space, (hssize_t)0, "H5Fget_freespace");
+
+ /* Closing */
+ ret = H5Fclose(fid);
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Fclose");
} /* end for */
} /* test_filespace_round_compatible */
@@ -4838,7 +5178,7 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
{
hid_t file, group; /* Handles */
hid_t fapl; /* File access property list */
- H5O_info_t oinfo; /* Object info */
+ H5O_native_info_t ninfo; /* Object info */
herr_t ret; /* Return value */
/*
@@ -4856,9 +5196,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
/*
* Make sure the root group has the correct object header version
*/
- ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.version, oh_vers_create, "H5Oget_info_by_name");
+ ret = H5Oget_native_info_by_name(file, "/", &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.version, oh_vers_create, "H5Oget_native_info_by_name");
/*
* Reopen the file and make sure the root group still has the correct version
@@ -4872,9 +5212,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
file = H5Fopen("tfile5.h5", H5F_ACC_RDWR, fapl);
CHECK(file, FAIL, "H5Fopen");
- ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.version, oh_vers_create, "H5Oget_info_by_name");
+ ret = H5Oget_native_info_by_name(file, "/", &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.version, oh_vers_create, "H5Oget_native_info_by_name");
/*
* Create a group named "G1" in the file, and make sure it has the correct
@@ -4883,9 +5223,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
group = H5Gcreate2(file, "/G1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate");
- ret = H5Oget_info(group, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name");
+ ret = H5Oget_native_info(group, &ninfo, H5O_NATIVE_INFO_HDR);
+ CHECK(ret, FAIL, "H5Oget_native)info");
+ VERIFY(ninfo.hdr.version, oh_vers_mod, "H5Oget_native_info");
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
@@ -4897,9 +5237,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
group = H5Gcreate2(file, "/G1/G3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group, FAIL, "H5Gcreate");
- ret = H5Oget_info(group, &oinfo);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.version, oh_vers_mod, "H5Oget_info_by_name");
+ ret = H5Oget_native_info(group, &ninfo, H5O_NATIVE_INFO_HDR);
+ CHECK(ret, FAIL, "H5Oget_native_info");
+ VERIFY(ninfo.hdr.version, oh_vers_mod, "H5Oget_native_info");
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
@@ -4907,9 +5247,9 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
/*
* Make sure the root group still has the correct object header version
*/
- ret = H5Oget_info_by_name(file, "/", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.version, oh_vers_create, "H5Oget_info_by_name");
+ ret = H5Oget_native_info_by_name(file, "/", &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.version, oh_vers_create, "H5Oget_native_info_by_name");
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
@@ -4918,6 +5258,207 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
CHECK(ret, FAIL, "H5Pclose");
} /* end test_libver_bounds_real() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_libver_bounds_open
+ *
+ * Purpose: Tests opening latest file with various low/high bounds.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ *-------------------------------------------------------------------------
+ */
+#define VERBFNAME "tverbounds_dspace.h5"
+#define VERBDSNAME "dataset 1"
+#define SPACE1_DIM1 3
+static void
+test_libver_bounds_open(void)
+{
+ hid_t file = -1; /* File ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t new_fapl = -1;/* File access property list ID for reopened file */
+ hid_t dcpl = -1; /* Dataset creation property list ID */
+ hsize_t dim[1] = {SPACE1_DIM1}; /* Dataset dimensions */
+ H5F_libver_t low, high; /* File format bounds */
+ hsize_t chunk_dim[1] = {SPACE1_DIM1}; /* Chunk dimensions */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Opening File in Various Version Bounds\n"));
+
+ /* Create a file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Create dataspace */
+ space = H5Screate_simple(1, dim, NULL);
+ CHECK(space, FAIL, "H5Screate_simple");
+
+ /* Create a dataset creation property list */
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+
+ /* Create and set chunk plist */
+ ret = H5Pset_chunk(dcpl, 1, chunk_dim);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+ ret = H5Pset_deflate(dcpl, 9);
+ CHECK(ret, FAIL, "H5Pset_deflate");
+ ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
+ CHECK(ret, FAIL, "H5Pset_chunk_opts");
+
+ /* Create a file with (LATEST, LATEST) bounds, create a layout version 4
+ dataset, then close the file */
+
+ /* Set version bounds to (LATEST, LATEST) */
+ low = H5F_LIBVER_LATEST;
+ high = H5F_LIBVER_LATEST;
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the file */
+ file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(file, FAIL, "H5Fcreate");
+
+ /* Create dataset */
+ dset = H5Dcreate2(file, VERBDSNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+
+ /* Close dataset and file */
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Attempt to open latest file with (earliest, v18), should fail */
+ ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST, H5F_LIBVER_V18);
+ H5E_BEGIN_TRY {
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ } H5E_END_TRY;
+ VERIFY(file, FAIL, "Attempted to open latest file with earliest version");
+
+ /* Attempt to open latest file with (v18, v18), should fail */
+ ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18);
+ H5E_BEGIN_TRY {
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ } H5E_END_TRY;
+ VERIFY(file, FAIL, "Attempted to open latest file with v18 bounds");
+
+ /* Opening VERBFNAME in these combination should succeed.
+ For each low bound, verify that it is upgraded properly */
+ high = H5F_LIBVER_LATEST;
+ for (low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
+ {
+ H5F_libver_t new_low = H5F_LIBVER_EARLIEST;
+
+ /* Set version bounds for opening file */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Open the file */
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDONLY, fapl);
+ CHECK(file, FAIL, "H5Fopen");
+
+ /* Get the new file access property */
+ new_fapl = H5Fget_access_plist(file);
+ CHECK(new_fapl, FAIL, "H5Fget_access_plist");
+
+ /* Get new low bound and verify that it has been upgraded properly */
+ ret = H5Pget_libver_bounds(new_fapl, &new_low, NULL);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+ VERIFY(new_low >= H5F_LIBVER_V110, TRUE, "Low bound should be upgraded to at least H5F_LIBVER_V110");
+
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+ } /* for low */
+
+ /* Close dataspace and property lists */
+ ret = H5Sclose(space);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+} /* end test_libver_bounds_open() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_libver_bounds_copy
+ *
+ * Purpose: Test to verify HDFFV-10800 is fixed:
+ * 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
+ * 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
+ * to the destination file.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+test_libver_bounds_copy(void)
+{
+ hid_t src_fid = -1; /* File ID */
+ hid_t dst_fid = -1; /* File ID */
+ hid_t fapl = -1; /* File access property list ID */
+ const char *src_fname; /* Source file name */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about the test being performed */
+ 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);
+
+ /* Open the source test file */
+ src_fid = H5Fopen(src_fname, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(src_fid, FAIL, "H5Fopen");
+
+ /* Create file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set library version bounds to (v18, v18) */
+ ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_V18, H5F_LIBVER_V18);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the destination file with the fapl */
+ dst_fid = H5Fcreate(DST_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(dst_fid, FAIL, "H5Pcreate");
+
+ /* Close the fapl */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Copy the dataset in the source file to the destination file */
+ ret = H5Ocopy(src_fid, DSET_DS1, dst_fid, DSET_DS1, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, SUCCEED, "H5Ocopy");
+
+ /* Close the source file */
+ ret = H5Fclose(src_fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the destination file */
+ ret = H5Fclose(dst_fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Remove the destination file */
+ HDremove(DST_FILE);
+
+} /* end test_libver_bounds_copy() */
+
/****************************************************************
**
** test_libver_bounds():
@@ -4935,12 +5476,1765 @@ test_libver_bounds(void)
/* Run the tests */
test_libver_bounds_real(H5F_LIBVER_EARLIEST, 1, H5F_LIBVER_LATEST, 2);
test_libver_bounds_real(H5F_LIBVER_LATEST, 2, H5F_LIBVER_EARLIEST, 2);
+ test_libver_bounds_open();
+ test_libver_bounds_copy();
} /* end test_libver_bounds() */
+/**************************************************************************************
+**
+** test_libver_bounds_low_high():
+** Tests to verify that format versions are correct with the following five
+** pairs of low/high version bounds set in fapl via H5Pset_libver_bounds():
+** (1) (earliest, v18)
+** (2) (earliest, v110)
+** (3) (v18, v18)
+** (4) (v18, v110)
+** (5) (v110, v110)
+**
+** For each pair of setting in fapl, verify format versions with the following
+** six tests:
+** (1) test_libver_bounds_super(fapl): superblock versions
+** (2) test_libver_bounds_obj(fapl): object header versions
+** (3) test_libver_bounds_dataset(fapl): message versions associated with dataset
+** (4) test_libver_bounds_dataspace(fapl): dataspace message versions
+** (5) test_libver_bounds_datatype(fapl): datatype message versions
+** (6) test_libver_bounds_attributes(fapl): attribute message versions
+**
+**************************************************************************************/
+static void
+test_libver_bounds_low_high(void)
+{
+ hid_t fapl = H5I_INVALID_HID; /* File access property list */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* The return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing setting (low, high) format version bounds\n"));
+
+ /* Create a file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++)
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ H5E_BEGIN_TRY {
+ /* Set the low/high version bounds */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ } H5E_END_TRY;
+
+ /* Should fail: invalid combinations */
+ if(high == H5F_LIBVER_EARLIEST) {
+ VERIFY(ret, FAIL, "H5Pset_libver_bounds");
+ continue;
+ }
+
+ /* Should fail: invalid combinations */
+ if(high < low) {
+ VERIFY(ret, FAIL, "H5Pset_libver_bounds");
+ continue;
+ }
+
+ /* All other combinations are valid and should succeed */
+ VERIFY(ret, SUCCEED, "H5Pset_libver_bounds");
+
+ /* Tests to verify version bounds */
+ test_libver_bounds_super(fapl);
+ test_libver_bounds_obj(fapl);
+ test_libver_bounds_dataset(fapl);
+ test_libver_bounds_dataspace(fapl);
+ test_libver_bounds_datatype(fapl);
+ test_libver_bounds_attributes(fapl);
+ }
+
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_low_high() */
+
+
+/***********************************************************************
+**
+** test_libver_bounds_super():
+** Verify superblock version with the following two tests:
+** (1) test_libver_bounds_super_create():
+** --when creating a file with the input fapl and the fcpl
+** that has the following feature enabled:
+** (A) default fcpl
+** (B) fcpl with v1-btee K value enabled
+** (C) fcpl with shared messages enabled
+** (D) fcpl with persistent free-space manager enabled
+**
+** (2) test_libver_bounds_super_open():
+** --when opening a file which is created with the input fapl
+** and the fcpl setting as #A to #D above.
+**
+** These two tests are run with or without SWMR file access.
+**
+*************************************************************************/
+static void
+test_libver_bounds_super(hid_t fapl)
+{
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ herr_t ret; /* The return value */
+
+ /* Create a default fcpl: #A */
+ /* This will result in superblock version 0 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #A and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #A and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a fcpl with v1-btree K value enabled: #B */
+ /* This will result in superblock version 1 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_istore_k(fcpl, 64);
+ CHECK(ret, FAIL, "H5Pset_istore_k");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #B and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #B and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a fcpl with shared messages enabled: #C */
+ /* This will result in superblock version 2 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_index");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #C and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, FALSE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #C and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, FALSE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, FALSE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a fcpl with persistent free-space manager enabled: #D */
+ /* This will result in superblock version 2 */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, (hsize_t)1);
+ CHECK(ret, FAIL, "H5Pset_file_space");
+
+ /* Verify superblock version when creating a file with input fapl,
+ fcpl #D and with/without SWMR access */
+ test_libver_bounds_super_create(fapl, fcpl, TRUE, TRUE);
+ test_libver_bounds_super_create(fapl, fcpl, FALSE, TRUE);
+
+ /* Verify superblock version when opening a file which is created
+ with input fapl, fcpl #D and with/without SWMR access */
+ test_libver_bounds_super_open(fapl, fcpl, TRUE, TRUE);
+ test_libver_bounds_super_open(fapl, fcpl, FALSE, TRUE);
+
+ /* Close the fcpl */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_super() */
+
+
+/**************************************************************************************************
+**
+** test_libver_bounds_super_create():
+** Verify the following when the file is created with the input fapl, fcpl,
+** and with/without SWMR access:
+** (a) the superblock version #
+** (b) the file's low bound setting
+** (c) fail or succeed in creating the file
+**
+** For file creation, the bounds setting in fapl, the feature enabled in fcpl,
+** and with/without SWMR file access will determine the results for #a to #c.
+**
+** The first row for the following two tables is the 5 pairs of low/high bounds setting
+** in the input fapl. The next three rows list the expected results for #a to #c.
+** "-->" indicates "upgrade to"
+**
+** The last table lists the expected results in creating the file when non-default
+** free-space info (fsinfo) is enabled in fcpl.
+**
+** Creating a file with write access
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** Superblock version | vers 0, 1, 2 | vers 0, 1, 2 | vers 2 | vers 2 | vers 3 |
+** |------------------------------------------------------------------------------|
+** File's low bound | no change |
+** |------------------------------------------------------------------------------|
+** File creation | succeed |
+** |______________________________________________________________________________|
+**
+** Creating a file with SWMR-write access
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** Superblock version | -- | vers 3 | -- | vers 3 | vers 3 |
+** |------------------------------------------------------------------------------|
+** File's low bound | -- | ->v110 | -- | ->v110 | no change |
+** |------------------------------------------------------------------------------|
+** File creation | fail | succeed | fail | succeed | succeed |
+** |______________________________________________________________________________|
+**
+** Creating a file with write/SWMR-write access + non-default fsinfo
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File creation | fail | succeed | fail | succeed | succeed |
+** |______________________________________________________________________________|
+**
+******************************************************************************************************/
+static void
+test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ hbool_t ok; /* The result is ok or not */
+ herr_t ret; /* The return value */
+
+ /* Try to create the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), fcpl, fapl);
+ } H5E_END_TRY;
+
+ /* Get the internal file pointer if the create succeeds */
+ if(fid >= 0) {
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+ }
+
+ /* Retrieve the low/high bounds */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ if(non_def_fsm && high < H5F_LIBVER_V110)
+ VERIFY(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ else if(is_swmr) { /* SWMR is enabled */
+ if(high >= H5F_LIBVER_V110) { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
+ VERIFY(HDF5_SUPERBLOCK_VERSION_3, f->shared->sblock->super_vers, "HDF5_superblock_ver_bounds");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V110, TRUE, "HDF5_superblock_ver_bounds");
+
+ } else /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fcreate");
+
+ } else { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
+ VERIFY(low, f->shared->low_bound, "HDF5_superblock_ver_bounds");
+
+ switch(low) {
+ case H5F_LIBVER_EARLIEST:
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_DEF ||
+ f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_1 ||
+ f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
+
+ case H5F_LIBVER_V18:
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_2);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
+
+ case H5F_LIBVER_V110:
+ case H5F_LIBVER_V112:
+ case H5F_LIBVER_V114:
+ ok = (f->shared->sblock->super_vers == HDF5_SUPERBLOCK_VERSION_3);
+ VERIFY(ok, TRUE, "HDF5_superblock_ver_bounds");
+ break;
+
+ case H5F_LIBVER_ERROR:
+ case H5F_LIBVER_NBOUNDS:
+ default:
+ ERROR("H5Pget_libver_bounds");
+
+ } /* end switch */
+
+ } /* end else */
+
+ if(fid >= 0) { /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+
+} /* end test_libver_bounds_super_create() */
+
+/**************************************************************************************************
+**
+** test_libver_bounds_super_open():
+** Verify the following when opening a file which is created with the input fapl, fcpl,
+** and with/without SWMR access:
+** (a) the file's low bound setting
+** (b) fail or succeed in opening the file
+**
+** (1) Create a file with the input fapl, fcpl and with/without SWMR access
+** (2) Close the file
+** (3) Reopen the file with a new fapl that is set to the 5 pairs of low/high bounds
+** in a for loop. For each pair of setting in the new fapl:
+** --Verify the expected results for #a and #b above.
+** --Close the file.
+**
+** For file open, the file's superblock version, the low/high bounds setting in fapl,
+** and with/without SWMR file access will determine the results for #a and #b.
+**
+** The first row for the following tables (#A - #B) is the 5 pairs of low/high bounds setting
+** in the input fapl. The next two rows list the expected results for #a and #b.
+** "-->" indicates "upgrade to"
+**
+** The last table (#C) lists the expected results in opening the file when non-default
+** free-space info (fsinfo) is enabled in fcpl.
+**
+** (A) Opening a file with write access
+**
+** Superblock version 0, 1
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File's low bound | no change |
+** |------------------------------------------------------------------------------|
+** File open | succeed |
+** |______________________________________________________________________________|
+**
+**
+** Superblock version 2
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File's low bound | -->v18 | no change |
+** |------------------------------------------------------------------------------|
+** File open | succeed |
+** |______________________________________________________________________________|
+**
+** Superblock version 3
+** --------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v110) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |______________________________________________________________________________|
+** File's low bound | -- | -->v110 | -- | -->v110 | no change |
+** |------------------------------------------------------------------------------|
+** File open | fail | succeed | fail | succeed | succeed |
+** |______________________________________________________________________________|
+**
+**
+**
+** (B) Opening a file with SWMR-write access
+**
+** Superblock version 0, 1, 2
+** -------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |_____________________________________________________________________________|
+** File's low bound | ----
+** |-----------------------------------------------------------------------------|
+** File open | fail
+** |_____________________________________________________________________________|
+**
+**
+** Superblock version 3
+** -------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |_____________________________________________________________________________|
+** File's low bound | -- | -->v110 | -- | -->v110 | no change |
+** |-----------------------------------------------------------------------------|
+** File open | fail | succeed | fail | succeed | succeed |
+** |_____________________________________________________________________________|
+**
+**
+** (C) Opening a file with write/SWMR-write access + non-default fsinfo
+** -------------------------------------------------------------------------------
+** | (earliest, v18) | (earliest, v10) | (v18, v18) | (v18, v110) | (v110, v110) |
+** |_____________________________________________________________________________|
+** File open | fail | succeed | fail | succeed | succeed |
+** |_____________________________________________________________________________|
+**
+**
+******************************************************************************************************/
+static void
+test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non_def_fsm)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ H5F_t *f = NULL; /* Internal file pointer */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ unsigned super_vers; /* Superblock version */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+
+ /* Create the file with the input fcpl and fapl */
+ H5E_BEGIN_TRY {
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ } H5E_END_TRY;
+
+ /* Retrieve the low/high bounds */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ if(non_def_fsm && high < H5F_LIBVER_V110) {
+ VERIFY(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ } else {
+ VERIFY(fid >= 0, TRUE, "H5Fcreate");
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+
+ /* The file's superblock version */
+ super_vers = f->shared->sblock->super_vers;
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ /* Invalid combinations */
+ if (ret < 0)
+ continue;
+
+ /* Open the file with or without SWMR access */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR | (is_swmr ? H5F_ACC_SWMR_WRITE : 0), new_fapl);
+ } H5E_END_TRY;
+
+ if(non_def_fsm && high < H5F_LIBVER_V110) {
+ VERIFY(fid, H5I_INVALID_HID, "H5Fopen");
+ continue;
+ }
+
+ /* Get the internal file pointer if the open succeeds */
+ if(fid >= 0) {
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+ }
+
+ /* Verify the file open succeeds or fails */
+ switch(super_vers) {
+ case 3:
+ if(high >= H5F_LIBVER_V110) {
+ /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V110, TRUE, "HDF5_superblock_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ } else /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
+ break;
+
+ case 2:
+ if(is_swmr) /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
+ else { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound >= H5F_LIBVER_V18, TRUE, "HDF5_superblock_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+ break;
+
+ case 1:
+ case 0:
+ if(is_swmr) /* Should fail */
+ VERIFY(fid >= 0, FALSE, "H5Fopen");
+ else { /* Should succeed */
+ VERIFY(fid >= 0, TRUE, "H5Fopen");
+ VERIFY(f->shared->low_bound, low, "HDF5_superblock_ver_bounds");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+ }
+ break;
+
+ default:
+ break;
+ } /* end switch */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+ } /* end else */
+
+} /* end test_libver_bounds_super_open() */
+
+/****************************************************************
+**
+** test_libver_bounds_obj():
+** Verify object header versions:
+**
+** (a) Create a file with:
+** --the input fapl
+** --a fcpl that has shared message enabled
+** Verify the root group's object header version.
+** Close the file.
+**
+** (b) Create another file with:
+** --the input fapl
+** --a default fcpl
+** Verify the root group's object header version.
+** Close the file.
+**
+** (c) Reopen the same file in (b) with a new fapl.
+** The new fapl is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each setting in fapl:
+** --Create a group in the file
+** --Verify the group's object header version
+** --Close and delete the group
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_obj(hid_t fapl)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ H5O_native_info_t ninfo; /* Object info */
+ H5G_info_t ginfo; /* Group info */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create a default file creation property list */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Enable shared message in the fcpl */
+ /* This will result in a version 2 object header */
+ ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_index");
+
+ /* Create the file with the fcpl and the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Get root group's object info */
+ ret = H5Oget_native_info_by_name(fid, "/", &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+
+ /* Verify object header version is 2 because shared message is enabled */
+ VERIFY(ninfo.hdr.version, H5O_VERSION_2, "H5O_obj_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the file creation property list */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a file with the default fcpl and input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Get root group's object info */
+ ret = H5Oget_native_info_by_name(fid, "/", &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+
+ /* Verify object header version is as indicated by low_bound */
+ VERIFY(ninfo.hdr.version, H5O_obj_ver_bounds[low], "H5O_obj_ver_bounds");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a new default file access property list which
+ is used to open the file in the "for" loop */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ /* Open the file with the fapl; create a group and verify the
+ object header version, then delete the group and close the file.*/
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+
+ /* Create a group in the file */
+ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Get group information */
+ ret = H5Gget_info(gid, &ginfo);
+ CHECK(ret, FAIL, "H5Gget_info");
+
+ /* Verify group storage type */
+ if(f->shared->low_bound >= H5F_LIBVER_V18)
+ /* Links in group are stored in object header */
+ VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_COMPACT, "H5Gget_info");
+ else
+ /* Links in group are stored with a "symbol table" */
+ VERIFY(ginfo.storage_type, H5G_STORAGE_TYPE_SYMBOL_TABLE, "H5Gget_info");
+
+ /* Get object header information */
+ ret = H5Oget_native_info_by_name(gid, GRP_NAME, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+
+ /* Verify object header version as indicated by low_bound */
+ VERIFY(ninfo.hdr.version, H5O_obj_ver_bounds[f->shared->low_bound], "H5O_obj_ver_bounds");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Delete the group */
+ ret = H5Ldelete(fid, GRP_NAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_obj() */
+
+/****************************************************************
+**
+** test_libver_bounds_dataset():
+** Verify message versions associated with datasets:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create the following two datasets:
+** --A contiguous dataset
+** --A chunked dataset with "no filter edge chunks"
+** For both datasets, verify the versions for the layout,
+** fill value and filter pipeline messages.
+** Close the file.
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in the
+** new fapl:
+** --Open the same file in (a) with the fapl
+** --Create a chunked dataset with 2 unlimited
+** dimensions
+** --Verify the versions for the layout, fill value
+** and filter pipeline messages
+** --Close and delete the dataset
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_dataset(hid_t fapl)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ H5D_t *dset = NULL; /* Internal dataset pointer */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+ hsize_t fix_dims2[2] = {10, 4}; /* Dimension sizes */
+ hsize_t fix_chunks2[2] = {4, 3}; /* Chunk dimension sizes */
+ hsize_t dims2[2] = {1, 4}; /* Dimension sizes */
+ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunks2[2] = {4, 5}; /* Chunk dimension sizes */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file with the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create the dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
+
+ /* Create a contiguous dataset */
+ did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate");
+
+ /* Get the internal dataset pointer */
+ dset = (H5D_t *)H5VL_object(did);
+ CHECK(dset, NULL, "H5VL_object");
+
+ /* Verify version for layout and fill value messages */
+ if(low == H5F_LIBVER_EARLIEST) {
+ /* For layout message: the earliest version the library will set is 3 */
+ /* For fill value message: the earliest version the library will set is 2 */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds");
+ } else {
+ VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[low], "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[low], "H5O_fill_ver_bounds");
+ }
+
+ /* Verify filter pipleline message version */
+ VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[low], "H5O_pline_ver_bounds");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset
+ with "no filter edge chunks" enabled.
+ This will result in a version 4 layout message */
+ sid = H5Screate_simple(2, fix_dims2, NULL);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 2, fix_chunks2);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+ ret = H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);
+ CHECK(ret, FAIL, "H5Pset_chunk_opts");
+
+ /* Create the chunked dataset */
+ H5E_BEGIN_TRY {
+ did = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ if(did >= 0) {
+
+ /* Get the internal dataset pointer */
+ dset = (H5D_t *)H5VL_object(did);
+ CHECK(dset, NULL, "H5VL_object");
+
+ /* Verify layout message version and chunk indexing type */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_FARRAY, "chunk_index_type");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ }
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the datset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create a default file access property list which is used
+ to open the file in the 'for' loop */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset with
+ 2 unlimited dimensions in the 'for' loop */
+ sid = H5Screate_simple(2, dims2, max_dims2);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 2, chunks2);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ /* Open the file with the fapl and create the chunked dataset */
+ /* Verify the dataset's layout, fill value and filter pipleline message versions */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+
+ /* Create the chunked dataset */
+ did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Get the internal file pointer */
+ dset = (H5D_t *)H5VL_object(did);
+ CHECK(dset, NULL, "H5VL_object");
+
+ /* Verify the dataset's layout, fill value and filter pipeline message versions */
+ /* Also verify the chunk indexing type */
+ if(f->shared->low_bound == H5F_LIBVER_EARLIEST) {
+ /* For layout message: the earliest version the library will set is 3 */
+ /* For fill value message: the earliest version the library will set is 2 */
+ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds");
+ } else {
+ VERIFY(dset->shared->layout.version, H5O_layout_ver_bounds[f->shared->low_bound], "H5O_layout_ver_bounds");
+ VERIFY(dset->shared->dcpl_cache.fill.version, H5O_fill_ver_bounds[f->shared->low_bound], "H5O_fill_ver_bounds");
+ }
+
+ /* Verify the filter pipeline message version */
+ VERIFY(dset->shared->dcpl_cache.pline.version, H5O_pline_ver_bounds[f->shared->low_bound], "H5O_pline_ver_bounds");
+
+ /* Verify the dataset's chunk indexing type */
+ if(dset->shared->layout.version == H5O_LAYOUT_VERSION_LATEST)
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BT2, "chunk_index_type");
+ else
+ VERIFY(dset->shared->layout.u.chunk.idx_type, H5D_CHUNK_IDX_BTREE, "chunk_index_type");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Delete the dataset */
+ ret = H5Ldelete(fid, DSETC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the dataset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_dataset() */
+
+/****************************************************************
+**
+** test_libver_bounds_dataspace():
+** Verify dataspace message versions:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create the following two datasets:
+** --A dataset with scalar dataspace
+** --A dataset with null dataspace
+** For both datasets, verify the dataspace message versions.
+** Close the file.
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in the
+** new fapl:
+** --Open the same file in (a) with the fapl
+** --Create a chunked dataset, a compact dataset and
+** a contigous dataset
+** --Verify the dataspace message version for these
+** three datasets
+** --Delete the three datasets and the dataspaces
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_dataspace(hid_t fapl)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t did = H5I_INVALID_HID, did_null = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t did_compact = H5I_INVALID_HID, did_contig = H5I_INVALID_HID; /* Dataset IDs */
+ hid_t sid = H5I_INVALID_HID, sid_null = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t sid_compact = H5I_INVALID_HID, sid_contig = H5I_INVALID_HID; /* Dataspace IDs */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t dcpl_compact = H5I_INVALID_HID, dcpl_contig = H5I_INVALID_HID; /* Dataset creation property lists */
+ H5S_t *space = NULL, *space_null = NULL; /* Internal dataspace pointers */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ hsize_t dims[1] = {1}; /* Dimension sizes */
+ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */
+ hsize_t max_dims[1] = {H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunks[1] = {4}; /* Chunk dimension sizes */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file with the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create scalar dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
+
+ /* Create a dataset with the scalar dataspace */
+ did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate");
+
+ /* Get the internal dataspace pointer */
+ sid = H5Dget_space(did);
+ CHECK(sid, H5I_INVALID_HID, "H5Dget_space");
+ space = (H5S_t *)H5I_object(sid);
+ CHECK(space, NULL, "H5I_object");
+
+ /* Verify the dataspace version */
+ VERIFY(space->extent.version, H5O_sdspace_ver_bounds[low], "H5O_sdspace_ver_bounds");
+
+ /* Create null dataspace */
+ sid_null = H5Screate(H5S_NULL);
+ CHECK(sid_null, H5I_INVALID_HID, "H5Screate");
+
+ /* Create a dataset with the null dataspace */
+ did_null = H5Dcreate2(fid, DSET_NULL, H5T_NATIVE_INT, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did_null, H5I_INVALID_HID, "H5Dcreate");
+
+ /* Get the internal dataspace pointer */
+ sid_null = H5Dget_space(did_null);
+ CHECK(sid_null, H5I_INVALID_HID, "H5Dget_space");
+ space_null = (H5S_t *)H5I_object(sid_null);
+ CHECK(space_null, NULL, "H5I_object");
+
+ /* Verify the dataspace version */
+ VERIFY(space_null->extent.version, H5O_SDSPACE_VERSION_2, "H5O_sdspace_ver_bounds");
+
+ /* Close the datasets */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(did_null);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataspaces */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid_null);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list which is used
+ to open the file in the 'for' loop */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset */
+ sid = H5Screate_simple(1, dims, max_dims);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 1, chunks);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Set up dataspace and dcpl for creating a compact dataset */
+ sid_compact = H5Screate_simple(1, dims, NULL);
+ CHECK(sid_compact, H5I_INVALID_HID, "H5Screate_simple");
+ dcpl_compact = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl_compact, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_layout(dcpl_compact, H5D_COMPACT);
+ CHECK(ret, FAIL, "H5Pset_layout");
+
+ /* Set up dataspace and dcpl for creating a contiguous dataset */
+ sid_contig = H5Screate_simple(2, dims2, NULL);
+ CHECK(sid_contig, H5I_INVALID_HID, "H5Screate_simple");
+ dcpl_contig = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl_contig, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_layout(dcpl_contig, H5D_CONTIGUOUS);
+ CHECK(ret, FAIL, "H5Pset_layout");
+
+ /* Loop through all the combinations of low/high bounds in new_fapl */
+ /* Open the file and create the chunked/compact/contiguous datasets */
+ /* Verify the dataspace message version for the three datasets */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ hid_t tmp_sid, tmp_sid_compact, tmp_sid_contig; /* Dataspace IDs */
+ H5S_t *tmp_space, *tmp_space_compact, *tmp_space_contig; /* Internal dataspace pointers */
+
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+
+ /* Create the chunked dataset */
+ did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Get the internal dataspace pointer for the chunked dataset */
+ tmp_sid = H5Dget_space(did);
+ CHECK(tmp_sid, H5I_INVALID_HID, "H5Dget_space");
+ tmp_space = (H5S_t *)H5I_object(tmp_sid);
+ CHECK(tmp_space, NULL, "H5I_object");
+
+ /* Create the compact dataset */
+ did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact, H5P_DEFAULT);
+ CHECK(did_compact, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Get the internal dataspace pointer for the compact dataset */
+ tmp_sid_compact = H5Dget_space(did_compact);
+ CHECK(tmp_sid_compact, H5I_INVALID_HID, "H5Dget_space");
+ tmp_space_compact = (H5S_t *)H5I_object(tmp_sid_compact);
+ CHECK(tmp_space_compact, NULL, "H5I_object");
+
+ /* Create the contiguous dataset */
+ did_contig = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid_contig, H5P_DEFAULT, dcpl_contig, H5P_DEFAULT);
+ CHECK(did_contig, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Get the internal dataspace pointer for the contiguous dataset */
+ tmp_sid_contig = H5Dget_space(did_contig);
+ CHECK(tmp_sid_contig, H5I_INVALID_HID, "H5Dget_space");
+ tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig);
+ CHECK(tmp_space_contig, NULL, "H5I_object");
+
+ /* Verify versions for the three dataspaces */
+ VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds");
+ VERIFY(tmp_space_compact->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds");
+ VERIFY(tmp_space_contig->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], "H5O_sdspace_ver_bounds");
+
+ /* Close the three datasets */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(did_compact);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Dclose(did_contig);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the three dataspaces */
+ ret = H5Sclose(tmp_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(tmp_sid_compact);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(tmp_sid_contig);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Delete the three datasets */
+ ret = H5Ldelete(fid, DSETA, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ ret = H5Ldelete(fid, DSETB, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+ ret = H5Ldelete(fid, DSETC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the three dataspaces */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid_compact);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid_contig);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the three dataset creation property lists */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(dcpl_compact);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Pclose(dcpl_contig);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_dataspace() */
+
+
+/****************************************************************
+**
+** test_libver_bounds_datatype():
+** Verify the datatype message version:
+**
+** (a) Create the following datatypes:
+** 1) integer
+** 2) enum
+** 3) array
+** 4) compound
+** 5) vlen
+** (b) Call test_libver_bounds_datatype_check() for each
+** datatype in (a) to verify the datatype message version.
+**
+****************************************************************/
+static void
+test_libver_bounds_datatype(hid_t fapl)
+{
+ hid_t tid = H5I_INVALID_HID, tid_enum = H5I_INVALID_HID, tid_array = H5I_INVALID_HID; /* Datatype IDs */
+ hid_t tid_compound = H5I_INVALID_HID, tid_vlen = H5I_INVALID_HID; /* Datatype IDs */
+ int enum_value; /* Value for enum datatype */
+ typedef struct s1 { /* Data structure for compound datatype */
+ char c;
+ int i;
+ } s1;
+ hsize_t dims[1] = {1}; /* Dimension sizes */
+ herr_t ret; /* Return value */
+
+ /* Create integer datatype */
+ tid = H5Tcopy(H5T_NATIVE_INT);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid);
+
+ /* Create enum datatype */
+ tid_enum = H5Tenum_create(tid);
+ enum_value = 0;
+ H5Tenum_insert(tid_enum, "val1", &enum_value);
+ enum_value = 1;
+ H5Tenum_insert(tid_enum, "val2", &enum_value);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_enum);
+
+ /* Create array datatype */
+ tid_array = H5Tarray_create2(tid, 1, dims);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_array);
+
+ /* Create compound datatype */
+ tid_compound = H5Tcreate(H5T_COMPOUND, sizeof(s1));
+ H5Tinsert(tid_compound, "c", HOFFSET(s1, c), H5T_STD_U8LE);
+ H5Tinsert(tid_compound, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_compound);
+
+ /* Create vlen datatype */
+ tid_vlen = H5Tvlen_create(tid);
+
+ /* Verify datatype message version */
+ test_libver_bounds_datatype_check(fapl, tid_vlen);
+
+ /* Close the datatypes */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_enum);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_array);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_compound);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Tclose(tid_vlen);
+ CHECK(ret, FAIL, "H5Tclose");
+
+} /* end test_libver_bounds_datatype() */
+
+/****************************************************************
+**
+** test_libver_bounds_datatype_check():
+** Helper routine called by test_libver_bounds_datatype()
+** to verify the datatype message version for the input tid:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create a contiguous dataset with the input tid.
+** Verify the datatype message version.
+** Create a committed datatype of string to be
+** used later.
+** Close the file.
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in
+** the new fapl:
+** --Open the same file in (a) with the fapl
+** --Verify the message version for the committed
+** datatype created earlier
+** --Create a chunked dataset with the input tid
+** --Verify the datatype message version
+** --Close and delete the dataset
+** --Close the file
+**
+****************************************************************/
+static void
+test_libver_bounds_datatype_check(hid_t fapl, hid_t tid)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t new_fapl = H5I_INVALID_HID; /* File acess property list */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ hid_t dtid = H5I_INVALID_HID; /* Datatype ID for the dataset */
+ hid_t str_tid = H5I_INVALID_HID; /* String datatype ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hsize_t dims[1] = {1}; /* Dimension sizes */
+ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */
+ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */
+ hsize_t chunks[2] = {2, 3}; /* Chunk dimension sizes */
+ H5T_t *dtype = NULL; /* Internal datatype pointer */
+ H5T_t *str_dtype = NULL; /* Internal datatype pointer for the string datatype */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high version bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file with the input fapl */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create a committed datatype of string which will be used
+ later inside the 'for' loop */
+ str_tid = H5Tcopy(H5T_C_S1);
+ CHECK(str_tid, H5I_INVALID_HID, "H5Tcopy");
+ ret = H5Tset_size(str_tid, (size_t)10);
+ CHECK(ret, FAIL, "H5Tset_size");
+ ret = H5Tcommit2(fid, "datatype", str_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+ ret = H5Tclose(str_tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Create dataspace */
+ sid = H5Screate_simple(1, dims, NULL);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create a dataset with the input tid */
+ did = H5Dcreate2(fid, DSET1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Get the dataset's datatype */
+ dtid = H5Dget_type(did);
+ CHECK(dtid, H5I_INVALID_HID, "H5Dget_type");
+
+ /* Get the internal datatype pointer */
+ dtype = (H5T_t *)H5I_object(dtid);
+ CHECK(dtype, NULL, "H5I_object");
+
+ /* Verify the datatype message version */
+ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * --the library will set version according to low_bound
+ * --H5T_ARRAY: the earliest version the library will set is 2
+ * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
+ * --the library will only use basic version
+ */
+
+ if(dtype->shared->type == H5T_COMPOUND ||
+ dtype->shared->type == H5T_ENUM ||
+ dtype->shared->type == H5T_ARRAY) {
+ if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST)
+ VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[low], "H5O_dtype_ver_bounds");
+ } else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the datatype */
+ ret = H5Tclose(dtid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Set up dataspace and dcpl for creating a chunked dataset */
+ sid = H5Screate_simple(2, dims2, max_dims2);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl, 2, chunks);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Loop through all the combinations of low/high bounds */
+ /* Open the file and create the chunked dataset with the input tid */
+ /* Verify the dataset's datatype message version */
+ /* Also verify the committed atatype message version */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >= 0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+
+ /* Open the committed datatype */
+ str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT);
+ CHECK(str_tid, FAIL, "H5Topen2");
+ str_dtype = (H5T_t *)H5VL_object(str_tid);
+ CHECK(str_dtype, NULL, "H5VL_object");
+
+ /* Verify the committed datatype message version */
+ VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
+
+ /* Close the committed datatype */
+ ret = H5Tclose(str_tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+
+ /* Create the chunked dataset */
+ did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Get the dataset's datatype */
+ dtid = H5Dget_type(did);
+ CHECK(dtid, H5I_INVALID_HID, "H5Dget_type");
+
+ /* Get the internal datatype pointer */
+ dtype = (H5T_t *)H5I_object(dtid);
+ CHECK(dtype, NULL, "H5I_object");
+
+ /* Verify the dataset's datatype message version */
+ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY:
+ * --the library will set version according to low_bound
+ * --H5T_ARRAY: the earliest version the library will set is 2
+ * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE:
+ * --the library will only use basic version
+ */
+ if(dtype->shared->type == H5T_COMPOUND ||
+ dtype->shared->type == H5T_ENUM ||
+ dtype->shared->type == H5T_ARRAY) {
+ if(dtype->shared->type == H5T_ARRAY &&
+ f->shared->low_bound == H5F_LIBVER_EARLIEST)
+ VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds");
+ else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[f->shared->low_bound], "H5O_dtype_ver_bounds");
+ } else
+ VERIFY(dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], "H5O_dtype_ver_bounds");
+
+ /* Close the dataset */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close the dataset's datatype */
+ ret = H5Tclose(dtid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Delete the dataset */
+ ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the dataset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* end test_libver_bounds_datatype_check() */
+
+/****************************************************************
+**
+** test_libver_bounds_attributes():
+** Verify the attribute message versions:
+**
+** (a) Create a file with default fcpl and the input fapl.
+** Create a group and attach the following three attributes
+** to the group:
+** (1) Attribute with a committed datatype
+** (2) Attribute with integer type
+** (3) Attribute with character encoding set
+** Verify the three attributes' message versions.
+** Close the file.
+**
+** (b) Create a fcpl that has shared datatype message enabled.
+** Create a file with the fcpl and the input fapl.
+** Create a group and attach an attribute with shared
+** integer type to the group.
+** Verify the attribute message version.
+** Close the file
+**
+** (b) Create a new fapl that is set to the 5 pairs of low/high
+** bounds in a "for" loop. For each pair of setting in
+** the new fapl:
+** --Open the same file in (b) with the fapl
+** --Open the group and attach an attribute with integer
+** type to the group
+** --Verify the attribute message version
+** --Delete the attribute
+** --Close the group and the file
+**
+****************************************************************/
+static void
+test_libver_bounds_attributes(hid_t fapl)
+{
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t fcpl = H5I_INVALID_HID; /* File creation property list */
+ hid_t new_fapl = H5I_INVALID_HID; /* File access property list */
+ hid_t tid = H5I_INVALID_HID; /* Datatype ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t attr_cpl = H5I_INVALID_HID; /* Attribute creation property list */
+ H5A_t *attr = NULL; /* Internal attribute pointer */
+ H5F_t *f = NULL; /* Internal file pointer */
+ H5F_libver_t low, high; /* Low and high bounds */
+ herr_t ret; /* Return value */
+
+ /* Retrieve the low/high bounds from the input fapl */
+ ret = H5Pget_libver_bounds(fapl, &low, &high);
+ CHECK(ret, FAIL, "H5Pget_libver_bounds");
+
+ /* Create the file */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Integer datatpye */
+ tid = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(tid, H5I_INVALID_HID, "H5Tcopy");
+
+ /* Create a committed datatype */
+ ret = H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Create dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
+
+ /* Create a group */
+ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, H5I_INVALID_HID, "H5Gcreate2");
+
+ /* Attach an attribute to the group with the committed datatype */
+ aid = H5Acreate2(gid, "attr1", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
+
+ /* Verify the attribute version */
+ if(low == H5F_LIBVER_EARLIEST)
+ /* The earliest version the library can set for an attribute with committed datatype is 2 */
+ VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds");
+ else
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Create an attribute to the group with integer type */
+ aid = H5Acreate2(gid, "attr2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
+
+ /* Verify attribute version */
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Enable character encoding in attribute creation property list */
+ attr_cpl = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ CHECK(attr_cpl, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Pset_char_encoding(attr_cpl, H5T_CSET_UTF8);
+ CHECK(ret, FAIL, "H5Pset_char_encoding");
+
+ /* Attach an attribute to the group with character encoding set */
+ aid = H5Acreate2(gid, "attr3", H5T_NATIVE_INT, sid, attr_cpl, H5P_DEFAULT);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
+
+ /* Get internal attribute pointer */
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
+
+ /* Verify attribute version */
+ if(low == H5F_LIBVER_EARLIEST)
+ /* The earliest version the library can set for an attribute with character encoding is 3 */
+ VERIFY(attr->shared->version, H5O_ATTR_VERSION_3, "H5O_attr_ver_bounds");
+ else
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close the attribute creation property list */
+ ret = H5Pclose(attr_cpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the datatype */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a copy of the file creation property list */
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Enable shared datatype message */
+ ret = H5Pset_shared_mesg_nindexes(fcpl, 1);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 2);
+ CHECK(ret, FAIL, "H5Pset_shared_mesg_index");
+
+ /* Create the file with shared datatype message enabled */
+ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create an integer datatye */
+ tid = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(tid, H5I_INVALID_HID, "H5Tcopy");
+
+ /* Create dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
+
+ /* Create a group */
+ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, H5I_INVALID_HID, "H5Gcreate2");
+
+ /* Attach an attribute to the group with shared integer datatype */
+ aid = H5Acreate2(gid, ATTR_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, H5I_INVALID_HID, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
+
+ /* Verify the attribute version */
+ if(low == H5F_LIBVER_EARLIEST)
+ /* The earliest version the library can set for an attribute with shared datatype is 2 */
+ VERIFY(attr->shared->version, H5O_ATTR_VERSION_2, "H5O_attr_ver_bounds");
+ else
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the datatype */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a default file access property list */
+ new_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(new_fapl, FAIL, "H5Pcreate");
+
+ /* Create a scalar dataspace to be used later for the attribute */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
+
+ /* Loop through all the combinations of low/high bounds */
+ /* Open the file and group and attach an attribute to the group */
+ /* Verify the attribute version */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(new_fapl, low, high);
+ } H5E_END_TRY;
+
+ if(ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Open the file */
+ H5E_BEGIN_TRY {
+ fid = H5Fopen(FILE8, H5F_ACC_RDWR, new_fapl);
+ } H5E_END_TRY;
+
+ if(fid >=0 ) { /* The file open succeeds */
+
+ /* Get the internal file pointer */
+ f = (H5F_t *)H5VL_object(fid);
+ CHECK(f, NULL, "H5VL_object");
+
+ /* Open the group */
+ gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen2");
+
+ /* Attach an attribute to the group */
+ aid = H5Acreate2(gid, "attr1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Get the internal attribute pointer */
+ attr = (H5A_t *)H5VL_object(aid);
+ CHECK(attr, NULL, "H5VL_object");
+
+ /* Verify the attribute message version */
+ VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound], "H5O_attr_ver_bounds");
+
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Delete the attribute */
+ ret = H5Adelete(gid, "attr1");
+ CHECK(ret, FAIL, "H5Adelete");
+
+ /* Close the group */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ } /* end if */
+ } /* end for */
+ } /* end for */
+
+ /* Close the file access property list */
+ ret = H5Pclose(new_fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+} /* end test_libver_bounds_attributes() */
+
/****************************************************************
**
** test_libver_macros():
-** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly.
+** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly.
**
****************************************************************/
static void
@@ -4989,7 +7283,7 @@ test_libver_macros(void)
/****************************************************************
**
** test_libver_macros2():
-** Verify that H5_VERSION_GE works correactly and show how
+** Verify that H5_VERSION_GE works correactly and show how
** to use it.
**
****************************************************************/
@@ -5022,9 +7316,9 @@ test_libver_macros2(void)
ret = H5Gclose(grp);
CHECK(ret, FAIL, "H5Gclose");
- /*
+ /*
* Delete the group using different function based on the library version.
- * And verify the action.
+ * And verify the action.
*/
#if H5_VERSION_GE(1,8,0)
ret = H5Ldelete(file, "Group", H5P_DEFAULT);
@@ -5052,8 +7346,258 @@ test_libver_macros2(void)
/****************************************************************
**
+** test_filesize():
+** Verify H5Fincrement_filesize() and H5Fget_eoa() works as
+** indicated in the "RFC: Enhancement to the tool h5clear".
+**
+****************************************************************/
+static void
+test_incr_filesize(void)
+{
+ hid_t fid; /* File opened with read-write permission */
+ h5_stat_size_t filesize; /* Size of file when empty */
+ hid_t fcpl; /* File creation property list */
+ hid_t fapl; /* File access property list */
+ hid_t dspace; /* Dataspace ID */
+ hid_t dset; /* Dataset ID */
+ hid_t dcpl; /* Dataset creation property list */
+ unsigned u; /* Local index variable */
+ char filename[FILENAME_LEN]; /* Filename to use */
+ char name[32]; /* Dataset name */
+ haddr_t stored_eoa; /* The stored EOA value */
+ hid_t driver_id = -1; /* ID for this VFD */
+ unsigned long driver_flags = 0; /* VFD feature flags */
+ herr_t ret; /* Return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing H5Fincrement_filesize() and H5Fget_eoa())\n"));
+
+ fapl = h5_fileaccess();
+ h5_fixname(FILE8, fapl, filename, sizeof filename);
+
+ /* Get the VFD feature flags */
+ driver_id = H5Pget_driver(fapl);
+ CHECK(driver_id, FAIL, "H5Pget_driver");
+
+ ret = H5FDdriver_query(driver_id, &driver_flags);
+ CHECK(ret, FAIL, "H5PDdriver_query");
+
+ /* Check whether the VFD feature flag supports these two public routines */
+ if(driver_flags & H5FD_FEAT_SUPPORTS_SWMR_IO) {
+
+ fcpl = H5Pcreate(H5P_FILE_CREATE);
+ CHECK(fcpl, FAIL, "H5Pcreate");
+
+ /* Set file space strategy */
+ ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1);
+ CHECK(ret, FAIL, "H5P_set_file_space_strategy");
+
+ /* Create the test file */
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ dspace = H5Screate(H5S_SCALAR);
+ CHECK(dspace, FAIL, "H5Screate");
+
+ /* Create a dataset creation property list */
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, FAIL, "H5Pcreate");
+
+ /* Set the space allocation time to early */
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
+ CHECK(ret, FAIL, "H5Pset_alloc_time");
+
+ /* Create datasets in file */
+ for(u = 0; u < 10; u++) {
+ HDsprintf(name, "Dataset %u", u);
+ dset = H5Dcreate2(fid, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ } /* end for */
+
+ /* Close dataspace */
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close dataset creation property list */
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Get the file size */
+ filesize = h5_get_file_size(filename, fapl);
+
+ /* Open the file */
+ fid = H5Fopen(filename, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* 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");
+
+ /* Set the EOA to the MAX(EOA, EOF) + 512 */
+ ret = H5Fincrement_filesize(fid, 512);
+ CHECK(ret, FAIL, "H5Fincrement_filesize");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Get the file size */
+ filesize = h5_get_file_size(filename, fapl);
+
+ /* Verify the filesize is the previous stored_eoa + 512 */
+ VERIFY(filesize, stored_eoa+512, "file size");
+
+ /* Close the file access property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close the file creation property list */
+ ret = H5Pclose(fcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ }
+} /* end test_incr_filesize() */
+
+/****************************************************************
+**
+** test_min_dset_ohdr():
+** Test API calls to toggle dataset object header minimization.
+**
+** TODO (as separate function?):
+** + setting persists between close and (re)open?
+** + dataset header sizes created while changing value of toggle
+**
+****************************************************************/
+static void
+test_min_dset_ohdr(void)
+{
+ const char basename[] = "min_dset_ohdr_testfile";
+ char filename[FILENAME_LEN] = "";
+ hid_t file_id = -1;
+ hid_t file2_id = -1;
+ hbool_t minimize;
+ herr_t ret;
+
+ MESSAGE(5, ("Testing dataset object header minimization\n"));
+
+ /*********/
+ /* SETUP */
+ /*********/
+
+ h5_fixname(basename, H5P_DEFAULT, filename, sizeof(filename));
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(file_id, "H5Fcreate");
+
+ /*********/
+ /* TESTS */
+ /*********/
+
+ /*----------------------------------------
+ * TEST default value
+ */
+ ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, FALSE, "minimize flag");
+
+ /*----------------------------------------
+ * TEST set to TRUE
+ */
+ ret = H5Fset_dset_no_attrs_hint(file_id, TRUE);
+ CHECK(ret, FAIL, "H5Fset_dset_no_attrs_hint");
+
+ ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, TRUE, "minimize flag");
+
+ /*----------------------------------------
+ * TEST second file open on same filename
+ */
+ file2_id = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK_I(file2_id, "H5Fopen");
+
+ /* verify TRUE setting on second open
+ */
+ ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, TRUE, "minimize flag");
+
+ /* re-set to FALSE on first open
+ */
+ ret = H5Fset_dset_no_attrs_hint(file_id, FALSE);
+ CHECK(ret, FAIL, "H5Fset_dset_no_attrs_hint");
+
+ /* verify FALSE set on both opens
+ */
+ ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, FALSE, "minimize flag");
+
+ ret = H5Fget_dset_no_attrs_hint(file2_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, FALSE, "minimize flag");
+
+ /* re-set to TRUE on second open
+ */
+ ret = H5Fset_dset_no_attrs_hint(file2_id, TRUE);
+ CHECK(ret, FAIL, "H5Fset_dset_no_attrs_hint");
+
+ /* verify TRUE set on both opens
+ */
+ ret = H5Fget_dset_no_attrs_hint(file_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, TRUE, "minimize flag");
+
+ ret = H5Fget_dset_no_attrs_hint(file2_id, &minimize);
+ CHECK(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+ VERIFY(minimize, TRUE, "minimize flag");
+
+ /*----------------------------------------
+ * TEST error cases
+ */
+
+ /* trying to set with invalid file ID */
+ H5E_BEGIN_TRY {
+ ret = H5Fset_dset_no_attrs_hint(-1, TRUE);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Fset_dset_no_attrs_hint");
+
+ /* trying to get with invalid file ID */
+ H5E_BEGIN_TRY {
+ ret = H5Fget_dset_no_attrs_hint(-1, &minimize);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+
+ /* trying to get with invalid pointer */
+ H5E_BEGIN_TRY {
+ ret = H5Fget_dset_no_attrs_hint(file_id, NULL);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Fget_dset_no_attrs_hint");
+
+ /************/
+ /* TEARDOWN */
+ /************/
+
+ ret = H5Fclose(file_id);
+ CHECK(ret, FAIL, "H5Fclose");
+ ret = H5Fclose(file2_id);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* end test_min_dset_ohdr() */
+
+/****************************************************************
+**
** test_deprec():
-** Test deprecated functionality.
+** Test deprecated functionality.
**
****************************************************************/
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -5069,7 +7613,7 @@ test_deprec(void)
unsigned freelist; /* Free list version # */
unsigned stab; /* Symbol table entry version # */
unsigned shhdr; /* Shared object header version # */
- H5F_info1_t finfo; /* global information about file */
+ H5F_info1_t finfo; /* global information about file */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -5285,7 +7829,9 @@ test_deprec(void)
void
test_file(void)
{
- const char *env_h5_drvr; /* File Driver value from environment */
+ const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t fapl_id = H5I_INVALID_HID; /* VFD-dependent fapl ID */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File I/O\n"));
@@ -5295,6 +7841,10 @@ test_file(void)
if(env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
+ /* Improved version of VFD-dependent checks */
+ fapl_id = h5_fileaccess();
+ CHECK(fapl_id, H5I_INVALID_HID, "h5_fileaccess");
+
test_file_create(); /* Test file creation(also creation templates)*/
test_file_open(); /* Test file opening */
test_file_reopen(); /* Test file reopening */
@@ -5303,7 +7853,8 @@ test_file(void)
test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */
test_file_perm(); /* Test file access permissions */
test_file_perm2(); /* Test file access permission again */
- test_file_ishdf5(); /* Test detecting HDF5 files correctly */
+ test_file_is_accessible(env_h5_drvr); /* Test detecting HDF5 files correctly */
+ test_file_delete(fapl_id); /* Test H5Fdelete */
test_file_open_dot(); /* Test opening objects with "." for a name */
test_file_open_overlap(); /* Test opening files in an overlapping manner */
test_file_getname(); /* Test basic H5Fget_name() functionality */
@@ -5333,22 +7884,30 @@ test_file(void)
test_filespace_round_compatible(); /* Testing file space compatibility for files from trunk to 1_8 to trunk */
test_filespace_1_10_0_compatible(); /* Testing file space compatibility for files from release 1.10.0 */
test_libver_bounds(); /* Test compatibility for file space management */
+ test_libver_bounds_low_high();
test_libver_macros(); /* Test the macros for library version comparison */
test_libver_macros2(); /* Test the macros for library version comparison */
+ test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */
+ test_min_dset_ohdr(); /* Test datset object header minimization */
#ifndef H5_NO_DEPRECATED_SYMBOLS
+ test_file_ishdf5(env_h5_drvr); /* Test detecting HDF5 files correctly */
test_deprec(); /* Test deprecated routines */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+ ret = H5Pclose(fapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
} /* test_file() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_file
+ * Function: cleanup_file
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
@@ -5366,5 +7925,6 @@ cleanup_file(void)
HDremove(FILE5);
HDremove(FILE6);
HDremove(FILE7);
+ HDremove(DST_FILE);
}
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 0e6b5c9..7ca7dca 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -13,21 +13,21 @@
/***********************************************************
*
-* Test program: tgenprop
+* Test program: tgenprop
*
* Test the Generic Property functionality
*
*************************************************************/
-#define H5P_FRIEND /*suppress error about including H5Ppkg */
+#define H5P_FRIEND /*suppress error about including H5Ppkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5P_TESTING
#include "testhdf5.h"
-#include "hdf5.h"
+
#include "H5Dprivate.h" /* For Dataset creation property list names */
-#include "H5Ppkg.h" /* Generic Properties */
+#include "H5Ppkg.h" /* Generic Properties */
#define FILENAME "tgenprop.h5"
@@ -80,11 +80,11 @@ typedef struct count_data_t {
static void
test_genprop_basic_class(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t cid3; /* Generic Property class ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
char *name; /* Name of class */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n"));
@@ -169,10 +169,10 @@ test_genprop_basic_class(void)
static void
test_genprop_basic_class_prop(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t size; /* Size of property */
- size_t nprops; /* Number of properties in class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ size_t size; /* Size of property */
+ size_t nprops; /* Number of properties in class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n"));
@@ -311,8 +311,8 @@ test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name,
static void
test_genprop_class_iter(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t nprops; /* Number of properties in class */
+ hid_t cid1; /* Generic Property class ID */
+ size_t nprops; /* Number of properties in class */
int idx; /* Index to start iteration at */
struct { /* Struct for iterations */
int iter_count;
@@ -323,7 +323,7 @@ test_genprop_class_iter(void)
PROP2_NAME,
PROP3_NAME,
PROP4_NAME};
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n"));
@@ -417,17 +417,17 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data)
static void
test_genprop_class_callback(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* Generic Property list ID */
- hid_t lid3; /* Generic Property list ID */
- size_t nprops; /* Number of properties in class */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* Generic Property list ID */
+ hid_t lid3; /* Generic Property list ID */
+ size_t nprops; /* Number of properties in class */
struct { /* Struct for callbacks */
int count;
hid_t id;
} crt_cb_struct, cpy_cb_struct, cls_cb_struct;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n"));
@@ -596,14 +596,14 @@ test_genprop_class_callback(void)
static void
test_genprop_basic_list(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
- size_t size; /* Size of property */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
+ size_t size; /* Size of property */
int prop1_value; /* Value for property #1 */
float prop2_value; /* Value for property #2 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n"));
@@ -678,8 +678,8 @@ 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",
- "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
+ 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__);
/* Close list */
@@ -702,14 +702,14 @@ test_genprop_basic_list(void)
static void
test_genprop_basic_list_prop(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
int prop1_value; /* Value for property #1 */
float prop2_value; /* Value for property #2 */
char prop3_value[10];/* Property #3 value */
double prop4_value; /* Property #4 value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n"));
@@ -770,8 +770,8 @@ 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",
- "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
+ 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) */
@@ -783,8 +783,8 @@ 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",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ 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 */
ret = H5Premove(lid1, PROP2_NAME);
@@ -820,8 +820,8 @@ 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",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ 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 */
ret = H5Pclose(lid1);
@@ -856,9 +856,9 @@ test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name,
static void
test_genprop_list_iter(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
int idx; /* Index to start iteration at */
struct { /* Struct for iterations */
int iter_count;
@@ -870,7 +870,7 @@ test_genprop_list_iter(void)
PROP1_NAME,
PROP2_NAME
};
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n"));
@@ -1144,10 +1144,10 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v
static void
test_genprop_list_callback(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* 2nd Generic Property list ID */
- size_t nprops; /* Number of properties in class */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* 2nd Generic Property list ID */
+ size_t nprops; /* Number of properties in class */
int prop1_value; /* Value for property #1 */
int prop1_new_value=20; /* Property #1 new value */
float prop2_value; /* Value for property #2 */
@@ -1158,7 +1158,7 @@ test_genprop_list_callback(void)
int count;
hid_t id;
} cop_cb_struct;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n"));
@@ -1225,8 +1225,8 @@ 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",
- "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
+ 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) */
ret = H5Pget(lid1, PROP3_NAME,&prop3_value);
@@ -1240,8 +1240,8 @@ 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",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ 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 */
VERIFY(prop1_cb_info.get_count, 1, "H5Pget");
@@ -1373,7 +1373,7 @@ test_genprop_list_addprop(void)
hid_t sid; /* Dataspace ID */
hid_t pid; /* Property List ID */
int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1448,7 +1448,7 @@ test_genprop_class_addprop(void)
hid_t cid; /* Property Class ID */
hid_t pid; /* Property List ID */
int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1570,7 +1570,7 @@ static void
test_genprop_list_add_remove_prop(void)
{
hid_t pid; /* Property List ID */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create a dataset creation property list */
pid = H5Pcreate(H5P_DATASET_CREATE);
@@ -1607,11 +1607,11 @@ test_genprop_list_add_remove_prop(void)
static void
test_genprop_equal(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* Generic Property list ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* Generic Property list ID */
int prop1_new_value = 20; /* Property #1 new value */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n"));
@@ -1756,11 +1756,11 @@ test_genprop_equal(void)
static void
test_genprop_path(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t cid3; /* Generic Property class ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
char *path; /* Class path */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n"));
@@ -1774,8 +1774,8 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for first class */
- path=H5P_get_class_path_test(cid1);
- CHECK_PTR(path, "H5P_get_class_path_test");
+ path = H5P__get_class_path_test(cid1);
+ CHECK_PTR(path, "H5P__get_class_path_test");
if(HDstrcmp(path,CLASS1_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
H5free_memory(path);
@@ -1789,14 +1789,14 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister2");
/* Get full path for second class */
- path=H5P_get_class_path_test(cid2);
- CHECK_PTR(path, "H5P_get_class_path_test");
+ path = H5P__get_class_path_test(cid2);
+ CHECK_PTR(path, "H5P__get_class_path_test");
if(HDstrcmp(path,CLASS2_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
/* Open a copy of the class with the path name */
- cid3 = H5P_open_class_path_test(path);
- CHECK_I(cid3, "H5Popen_class_path");
+ cid3 = H5P__open_class_path_test(path);
+ CHECK_I(cid3, "H5P__open_class_path_test");
/* Check that the classes are equal */
ret = H5Pequal(cid2,cid3);
@@ -1828,10 +1828,10 @@ test_genprop_path(void)
static void
test_genprop_refcount(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property class ID */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property class ID */
char *name; /* Name of class */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n"));
@@ -1901,10 +1901,10 @@ test_genprop_refcount(void)
static void
test_genprop_deprec_class(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t size; /* Size of property */
- size_t nprops; /* Number of properties in class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ size_t size; /* Size of property */
+ size_t nprops; /* Number of properties in class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n"));
@@ -2034,7 +2034,7 @@ test_genprop_deprec_list(void)
hid_t sid; /* Dataspace ID */
hid_t pid; /* Property List ID */
int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2130,15 +2130,15 @@ test_genprop(void)
} /* test_genprop() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_genprop
+ * Function: cleanup_genprop
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* June 8, 1999
*
* Modifications:
diff --git a/test/th5o.c b/test/th5o.c
index 4baac20..ab4a8de 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -13,13 +13,16 @@
/***********************************************************
*
-* Test program: th5o
+* Test program: th5o
*
* Test public H5O functions for accessing
*
*************************************************************/
#include "testhdf5.h"
+#include "H5Fprivate.h"
+#include "H5VLprivate.h"
+#include "H5VLnative_private.h"
#define TEST_FILENAME "th5o_file"
@@ -30,7 +33,7 @@
#define TEST6_DIM1 100
#define TEST6_DIM2 100
-
+
/****************************************************************
**
** test_h5o_open(): Test H5Oopen function.
@@ -140,7 +143,7 @@ test_h5o_open(void)
} /* test_h5o_open() */
-
+
/****************************************************************
**
** test_h5o_close(): Test H5Oclose function.
@@ -230,7 +233,8 @@ test_h5o_close(void)
CHECK(ret, FAIL, "H5Fclose");
}
-
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/****************************************************************
**
** test_h5o_open_by_addr(): Test H5Oopen_by_addr function.
@@ -239,17 +243,17 @@ test_h5o_close(void)
static void
test_h5o_open_by_addr(void)
{
- hid_t fid; /* HDF5 File ID */
- hid_t grp, dset, dtype, dspace; /* Object identifiers */
- H5L_info_t li; /* Buffer for H5Lget_info */
- haddr_t grp_addr; /* Addresses for objects */
- haddr_t dset_addr;
- haddr_t dtype_addr;
- hsize_t dims[RANK];
- H5I_type_t id_type; /* Type of IDs returned from H5Oopen */
- H5G_info_t ginfo; /* Group info struct */
- H5T_class_t type_class; /* Class of the datatype */
- herr_t ret; /* Value returned from API calls */
+ hid_t fid; /* HDF5 File ID */
+ hid_t grp, dset, dtype, dspace; /* Object identifiers */
+ H5L_info2_t li; /* Buffer for H5Lget_info */
+ haddr_t grp_addr; /* Addresses for objects */
+ haddr_t dset_addr;
+ haddr_t dtype_addr;
+ hsize_t dims[RANK];
+ H5I_type_t id_type; /* Type of IDs returned from H5Oopen */
+ H5G_info_t ginfo; /* Group info struct */
+ H5T_class_t type_class; /* Class of the datatype */
+ herr_t ret; /* Value returned from API calls */
/* Create a new HDF5 file */
fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -285,15 +289,20 @@ test_h5o_open_by_addr(void)
CHECK(ret, FAIL, "H5Sclose");
/* Get address for each object */
- ret = H5Lget_info(fid, "group", &li, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Lget_info");
- grp_addr = li.u.address;
- ret = H5Lget_info(fid, "group/datatype", &li, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Lget_info");
- dtype_addr = li.u.address;
- ret = H5Lget_info(fid, "dataset", &li, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Lget_info");
- dset_addr = li.u.address;
+ ret = H5Lget_info2(fid, "group", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info2");
+ ret = H5VLnative_token_to_addr(fid, li.u.token, &grp_addr);
+ CHECK(ret, FAIL, "H5VLnative_token_to_addr");
+
+ ret = H5Lget_info2(fid, "group/datatype", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info2");
+ ret = H5VLnative_token_to_addr(fid, li.u.token, &dtype_addr);
+ CHECK(ret, FAIL, "H5VLnative_token_to_addr");
+
+ ret = H5Lget_info2(fid, "dataset", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info2");
+ ret = H5VLnative_token_to_addr(fid, li.u.token, &dset_addr);
+ CHECK(ret, FAIL, "H5VLnative_token_to_addr");
/* Now make sure that H5Oopen_by_addr can open all three types of objects */
grp = H5Oopen_by_addr(fid, grp_addr);
@@ -366,8 +375,123 @@ test_h5o_open_by_addr(void)
}H5E_END_TRY
VERIFY(dtype, FAIL, "H5Oopen_by_addr");
} /* test_h5o_open_by_addr() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+
+/****************************************************************
+**
+** test_h5o_open_by_token(): Test H5Oopen_by_token function.
+**
+****************************************************************/
+static void
+test_h5o_open_by_token(void)
+{
+ hid_t fid; /* HDF5 File ID */
+ hid_t grp, dset, dtype, dspace; /* Object identifiers */
+ H5L_info2_t li; /* Buffer for H5Lget_info */
+ hsize_t dims[RANK];
+ H5I_type_t id_type; /* Type of IDs returned from H5Oopen */
+ H5G_info_t ginfo; /* Group info struct */
+ H5T_class_t type_class; /* Class of the datatype */
+ herr_t ret; /* Value returned from API calls */
+
+ /* Create a new HDF5 file */
+ fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create a group, dataset, and committed datatype within the file */
+ /* Create the group */
+ grp = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(grp, FAIL, "H5Gcreate2");
+ ret = H5Gclose(grp);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Commit the type inside the group */
+ dtype = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(dtype, FAIL, "H5Tcopy");
+ ret = H5Tcommit2(fid, "group/datatype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Create the data space for the dataset. */
+ dims[0] = DIM0;
+ dims[1] = DIM1;
+ dspace = H5Screate_simple(RANK, dims, NULL);
+ CHECK(dspace, FAIL, "H5Screate_simple");
+
+ /* Create the dataset. */
+ dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Make sure that H5Oopen_by_token can open all three types of objects */
+ ret = H5Lget_info2(fid, "group", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info");
+ grp = H5Oopen_by_token(fid, li.u.token);
+ CHECK(grp, FAIL, "H5Oopen_by_token");
+
+ ret = H5Lget_info2(fid, "group/datatype", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info");
+ dtype = H5Oopen_by_token(fid, li.u.token);
+ CHECK(dtype, FAIL, "H5Oopen_by_token");
+
+ ret = H5Lget_info2(fid, "dataset", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info");
+ /* Check that we can use the group ID as a valid location */
+ dset = H5Oopen_by_token(grp, li.u.token);
+ CHECK(dset, FAIL, "H5Oopen_by_token");
+
+ /* Make sure that each is the right kind of ID */
+ id_type = H5Iget_type(grp);
+ VERIFY(id_type, H5I_GROUP, "H5Iget_type for group ID");
+ id_type = H5Iget_type(dtype);
+ VERIFY(id_type, H5I_DATATYPE, "H5Iget_type for datatype ID");
+ id_type = H5Iget_type(dset);
+ VERIFY(id_type, H5I_DATASET, "H5Iget_type for dataset ID");
+
+ /* Do something more complex with each of the IDs to make sure they "work" */
+ ret = H5Gget_info(grp, &ginfo);
+ CHECK(ret, FAIL, "H5Gget_info");
+ VERIFY(ginfo.nlinks, 1, "H5Gget_info"); /* There should be one object, the datatype */
+
+ type_class = H5Tget_class(dtype);
+ VERIFY(type_class, H5T_INTEGER, "H5Tget_class");
+
+ dspace = H5Dget_space(dset);
+ CHECK(dspace, FAIL, "H5Dget_space");
+
+ /* Close the IDs */
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Gclose(grp);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Try giving some bogus values to H5O_open_by_token */
+ /* Try opening an object using H5O_TOKEN_UNDEF (should fail) */
+ H5E_BEGIN_TRY{
+ dtype = H5Oopen_by_token(fid, H5O_TOKEN_UNDEF);
+ }H5E_END_TRY
+ VERIFY(dtype, FAIL, "H5Oopen_by_token");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Also, trying to open an object without a valid location (should fail) */
+ H5E_BEGIN_TRY{
+ dtype = H5Oopen_by_token(fid, li.u.token);
+ }H5E_END_TRY
+ VERIFY(dtype, FAIL, "H5Oopen_by_token");
+
+} /* test_h5o_open_by_token() */
-
/****************************************************************
**
** test_h5o_refcount(): Test H5O refcounting functions.
@@ -378,7 +502,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_info2_t oinfo; /* Object info struct */
hsize_t dims[RANK];
herr_t ret; /* Value returned from API calls */
@@ -410,15 +534,15 @@ test_h5o_refcount(void)
CHECK(ret, FAIL, "H5Sclose");
/* Get ref counts for each object. They should all be 1, since each object has a hard link. */
- ret = H5Oget_info_by_name(fid, "group", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "datatype", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "dataset", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid, "group", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "datatype", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "dataset", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
/* Increment each object's reference count. */
ret = H5Oincr_refcount(grp);
@@ -429,15 +553,15 @@ test_h5o_refcount(void)
CHECK(ret, FAIL, "H5Oincr_refcount");
/* Get ref counts for each object. They should all be 2 now. */
- ret = H5Oget_info_by_name(fid, "group", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "datatype", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "dataset", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid, "group", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "datatype", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "dataset", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name3");
/* Decrement the reference counts and check that they decrease back to 1. */
ret = H5Odecr_refcount(grp);
@@ -447,15 +571,15 @@ test_h5o_refcount(void)
ret = H5Odecr_refcount(dset);
CHECK(ret, FAIL, "H5Odecr_refcount");
- ret = H5Oget_info_by_name(fid, "group", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "datatype", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "dataset", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid, "group", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "datatype", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "dataset", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
/* Increment the reference counts and then close the file to make sure the increment is permanant */
ret = H5Oincr_refcount(grp);
@@ -485,15 +609,15 @@ test_h5o_refcount(void)
dset = H5Dopen2(fid, "dataset", H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dopen2");
- ret = H5Oget_info_by_name(fid, "group", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "datatype", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "dataset", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid, "group", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "datatype", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "dataset", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 2, "reference count in H5Oget_info_by_name3");
/* Decrement the reference counts and close the file */
ret = H5Odecr_refcount(grp);
@@ -523,15 +647,15 @@ test_h5o_refcount(void)
dset = H5Dopen2(fid, "dataset", H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dopen2");
- ret = H5Oget_info_by_name(fid, "group", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "datatype", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid, "dataset", &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid, "group", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "datatype", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid, "dataset", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ VERIFY(oinfo.rc, 1, "reference count in H5Oget_info_by_name3");
/* Close the IDs */
ret = H5Gclose(grp);
@@ -562,7 +686,7 @@ test_h5o_refcount(void)
CHECK(ret, FAIL, "H5Fclose");
} /* test_h5o_refcount() */
-
+
/****************************************************************
**
** test_h5o_plist(): Test object creation properties
@@ -756,7 +880,7 @@ test_h5o_plist(void)
CHECK(ret, FAIL, "H5Pclose");
} /* test_h5o_plist() */
-
+
/****************************************************************
**
** test_h5o_link(): Test creating link to object
@@ -774,7 +898,7 @@ test_h5o_link(void)
hid_t lcpl_id=-1;
hsize_t dims[2] = {TEST6_DIM1, TEST6_DIM2};
htri_t committed; /* Whether the named datatype is committed */
- unsigned new_format; /* Whether to use the new format or not */
+ H5F_libver_t low, high; /* File format bounds */
int *wdata;
int *rdata;
int i, n;
@@ -783,9 +907,9 @@ test_h5o_link(void)
/* Allocate memory buffers */
/* (These are treated as 2-D buffers) */
wdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int));
- CHECK(wdata, NULL, "HDmalloc");
+ CHECK_PTR(wdata, "HDmalloc");
rdata = (int *)HDmalloc((size_t)(TEST6_DIM1 * TEST6_DIM2) * sizeof(int));
- CHECK(rdata, NULL, "HDmalloc");
+ CHECK_PTR(rdata, "HDmalloc");
/* Initialize the raw data */
for(i = n = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
@@ -801,98 +925,103 @@ test_h5o_link(void)
ret = H5Pset_create_intermediate_group(lcpl_id, TRUE);
CHECK(ret, FAIL, "H5Pset_create_intermediate_group");
- /* Loop over using new group format */
- for(new_format = FALSE; new_format <= TRUE; new_format++) {
-
- /* Make a FAPL that uses the "use the latest version of the format" bounds */
- fapl_id = H5Pcreate(H5P_FILE_ACCESS);
- CHECK(fapl_id, FAIL, "H5Pcreate");
-
- /* Set the "use the latest version of the format" bounds for creating objects in the file */
- ret = H5Pset_libver_bounds(fapl_id, (new_format ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST);
- CHECK(ret, FAIL, "H5Pset_libver_bounds");
-
- /* Create a new HDF5 file */
- file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
- CHECK(file_id, FAIL, "H5Fcreate");
-
- /* Close the FAPL */
- ret = H5Pclose(fapl_id);
- CHECK(ret, FAIL, "H5Pclose");
-
-
- /* Create and commit a datatype with no name */
- type_id = H5Tcopy(H5T_NATIVE_INT);
- CHECK(type_id, FAIL, "H5Fcreate");
- ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Tcommit_anon");
- committed = H5Tcommitted(type_id);
- VERIFY(committed, TRUE, "H5Tcommitted");
-
- /* Create a dataset with no name using the committed datatype*/
- dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate_anon");
-
- /* Verify that we can write to and read from the dataset */
-
- /* Write the data to the dataset */
- ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- CHECK(ret, FAIL, "H5Dwrite");
-
- /* Read the data back */
- ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
-
- /* 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");
-
- /* Link nameless datatype into nameless group */
- ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Olink");
-
- /* Link nameless dataset into nameless group with intermediate group */
- ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Olink");
-
- /* Close IDs for dataset and datatype */
- ret = H5Dclose(dset_id);
- CHECK(ret, FAIL, "H5Dclose");
- ret = H5Tclose(type_id);
- CHECK(ret, FAIL, "H5Tclose");
-
- /* Re-open datatype using new link */
- type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT);
- CHECK(type_id, FAIL, "H5Topen2");
-
- /* Link nameless group to root group and close the group ID*/
- ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Olink");
- ret = H5Gclose(group_id);
- CHECK(ret, FAIL, "H5Gclose");
-
- /* Open dataset through root group and verify its data */
- dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dopen2");
-
- /* Read data from dataset */
- ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dread");
- for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
- VERIFY(wdata[i], rdata[i], "H5Dread");
-
- /* Close open IDs */
- ret = H5Dclose(dset_id);
- CHECK(ret, FAIL, "H5Dclose");
- ret = H5Tclose(type_id);
- CHECK(ret, FAIL, "H5Tclose");
- ret = H5Fclose(file_id);
- CHECK(ret, FAIL, "H5Fclose");
- } /* end for */
+ /* Create a file access property list */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl_id, FAIL, "H5Pcreate");
+
+ /* Loop through all the combinations of low/high library format bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Set version bounds */
+ H5E_BEGIN_TRY {
+ ret = H5Pset_libver_bounds(fapl_id, low, high);
+ } H5E_END_TRY;
+
+ if (ret < 0) /* Invalid low/high combinations */
+ continue;
+
+ /* Create a new HDF5 file */
+ file_id = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ CHECK(file_id, FAIL, "H5Fcreate");
+
+ /* Close the FAPL */
+ ret = H5Pclose(fapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create and commit a datatype with no name */
+ type_id = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(type_id, FAIL, "H5Fcreate");
+ ret = H5Tcommit_anon(file_id, type_id, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit_anon");
+ committed = H5Tcommitted(type_id);
+ VERIFY(committed, TRUE, "H5Tcommitted");
+
+ /* Create a dataset with no name using the committed datatype*/
+ dset_id = H5Dcreate_anon(file_id, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate_anon");
+
+ /* Verify that we can write to and read from the dataset */
+
+ /* Write the data to the dataset */
+ ret = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Read the data back */
+ ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* 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");
+
+ /* Link nameless datatype into nameless group */
+ ret = H5Olink(type_id, group_id, "datatype", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Olink");
+
+ /* Link nameless dataset into nameless group with intermediate group */
+ ret = H5Olink(dset_id, group_id, "inter_group/dataset", lcpl_id, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Olink");
+
+ /* Close IDs for dataset and datatype */
+ ret = H5Dclose(dset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Tclose(type_id);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Re-open datatype using new link */
+ type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT);
+ CHECK(type_id, FAIL, "H5Topen2");
+
+ /* Link nameless group to root group and close the group ID*/
+ ret = H5Olink(group_id, file_id, "/group", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Olink");
+ ret = H5Gclose(group_id);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open dataset through root group and verify its data */
+ dset_id = H5Dopen2(file_id, "/group/inter_group/dataset", H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dopen2");
+
+ /* Read data from dataset */
+ ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+ for(i = 0; i < (TEST6_DIM1 * TEST6_DIM2); i++)
+ VERIFY(wdata[i], rdata[i], "H5Dread");
+
+ /* Close open IDs */
+ ret = H5Dclose(dset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Tclose(type_id);
+ CHECK(ret, FAIL, "H5Tclose");
+ ret = H5Fclose(file_id);
+ CHECK(ret, FAIL, "H5Fclose");
+ } /* for high */
+ } /* for low */
/* Close remaining IDs */
ret = H5Sclose(space_id);
@@ -905,7 +1034,7 @@ test_h5o_link(void)
HDfree(rdata);
} /* end test_h5o_link() */
-
+
/****************************************************************
**
** test_h5o_comment(): Test H5Oset(get)_comment functions.
@@ -1078,7 +1207,7 @@ test_h5o_comment(void)
} /* test_h5o_comment() */
-
+
/****************************************************************
**
** test_h5o_comment_by_name(): Test H5Oset(get)_comment_by_name functions.
@@ -1237,7 +1366,7 @@ test_h5o_comment_by_name(void)
} /* test_h5o_comment_by_name() */
-
+
/****************************************************************
**
** test_h5o_getinfo_same_file(): Test that querying the object info for
@@ -1249,7 +1378,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_info2_t oinfo1, oinfo2; /* Object info structs */
herr_t ret; /* Value returned from API calls */
/* Create a new HDF5 file */
@@ -1267,24 +1396,24 @@ test_h5o_getinfo_same_file(void)
HDmemset(&oinfo2, 0, sizeof(oinfo2));
/* Query the object info for each object, through group IDs */
- ret = H5Oget_info(gid1, &oinfo1);
- CHECK(ret, FAIL, "H5Oget_info");
- ret = H5Oget_info(gid2, &oinfo2);
- CHECK(ret, FAIL, "H5Oget_info");
+ ret = H5Oget_info3(gid1, &oinfo1, H5O_INFO_BASIC);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ ret = H5Oget_info3(gid2, &oinfo2, H5O_INFO_BASIC);
+ CHECK(ret, FAIL, "H5Oget_info3");
- VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info");
+ VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info3");
/* Reset object info */
HDmemset(&oinfo1, 0, sizeof(oinfo1));
HDmemset(&oinfo2, 0, sizeof(oinfo2));
/* Query the object info for each object, by name */
- ret = H5Oget_info_by_name(fid1, "group1", &oinfo1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid1, "group2", &oinfo2, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid1, "group1", &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid1, "group2", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
- VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info");
+ VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info3");
/* Close everything */
ret = H5Gclose(gid1);
@@ -1312,24 +1441,24 @@ test_h5o_getinfo_same_file(void)
HDmemset(&oinfo2, 0, sizeof(oinfo2));
/* Query the object info for each object, through group IDs */
- ret = H5Oget_info(gid1, &oinfo1);
- CHECK(ret, FAIL, "H5Oget_info");
- ret = H5Oget_info(gid2, &oinfo2);
- CHECK(ret, FAIL, "H5Oget_info");
+ ret = H5Oget_info3(gid1, &oinfo1, H5O_INFO_BASIC);
+ CHECK(ret, FAIL, "H5Oget_info3");
+ ret = H5Oget_info3(gid2, &oinfo2, H5O_INFO_BASIC);
+ CHECK(ret, FAIL, "H5Oget_info3");
- VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info");
+ VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info3");
/* Reset object info */
HDmemset(&oinfo1, 0, sizeof(oinfo1));
HDmemset(&oinfo2, 0, sizeof(oinfo2));
/* Query the object info for each object, by name */
- ret = H5Oget_info_by_name(fid1, "group1", &oinfo1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Oget_info_by_name(fid1, "group2", &oinfo2, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(fid1, "group1", &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(fid1, "group2", &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
- VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info");
+ VERIFY(oinfo1.fileno, oinfo2.fileno, "file number from H5Oget_info3");
/* Close everything */
ret = H5Gclose(gid1);
@@ -1343,8 +1472,275 @@ test_h5o_getinfo_same_file(void)
} /* test_h5o_getinfo_same_file() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/****************************************************************
+**
+** test_h5o_open_by_addr_deprec(): Test H5Oopen_by_addr function.
+**
+****************************************************************/
+static void
+test_h5o_open_by_addr_deprec(void)
+{
+ hid_t fid; /* HDF5 File ID */
+ hid_t grp, dset, dtype, dspace; /* Object identifiers */
+ H5L_info1_t li; /* Buffer for H5Lget_info1 */
+ haddr_t grp_addr; /* Addresses for objects */
+ haddr_t dset_addr;
+ haddr_t dtype_addr;
+ hsize_t dims[RANK];
+ H5I_type_t id_type; /* Type of IDs returned from H5Oopen */
+ H5G_info_t ginfo; /* Group info struct */
+ H5T_class_t type_class; /* Class of the datatype */
+ herr_t ret; /* Value returned from API calls */
+
+ /* Create a new HDF5 file */
+ fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create a group, dataset, and committed datatype within the file */
+ /* Create the group */
+ grp = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(grp, FAIL, "H5Gcreate2");
+ ret = H5Gclose(grp);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Commit the type inside the group */
+ dtype = H5Tcopy(H5T_NATIVE_INT);
+ CHECK(dtype, FAIL, "H5Tcopy");
+ ret = H5Tcommit2(fid, "group/datatype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Create the data space for the dataset. */
+ dims[0] = DIM0;
+ dims[1] = DIM1;
+ dspace = H5Screate_simple(RANK, dims, NULL);
+ CHECK(dspace, FAIL, "H5Screate_simple");
+
+ /* Create the dataset. */
+ dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Get address for each object */
+ ret = H5Lget_info1(fid, "group", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info");
+ grp_addr = li.u.address;
+ ret = H5Lget_info1(fid, "group/datatype", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info");
+ dtype_addr = li.u.address;
+ ret = H5Lget_info1(fid, "dataset", &li, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info");
+ dset_addr = li.u.address;
+
+ /* Now make sure that H5Oopen_by_addr can open all three types of objects */
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ CHECK(grp, FAIL, "H5Oopen_by_addr");
+ dtype = H5Oopen_by_addr(fid, dtype_addr);
+ CHECK(dtype, FAIL, "H5Oopen_by_addr");
+ /* Check that we can use the group ID as a valid location */
+ dset = H5Oopen_by_addr(grp, dset_addr);
+ CHECK(dset, FAIL, "H5Oopen_by_addr");
+
+ /* Make sure that each is the right kind of ID */
+ id_type = H5Iget_type(grp);
+ VERIFY(id_type, H5I_GROUP, "H5Iget_type for group ID");
+ id_type = H5Iget_type(dtype);
+ VERIFY(id_type, H5I_DATATYPE, "H5Iget_type for datatype ID");
+ id_type = H5Iget_type(dset);
+ VERIFY(id_type, H5I_DATASET, "H5Iget_type for dataset ID");
+
+ /* Do something more complex with each of the IDs to make sure they "work" */
+ ret = H5Gget_info(grp, &ginfo);
+ CHECK(ret, FAIL, "H5Gget_info");
+ VERIFY(ginfo.nlinks, 1, "H5Gget_info"); /* There should be one object, the datatype */
+
+ type_class = H5Tget_class(dtype);
+ VERIFY(type_class, H5T_INTEGER, "H5Tget_class");
+
+ dspace = H5Dget_space(dset);
+ CHECK(dspace, FAIL, "H5Dget_space");
+
+ /* Close the IDs */
+ ret = H5Sclose(dspace);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Gclose(grp);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Try giving some bogus values to H5O_open_by_addr. */
+ /* Try to open an object with a bad address */
+ grp_addr += 20;
+ H5E_BEGIN_TRY{
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }H5E_END_TRY
+ VERIFY(grp, FAIL, "H5Oopen_by_addr");
+
+ /* For instance, an objectno smaller than the end of the file's superblock should
+ * trigger an error */
+ grp_addr = 10;
+ H5E_BEGIN_TRY{
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }H5E_END_TRY
+ VERIFY(grp, FAIL, "H5Oopen_by_addr");
+
+ /* Likewise, an objectno larger than the size of the file should fail */
+ grp_addr = 0;
+ grp_addr = 1000000000;
+ H5E_BEGIN_TRY{
+ grp = H5Oopen_by_addr(fid, grp_addr);
+ }H5E_END_TRY
+ VERIFY(grp, FAIL, "H5Oopen_by_addr");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Also, trying to open an object without a valid location should fail */
+ H5E_BEGIN_TRY{
+ dtype = H5Oopen_by_addr(fid, dtype_addr);
+ }H5E_END_TRY
+ VERIFY(dtype, FAIL, "H5Oopen_by_addr");
+} /* test_h5o_open_by_addr_deprec() */
+
+
+/****************************************************************
+**
+** visit_obj_cb():
+** 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().
+**
+****************************************************************/
+static int
+visit_obj_cb(hid_t group_id, const char *name, const H5O_info1_t *oinfo1,
+ void H5_ATTR_UNUSED *_op_data)
+{
+ H5O_info1_t oinfo2; /* Object info structs */
+
+ /* Verify the object info for "group1", "group2" and the root group */
+ if(!(HDstrcmp(name, "group1"))) {
+ H5Oget_info_by_name2(group_id, name, &oinfo2, H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
+ VERIFY(oinfo1->num_attrs, oinfo2.num_attrs, "obj info from H5Ovisit1");
+ } else if(!(HDstrcmp(name, "group2"))) {
+ H5Oget_info_by_name2(group_id, name, &oinfo2, H5O_INFO_HDR, H5P_DEFAULT);
+ VERIFY(oinfo1->hdr.nmesgs, oinfo2.hdr.nmesgs, "obj info from H5Ovisit1/H5Oget_info2");
+ VERIFY(oinfo1->hdr.nchunks, oinfo2.hdr.nchunks, "obj info from H5Ovisit1/H5Oget_info2");
+ } else if(!(HDstrcmp(name, "."))) {
+ H5Oget_info_by_name2(group_id, name, &oinfo2, H5O_INFO_META_SIZE, H5P_DEFAULT);
+ VERIFY(oinfo1->meta_size.obj.index_size, oinfo2.meta_size.obj.index_size, "obj info from H5Ovisit1/H5Oget_info2");
+ VERIFY(oinfo1->meta_size.obj.heap_size, oinfo2.meta_size.obj.heap_size, "obj info from H5Ovisit1/H5Oget_info2");
+ }
+
+ return(H5_ITER_CONT);
+} /* end visit_obj_cb() */
+
+
+/****************************************************************
+**
+** 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
+** the same as H5Oget_info2().
+**
+****************************************************************/
+static void
+test_h5o_getinfo_visit(void)
+{
+ hid_t fid = -1; /* HDF5 File ID */
+ hid_t gid1 = -1, gid2 = -1; /* Group IDs */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t aid = -1; /* Attribute ID */
+ H5O_info1_t oinfo1, oinfo2; /* Object info structs */
+ char attrname[25]; /* Attribute name */
+ int j; /* Local index variable */
+ herr_t ret; /* Value returned from API calls */
+
+ /* Create an HDF5 file */
+ fid = H5Fcreate(TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create "group1" in the file */
+ gid1 = H5Gcreate2(fid, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid1, FAIL, "H5Gcreate2");
+
+ /* Create dataspace */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Attach 10 attributes to "group1" */
+ for(j = 0; j <10; j++) {
+ /* Create the attribute name */
+ HDsprintf(attrname, "attr%u", j);
+ /* Create the attribute */
+ aid = H5Acreate2(gid1, attrname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+ /* Close the attribute */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ }
+
+ /* Create "group2" in the file */
+ gid2 = H5Gcreate2(fid, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid2, FAIL, "H5Gcreate2");
+
+ /* Reset object info */
+ HDmemset(&oinfo1, 0, sizeof(oinfo1));
+ HDmemset(&oinfo2, 0, sizeof(oinfo2));
+
+ /* Query the object info for "group1" via H5Oget_info1 and H5Oget_info2 */
+ ret = H5Oget_info1(gid1, &oinfo1);
+ CHECK(ret, FAIL, "H5Oget_info1");
+ ret = H5Oget_info2(gid1, &oinfo2, H5O_INFO_BASIC|H5O_INFO_NUM_ATTRS);
+ CHECK(ret, FAIL, "H5Oget_info2");
+
+ /* Verify the object info for "group1" is correct */
+ VERIFY(oinfo1.fileno, oinfo2.fileno, "obj info from H5Oget_info1/2");
+ VERIFY(oinfo1.num_attrs, oinfo2.num_attrs, "obj info from H5Oget_info1/2");
+
+ /* Reset object info */
+ HDmemset(&oinfo1, 0, sizeof(oinfo1));
+ HDmemset(&oinfo2, 0, sizeof(oinfo2));
+
+ /* Query the object info for "group2" via H5Oget_info1 and H5Oget_info2 */
+ ret = H5Oget_info_by_name1(fid, "group2", &oinfo1, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ ret = H5Oget_info_by_name2(fid, "group2", &oinfo2, H5O_INFO_HDR|H5O_INFO_META_SIZE, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+
+ /* Verify the object info for "group2" is correct */
+ VERIFY(oinfo1.hdr.nmesgs, oinfo2.hdr.nmesgs, "obj info from H5Oget_info1/2");
+ VERIFY(oinfo1.hdr.nchunks, oinfo2.hdr.nchunks, "obj info from H5Oget_info1/2");
+ VERIFY(oinfo1.meta_size.obj.index_size, oinfo2.meta_size.obj.index_size, "obj info from H5Oget_info1/2");
+ VERIFY(oinfo1.meta_size.obj.heap_size, oinfo2.meta_size.obj.heap_size, "obj info from H5Oget_info1/2");
+
+ /* Close everything */
+ ret = H5Gclose(gid1);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Gclose(gid2);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Verify the object info returned to the callback function is correct */
+ ret = H5Ovisit1(fid, H5_INDEX_NAME, H5_ITER_INC, visit_obj_cb, NULL);
+
+ /* Close the file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+} /* test_h5o_getinfo_visit() */
+
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
-
/****************************************************************
**
** test_h5o(): Main H5O (generic object) testing routine.
@@ -1356,26 +1752,33 @@ 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_getinfo_same_file(); /* Test info for objects in the same file */
+ test_h5o_open(); /* Test generic open function */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ test_h5o_open_by_addr(); /* Test opening objects by address */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ test_h5o_open_by_token(); /* Test opening objects by token */
+ 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_open_by_addr_deprec(); /* Test opening objects by address with H5Lget_info1 */
+ test_h5o_getinfo_visit(); /* Test object info for H5Oget_info1/2 and H5Ovisit1 */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* 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 c63320a..bb84353 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: th5s
+* Test program: th5s
*
* Test the dataspace functionality
*
@@ -22,11 +22,25 @@
#include "testhdf5.h"
#include "H5srcdir.h"
-#include "H5private.h"
-#include "H5Bprivate.h"
-#include "H5Sprivate.h"
+#include "H5Iprivate.h"
#include "H5Pprivate.h"
+/*
+ * This file needs to access private information from the H5S package.
+ * This file also needs to access the dataspace testing code.
+ */
+#define H5S_FRIEND /*suppress error about including H5Spkg */
+#define H5S_TESTING /*suppress warning about H5S testing funcs*/
+#include "H5Spkg.h" /* Dataspaces */
+
+/*
+ * This file needs to access private information from the H5O package.
+ * This file also needs to access the dataspace testing code.
+ */
+#define H5O_FRIEND /*suppress error about including H5Opkg */
+#define H5O_TESTING
+#include "H5Opkg.h" /* Object header */
+
#define TESTFILE "th5s.h5"
#define DATAFILE "th5s1.h5"
#define NULLFILE "th5s2.h5"
@@ -43,31 +57,31 @@
#define EXTFILE_NAME "ext_file"
/* 3-D dataset with fixed dimensions */
-#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
/* 4-D dataset with one unlimited dimension */
-#define SPACE2_RANK 4
-#define SPACE2_DIM1 0
-#define SPACE2_DIM2 15
-#define SPACE2_DIM3 13
-#define SPACE2_DIM4 23
-#define SPACE2_MAX1 H5S_UNLIMITED
-#define SPACE2_MAX2 15
-#define SPACE2_MAX3 13
-#define SPACE2_MAX4 23
+#define SPACE2_RANK 4
+#define SPACE2_DIM1 0
+#define SPACE2_DIM2 15
+#define SPACE2_DIM3 13
+#define SPACE2_DIM4 23
+#define SPACE2_MAX1 H5S_UNLIMITED
+#define SPACE2_MAX2 15
+#define SPACE2_MAX3 13
+#define SPACE2_MAX4 23
/* Scalar dataset with simple datatype */
-#define SPACE3_RANK 0
+#define SPACE3_RANK 0
unsigned space3_data=65;
/* Scalar dataset with compound datatype */
-#define SPACE4_FIELDNAME1 "c1"
-#define SPACE4_FIELDNAME2 "u"
-#define SPACE4_FIELDNAME3 "f"
-#define SPACE4_FIELDNAME4 "c2"
+#define SPACE4_FIELDNAME1 "c1"
+#define SPACE4_FIELDNAME2 "u"
+#define SPACE4_FIELDNAME3 "f"
+#define SPACE4_FIELDNAME4 "c2"
size_t space4_field1_off=0;
size_t space4_field2_off=0;
size_t space4_field3_off=0;
@@ -77,7 +91,21 @@ struct space4_struct {
unsigned u;
float f;
char c2;
- } space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */
+} space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */
+
+/*
+ * Testing configuration defines used by:
+ * test_h5s_encode_regular_hyper()
+ * test_h5s_encode_irregular_hyper()
+ * test_h5s_encode_points()
+ */
+#define CONFIG_8 1
+#define CONFIG_16 2
+#define CONFIG_32 3
+#define POWER8 256 /* 2^8 */
+#define POWER16 65536 /* 2^16 */
+#define POWER32 4294967296 /* 2^32 */
+
/****************************************************************
**
@@ -87,21 +115,21 @@ struct space4_struct {
static void
test_h5s_basic(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t sid1, sid2; /* Dataspace ID */
- hid_t dset1; /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t sid1, sid2; /* Dataspace ID */
+ hid_t dset1; /* Dataset ID */
hid_t aid1; /* Attribute ID */
- int rank; /* Logical rank of dataspace */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3,
- SPACE2_DIM4};
- hsize_t dims3[H5S_MAX_RANK+1];
- hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3,
- SPACE2_MAX4};
- hsize_t tdims[4]; /* Dimension array to test with */
- hsize_t tmax[4];
- hssize_t n; /* Number of dataspace elements */
- herr_t ret; /* Generic return value */
+ int rank; /* Logical rank of dataspace */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3,
+ SPACE2_DIM4};
+ hsize_t dims3[H5S_MAX_RANK+1];
+ hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3,
+ SPACE2_MAX4};
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hsize_t tmax[4];
+ hssize_t n; /* Number of dataspace elements */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspace Manipulation\n"));
@@ -112,7 +140,7 @@ test_h5s_basic(void)
n = H5Sget_simple_extent_npoints(sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
- "H5Sget_simple_extent_npoints");
+ "H5Sget_simple_extent_npoints");
rank = H5Sget_simple_extent_ndims(sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
@@ -121,7 +149,7 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
sid2 = H5Screate_simple(SPACE2_RANK, dims2, max2);
CHECK(sid2, FAIL, "H5Screate_simple");
@@ -129,7 +157,7 @@ test_h5s_basic(void)
n = H5Sget_simple_extent_npoints(sid2);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4,
- "H5Sget_simple_extent_npoints");
+ "H5Sget_simple_extent_npoints");
rank = H5Sget_simple_extent_ndims(sid2);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
@@ -138,9 +166,9 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid2, tdims, tmax);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
/* Change max dims to be equal to the dimensions */
ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL);
@@ -148,9 +176,9 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid1, tdims, tmax);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
@@ -159,11 +187,11 @@ 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 {
- sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL);
+ sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL);
} H5E_END_TRY;
VERIFY(sid1, FAIL, "H5Screate_simple");
@@ -186,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 */
@@ -286,11 +314,11 @@ test_h5s_basic(void)
CHECK(ret, FAIL, "H5Sclose");
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_basic() */
+} /* test_h5s_basic() */
/****************************************************************
**
-** test_h5s_null(): Test NULL data space
+** test_h5s_null(): Test NULL dataspace
**
****************************************************************/
static void
@@ -346,16 +374,16 @@ test_h5s_null(void)
hsize_t start[1]={0};
hsize_t count[1]={0};
- 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");
/* Check to be sure we can't set a point selection on a null dataspace */
H5E_BEGIN_TRY {
- hsize_t coord[1][1]; /* Coordinates for point selection */
+ hsize_t coord[1][1]; /* Coordinates for point selection */
coord[0][0]=0;
- ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_elements");
@@ -432,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);
@@ -516,18 +544,18 @@ test_h5s_null(void)
static void
test_h5s_zero_dim(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t sid1, attr_sid; /* Dataspace ID */
- hid_t sid_chunk; /* Dataspace ID for chunked dataset */
- hid_t dset1; /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t sid1, attr_sid; /* Dataspace ID */
+ hid_t sid_chunk; /* Dataspace ID for chunked dataset */
+ hid_t dset1; /* Dataset ID */
hid_t plist_id; /* Dataset creation property list */
hid_t attr; /* Attribute ID */
- int rank; /* Logical rank of dataspace */
- hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ int rank; /* Logical rank of dataspace */
+ hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t chunk_dims[] = {SPACE1_DIM1, SPACE1_DIM2/3, SPACE1_DIM3};
- hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */
+ hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */
int wdata[SPACE1_DIM2][SPACE1_DIM3];
int rdata[SPACE1_DIM2][SPACE1_DIM3];
short wdata_short[SPACE1_DIM2][SPACE1_DIM3];
@@ -537,12 +565,12 @@ test_h5s_zero_dim(void)
int val = 3;
hsize_t start[] = {0, 0, 0};
hsize_t count[] = {3, 15, 13};
- hsize_t coord[1][3]; /* Coordinates for point selection */
+ hsize_t coord[1][3]; /* Coordinates for point selection */
hssize_t nelem; /* Number of elements */
H5S_sel_type sel_type; /* Type of selection currently */
H5S_class_t stype; /* dataspace type */
H5D_alloc_time_t alloc_time; /* Space allocation time */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
unsigned int i, j, k;
/* Output message about test being performed */
@@ -563,7 +591,7 @@ test_h5s_zero_dim(void)
wdata_real[i][j][k] = (int)(i + j + k);
/* Test with different space allocation times */
- for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; H5_INC_ENUM(H5D_alloc_time_t, alloc_time)) {
+ for(alloc_time = H5D_ALLOC_TIME_EARLY; alloc_time <= H5D_ALLOC_TIME_INCR; alloc_time++) {
/* Make sure we can create the space with the dimension size 0 (starting from v1.8.7).
* The dimension doesn't need to be unlimited. */
@@ -618,8 +646,8 @@ test_h5s_zero_dim(void)
CHECK(sid_chunk, FAIL, "H5Screate_simple");
/*============================================
- * Make sure we can use 0-dimension to create
- * contiguous, chunked, compact, and external
+ * Make sure we can use 0-dimension to create
+ * contiguous, chunked, compact, and external
* datasets, and also attribute.
*============================================
*/
@@ -655,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]);
}
}
@@ -677,13 +705,13 @@ 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]);
}
}
}
- /* Select a hyperslab beyond its current dimension sizes, then try to write
+ /* Select a hyperslab beyond its current dimension sizes, then try to write
* the data. It should fail. */
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -697,7 +725,7 @@ test_h5s_zero_dim(void)
ret = H5Sselect_none(sid1);
CHECK(ret, FAIL, "H5Sselect_none");
- /* Select a point beyond the dimension size, then try to write the data.
+ /* Select a point beyond the dimension size, then try to write the data.
* It should fail. */
coord[0][0]=2; coord[0][1]=5; coord[0][2]=3;
ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord);
@@ -744,13 +772,13 @@ 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]);
}
}
- /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure
- * we can write data to it */
+ /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure
+ * we can write data to it */
extend_dims[0] = SPACE1_DIM1;
ret = H5Dset_extent(dset1, extend_dims);
CHECK(ret, FAIL, "H5Dset_extent");
@@ -770,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]);
}
}
@@ -794,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]);
}
}
@@ -841,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]);
}
}
@@ -885,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]);
}
}
@@ -917,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]);
}
}
@@ -939,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]);
}
}
@@ -950,10 +978,10 @@ test_h5s_zero_dim(void)
CHECK(ret, FAIL, "H5Aclose");
/*===============================================================
- * Extend the dimension to make it a normal dataspace (3x15x13).
- * Verify that data can be written to and read from the chunked
- * dataset now.
- *===============================================================
+ * Extend the dimension to make it a normal dataspace (3x15x13).
+ * Verify that data can be written to and read from the chunked
+ * dataset now.
+ *===============================================================
*/
dims1[0]=SPACE1_DIM1;
ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims);
@@ -1001,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]);
}
}
@@ -1050,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);
@@ -1088,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]);
}
}
@@ -1126,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]);
}
}
@@ -1150,18 +1178,21 @@ test_h5s_zero_dim(void)
**
** test_h5s_encode(): Test H5S (dataspace) encoding and decoding.
**
+** Note: See "RFC: H5Sencode/H5Sdecode Format Change".
+**
****************************************************************/
static void
-test_h5s_encode(void)
+test_h5s_encode(H5F_libver_t low, H5F_libver_t high)
{
- hid_t sid1, sid2, sid3; /* Dataspace ID */
+ hid_t sid1, sid2, sid3; /* Dataspace ID */
hid_t decoded_sid1, decoded_sid2, decoded_sid3;
- int rank; /* Logical rank of dataspace */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ 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 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};
@@ -1169,8 +1200,8 @@ test_h5s_encode(void)
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 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"));
@@ -1179,26 +1210,40 @@ test_h5s_encode(void)
* Test encoding and decoding of simple dataspace and hyperslab selection.
*-------------------------------------------------------------------------
*/
+
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set low/high bounds in the fapl */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the dataspace */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Set the hyperslab selection */
ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* Encode simple data space in a buffer */
- ret = H5Sencode(sid1, NULL, &sbuf_size);
- CHECK(ret, FAIL, "H5Sencode");
+ /* Encode simple dataspace in a buffer with the fapl setting */
+ ret = H5Sencode2(sid1, NULL, &sbuf_size, fapl);
+ CHECK(ret, FAIL, "H5Sencode2");
- if(sbuf_size>0)
+ if(sbuf_size>0) {
sbuf = (unsigned char*)HDcalloc((size_t)1, sbuf_size);
+ CHECK(sbuf, NULL, "HDcalloc");
+ }
/* Try decoding bogus buffer */
H5E_BEGIN_TRY {
- ret_id = H5Sdecode(sbuf);
+ ret_id = H5Sdecode(sbuf);
} H5E_END_TRY;
VERIFY(ret_id, FAIL, "H5Sdecode");
- ret = H5Sencode(sid1, sbuf, &sbuf_size);
+ /* Encode the simple dataspace in a buffer with the fapl setting */
+ ret = H5Sencode2(sid1, sbuf, &sbuf_size, fapl);
CHECK(ret, FAIL, "H5Sencode");
/* Decode from the dataspace buffer and return an object handle */
@@ -1209,24 +1254,28 @@ test_h5s_encode(void)
n = H5Sget_simple_extent_npoints(decoded_sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
- "H5Sget_simple_extent_npoints");
+ "H5Sget_simple_extent_npoints");
+ /* Retrieve and verify the dataspace rank */
rank = H5Sget_simple_extent_ndims(decoded_sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims");
+ /* Retrieve and verify the dataspace dimensions */
rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
- /* Verify hyperslabe selection */
+ /* Verify the type of dataspace selection */
sel_type = H5Sget_select_type(decoded_sid1);
VERIFY(sel_type, H5S_SEL_HYPERSLABS, "H5Sget_select_type");
+ /* Verify the number of hyperslab blocks */
nblocks = H5Sget_select_hyper_nblocks(decoded_sid1);
VERIFY(nblocks, 2*2*2, "H5Sget_select_hyper_nblocks");
+ /* Close the dataspaces */
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
@@ -1240,24 +1289,28 @@ test_h5s_encode(void)
sid2 = H5Screate(H5S_NULL);
CHECK(sid2, FAIL, "H5Screate");
- /* Encode null data space in a buffer */
- ret = H5Sencode(sid2, NULL, &null_size);
+ /* Encode null dataspace in a buffer */
+ ret = H5Sencode2(sid2, NULL, &null_size, fapl);
CHECK(ret, FAIL, "H5Sencode");
- if(null_size>0)
+ if(null_size>0) {
null_sbuf = (unsigned char*)HDcalloc((size_t)1, null_size);
+ CHECK(null_sbuf, NULL, "HDcalloc");
+ }
- ret = H5Sencode(sid2, null_sbuf, &null_size);
- CHECK(ret, FAIL, "H5Sencode");
+ /* Encode the null dataspace in the buffer */
+ ret = H5Sencode2(sid2, null_sbuf, &null_size, fapl);
+ CHECK(ret, FAIL, "H5Sencode2");
/* Decode from the dataspace buffer and return an object handle */
decoded_sid2=H5Sdecode(null_sbuf);
CHECK(decoded_sid2, FAIL, "H5Sdecode");
- /* Verify decoded dataspace */
+ /* Verify the decoded dataspace type */
space_type = H5Sget_simple_extent_type(decoded_sid2);
VERIFY(space_type, H5S_NULL, "H5Sget_simple_extent_type");
+ /* Close the dataspaces */
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
@@ -1272,17 +1325,212 @@ test_h5s_encode(void)
sid3 = H5Screate(H5S_SCALAR);
CHECK(sid3, FAIL, "H5Screate_simple");
- /* Encode scalar data space in a buffer */
- ret = H5Sencode(sid3, NULL, &scalar_size);
+ /* Encode scalar dataspace in a buffer */
+ ret = H5Sencode2(sid3, NULL, &scalar_size, fapl);
CHECK(ret, FAIL, "H5Sencode");
- if(scalar_size>0)
+ if(scalar_size>0) {
scalar_buf = (unsigned char*)HDcalloc((size_t)1, scalar_size);
+ CHECK(scalar_buf, NULL, "HDcalloc");
+ }
+
+ /* Encode the scalar dataspace in the buffer */
+ ret = H5Sencode2(sid3, scalar_buf, &scalar_size, fapl);
+ CHECK(ret, FAIL, "H5Sencode2");
+
+ /* Decode from the dataspace buffer and return an object handle */
+ decoded_sid3=H5Sdecode(scalar_buf);
+ CHECK(decoded_sid3, FAIL, "H5Sdecode");
+
+ /* Verify extent type */
+ space_type = H5Sget_simple_extent_type(decoded_sid3);
+ VERIFY(space_type, H5S_SCALAR, "H5Sget_simple_extent_type");
+
+ /* Verify decoded dataspace */
+ n = H5Sget_simple_extent_npoints(decoded_sid3);
+ CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
+ VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+
+ /* Retrieve and verify the dataspace rank */
+ rank = H5Sget_simple_extent_ndims(decoded_sid3);
+ CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
+ VERIFY(rank, 0, "H5Sget_simple_extent_ndims");
- ret = H5Sencode(sid3, scalar_buf, &scalar_size);
+ /* Close the dataspaces */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Sclose(decoded_sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close the file access property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Release resources */
+ if(sbuf)
+ HDfree(sbuf);
+ if(null_sbuf)
+ HDfree(null_sbuf);
+ if(scalar_buf)
+ HDfree(scalar_buf);
+} /* test_h5s_encode() */
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+
+/****************************************************************
+**
+** test_h5s_encode(): Test H5S (dataspace) encoding and decoding.
+**
+****************************************************************/
+static void
+test_h5s_encode1(void)
+{
+ hid_t sid1, sid2, sid3; /* Dataspace ID */
+ hid_t decoded_sid1, decoded_sid2, decoded_sid3;
+ int rank; /* Logical rank of dataspace */
+ 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 (H5Sencode1) and Decoding\n"));
+
+ /*-------------------------------------------------------------------------
+ * Test encoding and decoding of simple dataspace and hyperslab selection.
+ *-------------------------------------------------------------------------
+ */
+ /* Create the dataspace */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Encode simple dataspace in a buffer with the fapl setting */
+ ret = H5Sencode1(sid1, NULL, &sbuf_size);
+ CHECK(ret, FAIL, "H5Sencode2");
+
+ if(sbuf_size>0) {
+ sbuf = (unsigned char*)HDcalloc((size_t)1, sbuf_size);
+ CHECK(sbuf, NULL, "HDcalloc");
+ }
+
+ /* Try decoding bogus buffer */
+ H5E_BEGIN_TRY {
+ ret_id = H5Sdecode(sbuf);
+ } H5E_END_TRY;
+ VERIFY(ret_id, FAIL, "H5Sdecode");
+
+ /* Encode the simple dataspace in a buffer */
+ ret = H5Sencode1(sid1, sbuf, &sbuf_size);
CHECK(ret, FAIL, "H5Sencode");
/* Decode from the dataspace buffer and return an object handle */
+ decoded_sid1=H5Sdecode(sbuf);
+ CHECK(decoded_sid1, FAIL, "H5Sdecode");
+
+ /* Verify the decoded dataspace */
+ n = H5Sget_simple_extent_npoints(decoded_sid1);
+ CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
+ VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
+ "H5Sget_simple_extent_npoints");
+
+ /* Retrieve and verify the dataspace rank */
+ rank = H5Sget_simple_extent_ndims(decoded_sid1);
+ CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
+ VERIFY(rank, SPACE1_RANK, "H5Sget_simple_extent_ndims");
+
+ /* Retrieve and verify the dataspace dimensions */
+ rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL);
+ CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
+ VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
+ "H5Sget_simple_extent_dims");
+
+ /* Verify the type of dataspace selection */
+ sel_type = H5Sget_select_type(decoded_sid1);
+ VERIFY(sel_type, H5S_SEL_HYPERSLABS, "H5Sget_select_type");
+
+ /* Verify the number of hyperslab blocks */
+ nblocks = H5Sget_select_hyper_nblocks(decoded_sid1);
+ VERIFY(nblocks, 2*2*2, "H5Sget_select_hyper_nblocks");
+
+ /* Close the dataspaces */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Sclose(decoded_sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /*-------------------------------------------------------------------------
+ * Test encoding and decoding of null dataspace.
+ *-------------------------------------------------------------------------
+ */
+ sid2 = H5Screate(H5S_NULL);
+ CHECK(sid2, FAIL, "H5Screate");
+
+ /* Encode null dataspace in a buffer */
+ ret = H5Sencode1(sid2, NULL, &null_size);
+ CHECK(ret, FAIL, "H5Sencode");
+
+ if(null_size>0) {
+ null_sbuf = (unsigned char*)HDcalloc((size_t)1, null_size);
+ CHECK(null_sbuf, NULL, "HDcalloc");
+ }
+
+ /* Encode the null dataspace in the buffer */
+ ret = H5Sencode1(sid2, null_sbuf, &null_size);
+ CHECK(ret, FAIL, "H5Sencode2");
+
+ /* Decode from the dataspace buffer and return an object handle */
+ decoded_sid2=H5Sdecode(null_sbuf);
+ CHECK(decoded_sid2, FAIL, "H5Sdecode");
+
+ /* Verify the decoded dataspace type */
+ space_type = H5Sget_simple_extent_type(decoded_sid2);
+ VERIFY(space_type, H5S_NULL, "H5Sget_simple_extent_type");
+
+ /* Close the dataspaces */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Sclose(decoded_sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /*-------------------------------------------------------------------------
+ * Test encoding and decoding of scalar dataspace.
+ *-------------------------------------------------------------------------
+ */
+ /* Create scalar dataspace */
+ sid3 = H5Screate(H5S_SCALAR);
+ CHECK(sid3, FAIL, "H5Screate");
+
+ /* Encode scalar dataspace in a buffer */
+ ret = H5Sencode1(sid3, NULL, &scalar_size);
+ CHECK(ret, FAIL, "H5Sencode");
+
+ if(scalar_size>0) {
+ scalar_buf = (unsigned char*)HDcalloc((size_t)1, scalar_size);
+ CHECK(scalar_buf, NULL, "HDcalloc");
+ }
+
+ /* Encode the scalar dataspace in the buffer */
+ ret = H5Sencode1(sid3, scalar_buf, &scalar_size);
+ CHECK(ret, FAIL, "H5Sencode2");
+
+ /* Decode from the dataspace buffer and return an object handle */
decoded_sid3=H5Sdecode(scalar_buf);
CHECK(decoded_sid3, FAIL, "H5Sdecode");
@@ -1295,20 +1543,629 @@ test_h5s_encode(void)
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+ /* Retrieve and verify the dataspace rank */
rank = H5Sget_simple_extent_ndims(decoded_sid3);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, 0, "H5Sget_simple_extent_ndims");
+ /* Close the dataspaces */
ret = H5Sclose(sid3);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Sclose(decoded_sid3);
CHECK(ret, FAIL, "H5Sclose");
- HDfree(sbuf);
- HDfree(null_sbuf);
- HDfree(scalar_buf);
-} /* test_h5s_encode() */
+ /* Release resources */
+ if(sbuf)
+ HDfree(sbuf);
+ if(null_sbuf)
+ HDfree(null_sbuf);
+ if(scalar_buf)
+ HDfree(scalar_buf);
+} /* test_h5s_encode1() */
+
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+
+/****************************************************************
+**
+** test_h5s_check_encoding():
+** This is the helper routine to verify that H5Sencode2()
+** works as specified in the RFC for the library format setting
+** in the file access property list.
+** See "RFC: H5Sencode/H5Sdeocde Format Change".
+**
+** This routine is used by:
+** test_h5s_encode_regular_hyper()
+** test_h5s_encode_irregular_hyper()
+** test_h5s_encode_points()
+**
+****************************************************************/
+static herr_t
+test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid,
+ uint32_t expected_version, uint8_t expected_enc_size, hbool_t expected_to_fail)
+{
+ char *buf = NULL; /* Pointer to the encoded buffer */
+ size_t buf_size; /* Size of the encoded buffer */
+ hid_t d_sid = -1; /* The decoded dataspace ID */
+ htri_t check;
+ hsize_t in_low_bounds[1]; /* The low bounds for the selection for in_sid */
+ hsize_t in_high_bounds[1]; /* The high bounds for the selection for in_sid */
+ hsize_t d_low_bounds[1]; /* The low bounds for the selection for d_sid */
+ hsize_t d_high_bounds[1]; /* The high bounds for the selection for d_sid */
+ herr_t ret; /* Return value */
+
+ /* Get buffer size for encoding with the format setting in in_fapl */
+ H5E_BEGIN_TRY {
+ ret = H5Sencode2(in_sid, NULL, &buf_size, in_fapl);
+ } H5E_END_TRY
+
+ if(expected_to_fail) {
+ VERIFY(ret, FAIL, "H5Screate_simple");
+ } else {
+
+ CHECK(ret, FAIL, "H5Sencode2");
+
+ /* Allocate the buffer for encoding */
+ buf = (char *)HDmalloc(buf_size);
+ CHECK(buf, NULL, "H5Dmalloc");
+
+ /* Encode according to the setting in in_fapl */
+ ret = H5Sencode2(in_sid, buf, &buf_size, in_fapl);
+ CHECK(ret, FAIL, "H5Sencode2");
+
+ /* Decode the buffer */
+ d_sid = H5Sdecode(buf);
+ CHECK(d_sid, FAIL, "H5Sdecode");
+
+ /* Verify the number of selected points for in_sid and d_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 = 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);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ ret = H5Sget_select_bounds(d_sid, d_low_bounds, d_high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(in_low_bounds[0], d_low_bounds[0], "Compare selection low bounds");
+ VERIFY(in_high_bounds[0], d_high_bounds[0], "Compare selection high bounds");
+
+ /*
+ * See "RFC: H5Sencode/H5Sdeocde Format Change" for the verification of:
+ * H5S_SEL_POINTS:
+ * --the expected version for point selection info
+ * --the expected encoded size (version 2 points selection info)
+ * H5S_SEL_HYPERSLABS:
+ * --the expected version for hyperslab selection info
+ * --the expected encoded size (version 3 hyperslab selection info)
+ */
+
+ if(H5Sget_select_type(in_sid) == H5S_SEL_POINTS) {
+
+ /* Verify the version */
+ VERIFY((uint32_t)buf[35], expected_version, "Version for point selection");
+
+ /* Verify the encoded size for version 2 */
+ if(expected_version == 2)
+ VERIFY((uint8_t)buf[39], expected_enc_size, "Encoded size of point selection info");
+ }
+
+ if(H5Sget_select_type(in_sid) == H5S_SEL_HYPERSLABS) {
+
+ /* Verify the version */
+ VERIFY((uint32_t)buf[35], expected_version, "Version for hyperslab selection info");
+
+ /* Verify the encoded size for version 3 */
+ if(expected_version == 3)
+ VERIFY((uint8_t)buf[40], expected_enc_size, "Encoded size of selection info");
+
+ } /* hyperslab selection */
+
+ ret = H5Sclose(d_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ if(buf)
+ HDfree(buf);
+
+ }
+
+ return(0);
+
+} /* test_h5s_check_encoding */
+
+/****************************************************************
+**
+** test_h5s_encode_regular_hyper():
+** This test verifies that H5Sencode2() works as specified in
+** the RFC for regular hyperslabs.
+** See "RFC: H5Sencode/H5Sdeocde Format Change".
+**
+****************************************************************/
+static void
+test_h5s_encode_regular_hyper(H5F_libver_t low, H5F_libver_t high)
+{
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t sid = -1; /* Dataspace ID */
+ hsize_t numparticles = 8388608; /* Used to calculate dimension size */
+ unsigned num_dsets = 513; /* Used to calculate dimension size */
+ hsize_t total_particles = numparticles * num_dsets;
+ hsize_t vdsdims[1] = {total_particles}; /* Dimension size */
+ hsize_t start, stride, count, block; /* Selection info */
+ unsigned config; /* Testing configuration */
+ unsigned unlim; /* H5S_UNLIMITED setting or not */
+ herr_t ret; /* Generic return value */
+ uint32_t expected_version = 0; /* Expected version for selection info */
+ uint8_t expected_enc_size = 0; /* Expected encoded size for selection info */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Dataspace encoding of regular hyperslabs\n"));
+
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set the low/high bounds in the fapl */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the dataspace */
+ sid = H5Screate_simple(1, vdsdims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Testing with each configuration */
+ for(config = CONFIG_16; config <= CONFIG_32; config++) {
+ hbool_t expected_to_fail = FALSE;
+
+ /* Testing with unlimited or not */
+ for(unlim = 0; unlim <= 1; unlim++) {
+ start = 0;
+ count = unlim? H5S_UNLIMITED : 2;
+
+ if((high <= H5F_LIBVER_V18) &&
+ (unlim || config == CONFIG_32))
+ expected_to_fail = TRUE;
+
+ if(low >= H5F_LIBVER_V112)
+ expected_version = 3;
+ else if(config == CONFIG_16 && !unlim)
+ expected_version = 1;
+ else
+ expected_version = 2;
+
+ /* test 1 */
+ switch(config) {
+ case CONFIG_16:
+ stride = POWER16 - 1;
+ block = 4;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 2 : 4);
+ break;
+ case CONFIG_32:
+ stride = POWER32 - 1;
+ block = 4;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8);
+
+ break;
+ default:
+ HDassert(0);
+ break;
+ } /* end switch */
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Verify the version and encoded size expected for this configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* test 2 */
+ switch(config) {
+ case CONFIG_16:
+ stride = POWER16 - 1;
+ block = POWER16 - 2;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 2 : 4);
+ break;
+ case CONFIG_32:
+ stride = POWER32 - 1;
+ block = POWER32 - 2;
+ expected_enc_size = (uint8_t)(expected_version == 3 ? 4 : 8);
+ break;
+ default:
+ HDassert(0);
+ break;
+ } /* end switch */
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Verify the version and encoded size for this configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* test 3 */
+ switch(config) {
+ case CONFIG_16:
+ stride = POWER16 - 1;
+ block = POWER16 - 1;
+ expected_enc_size = 4;
+ break;
+ case CONFIG_32:
+ stride = POWER32 - 1;
+ block = POWER32 - 1;
+ expected_enc_size = 8;
+ break;
+ default:
+ HDassert(0);
+ break;
+ }
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Verify the version and encoded size expected for this configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* test 4 */
+ switch(config) {
+ case CONFIG_16:
+ stride = POWER16;
+ block = POWER16 - 2;
+ expected_enc_size = 4;
+ break;
+ case CONFIG_32:
+ stride = POWER32;
+ block = POWER32 - 2;
+ expected_enc_size = 8;
+ break;
+ default:
+ HDassert(0);
+ break;
+ } /* end switch */
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Verify the version and encoded size expected for this configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* test 5 */
+ switch(config) {
+ case CONFIG_16:
+ stride = POWER16;
+ block = 1;
+ expected_enc_size = 4;
+ break;
+ case CONFIG_32:
+ stride = POWER32;
+ block = 1;
+ expected_enc_size = 8;
+ break;
+ default:
+ HDassert(0);
+ break;
+ }
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Verify the version and encoded size expected for this configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ } /* for unlim */
+ } /* for config */
+
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+} /* test_h5s_encode_regular_hyper() */
+
+/****************************************************************
+**
+** test_h5s_encode_irregular_hyper():
+** This test verifies that H5Sencode2() works as specified in
+** the RFC for irregular hyperslabs.
+** See "RFC: H5Sencode/H5Sdeocde Format Change".
+**
+****************************************************************/
+static void
+test_h5s_encode_irregular_hyper(H5F_libver_t low, H5F_libver_t high)
+{
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t sid; /* Dataspace ID */
+ hsize_t numparticles = 8388608; /* Used to calculate dimension size */
+ unsigned num_dsets = 513; /* Used to calculate dimension size */
+ hsize_t total_particles = numparticles * num_dsets;
+ hsize_t vdsdims[1] = {total_particles}; /* Dimension size */
+ hsize_t start, stride, count, block; /* Selection info */
+ htri_t is_regular; /* Is this a regular hyperslab */
+ unsigned config; /* Testing configuration */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Dataspace encoding of irregular hyperslabs\n"));
+
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set the low/high bounds in the fapl */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the dataspace */
+ sid = H5Screate_simple(1, vdsdims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Testing with each configuration */
+ for(config = CONFIG_8; config <= CONFIG_32; config++) {
+ hbool_t expected_to_fail = FALSE; /* Whether H5Sencode2 is expected to fail */
+ uint32_t expected_version = 0; /* Expected version for selection info */
+ uint32_t expected_enc_size = 0; /* Expected encoded size for selection info */
+
+ start = 0;
+ count = 2;
+ block = 4;
+
+ /* H5Sencode2 is expected to fail for library v110 and below
+ when the selection exceeds the 32 bits integer limit */
+ if(high <= H5F_LIBVER_V110 && config == CONFIG_32)
+ expected_to_fail = TRUE;
+
+ if(low >= H5F_LIBVER_V112 || config == CONFIG_32)
+ expected_version = 3;
+ else
+ expected_version = 1;
+
+ switch(config) {
+ case CONFIG_8:
+ stride = POWER8 - 2;
+ break;
+
+ case CONFIG_16:
+ stride = POWER16 - 2;
+ break;
+
+ case CONFIG_32:
+ stride = POWER32 - 2;
+ break;
+
+ default:
+ HDassert(0);
+ break;
+ }
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ start = 8;
+ count = 5;
+ block = 2;
+
+ switch(config) {
+ case CONFIG_8:
+ stride = POWER8;
+ expected_enc_size = expected_version == 3 ? 2 : 4;
+ break;
+
+ case CONFIG_16:
+ stride = POWER16;
+ expected_enc_size = 4;
+ break;
+
+ case CONFIG_32:
+ stride = POWER32;
+ expected_enc_size = 8;
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Should be irregular hyperslab */
+ is_regular = H5Sis_regular_hyperslab(sid);
+ VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab");
+
+ /* Verify the version and encoded size expected for the configuration */
+ HDassert(expected_enc_size <= 255);
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, (uint8_t)expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ } /* for config */
+
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+} /* test_h5s_encode_irregular_hyper() */
+
+/****************************************************************
+**
+** test_h5s_encode_points():
+** This test verifies that H5Sencode2() works as specified in
+** the RFC for point selection.
+** See "RFC: H5Sencode/H5Sdeocde Format Change".
+**
+****************************************************************/
+static void
+test_h5s_encode_points(H5F_libver_t low, H5F_libver_t high)
+{
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t sid; /* Dataspace ID */
+ hsize_t numparticles = 8388608; /* Used to calculate dimenion size */
+ unsigned num_dsets = 513; /* used to calculate dimension size */
+ hsize_t total_particles = numparticles * num_dsets;
+ hsize_t vdsdims[1] = {total_particles}; /* Dimension size */
+ hsize_t coord[4]; /* The point coordinates */
+ herr_t ret; /* Generic return value */
+ hbool_t expected_to_fail = FALSE; /* Expected to fail or not */
+ uint32_t expected_version = 0; /* Expected version for selection info */
+ uint8_t expected_enc_size = 0; /* Expected encoded size of selection info */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Dataspace encoding of points selection\n"));
+
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set the low/high bounds in the fapl */
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the dataspace */
+ sid = H5Screate_simple(1, vdsdims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* test 1 */
+ coord[0] = 5;
+ coord[1] = 15;
+ coord[2] = POWER16;
+ coord[3] = 19;
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)4, coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ expected_to_fail = FALSE;
+ expected_enc_size = 4;
+ expected_version = 1;
+
+ if(low >= H5F_LIBVER_V112)
+ expected_version = 2;
+
+ /* Verify the version and encoded size expected for the configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* test 2 */
+ coord[0] = 5;
+ coord[1] = 15;
+ coord[2] = POWER32 - 1;
+ coord[3] = 19;
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)4, coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Expected result same as test 1 */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* test 3 */
+ if(high <= H5F_LIBVER_V110)
+ expected_to_fail = TRUE;
+
+ if(high >= H5F_LIBVER_V112) {
+ expected_version = 2;
+ expected_enc_size = 8;
+ }
+
+ coord[0] = 5;
+ coord[1] = 15;
+ coord[2] = POWER32 + 1;
+ coord[3] = 19;
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)4, coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Verify the version and encoded size expected for the configuration */
+ ret = test_h5s_check_encoding(fapl, sid, expected_version, expected_enc_size, expected_to_fail);
+ CHECK(ret, FAIL, "test_h5s_check_encoding");
+
+ /* Close the dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+} /* test_h5s_encode_points() */
+
+/****************************************************************
+**
+** test_h5s_encode_length():
+** Test to verify HDFFV-10271 is fixed.
+** Verify that version 2 hyperslab encoding length is correct.
+**
+** See "RFC: H5Sencode/H5Sdecode Format Change" for the
+** description of the encoding format.
+**
+****************************************************************/
+static void
+test_h5s_encode_length(void)
+{
+ hid_t sid; /* Dataspace ID */
+ hid_t decoded_sid; /* Dataspace ID from H5Sdecode2 */
+ size_t sbuf_size=0; /* Buffer size for H5Sencode2/1 */
+ unsigned char *sbuf=NULL; /* Buffer for H5Sencode2/1 */
+ hsize_t dims[1] = {500}; /* Dimension size */
+ hsize_t start, count, block, stride; /* Hyperslab selection specifications */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Version 2 Hyperslab Encoding Length is correct\n"));
+
+ /* Create dataspace */
+ sid = H5Screate_simple(1, dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Setting H5S_UNLIMITED in count will use version 2 for hyperslab encoding */
+ start = 0;
+ stride = 10;
+ block = 4;
+ count = H5S_UNLIMITED;
+
+ /* Set hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, &start, &stride, &count, &block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Encode simple dataspace in a buffer */
+ ret = H5Sencode2(sid, NULL, &sbuf_size, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Sencode");
+
+ /* Allocate the buffer */
+ if(sbuf_size > 0) {
+ sbuf = (unsigned char*)HDcalloc((size_t)1, sbuf_size);
+ CHECK(sbuf, NULL, "H5Sencode2");
+ }
+
+ /* Encode the dataspace */
+ ret = H5Sencode2(sid, sbuf, &sbuf_size, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Sencode");
+
+ /* Verify that length stored at this location in the buffer is correct */
+ VERIFY((uint32_t)sbuf[40], 36, "Length for encoding version 2");
+ VERIFY((uint32_t)sbuf[35], 2, "Hyperslab encoding version is 2");
+
+ /* Decode from the dataspace buffer and return an object handle */
+ decoded_sid = H5Sdecode(sbuf);
+ CHECK(decoded_sid, FAIL, "H5Sdecode");
+
+ /* Verify that the original and the decoded dataspace are equal */
+ VERIFY(H5Sget_select_npoints(sid), H5Sget_select_npoints(decoded_sid), "Compare npoints");
+
+ /* Close the decoded dataspace */
+ ret = H5Sclose(decoded_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Free the buffer */
+ if(sbuf)
+ HDfree(sbuf);
+
+ /* Close the original dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+} /* test_h5s_encode_length() */
/****************************************************************
**
@@ -1318,14 +2175,14 @@ test_h5s_encode(void)
static void
test_h5s_scalar_write(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- H5S_class_t ext_type; /* Extent type */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ H5S_class_t ext_type; /* Extent type */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n"));
@@ -1344,14 +2201,17 @@ test_h5s_scalar_write(void)
sid1 = H5Screate_simple(SPACE3_RANK, NULL, NULL);
CHECK(sid1, FAIL, "H5Screate_simple");
+ /* Retrieve the number of elements in the dataspace selection */
n = H5Sget_simple_extent_npoints(sid1);
CHECK(n, FAIL, "H5Sget_simple_extent_npoints");
VERIFY(n, 1, "H5Sget_simple_extent_npoints");
+ /* Get the dataspace rank */
rank = H5Sget_simple_extent_ndims(sid1);
CHECK(rank, FAIL, "H5Sget_simple_extent_ndims");
VERIFY(rank, SPACE3_RANK, "H5Sget_simple_extent_ndims");
+ /* Get the dataspace dimension sizes */
rank = H5Sget_simple_extent_dims(sid1, tdims, NULL);
VERIFY(rank, 0, "H5Sget_simple_extent_dims");
@@ -1363,6 +2223,7 @@ test_h5s_scalar_write(void)
dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
+ /* Write to the dataset */
ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data);
CHECK(ret, FAIL, "H5Dwrite");
@@ -1377,7 +2238,7 @@ test_h5s_scalar_write(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_scalar_write() */
+} /* test_h5s_scalar_write() */
/****************************************************************
**
@@ -1387,14 +2248,14 @@ test_h5s_scalar_write(void)
static void
test_h5s_scalar_read(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- unsigned rdata; /* Scalar data read in */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ unsigned rdata; /* Scalar data read in */
+ herr_t ret; /* Generic return value */
H5S_class_t ext_type; /* Extent type */
/* Output message about test being performed */
@@ -1441,7 +2302,7 @@ test_h5s_scalar_read(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_scalar_read() */
+} /* test_h5s_scalar_read() */
/****************************************************************
**
@@ -1452,14 +2313,14 @@ test_h5s_scalar_read(void)
static void
test_h5s_compound_scalar_write(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t tid1; /* Attribute datatype ID */
- hid_t sid1; /* Dataspace ID */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t tid1; /* Attribute datatype ID */
+ hid_t sid1; /* Dataspace ID */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Writing Compound Datatypes\n"));
@@ -1473,19 +2334,19 @@ test_h5s_compound_scalar_write(void)
CHECK(tid1, FAIL, "H5Tcreate");
space4_field1_off=HOFFSET(struct space4_struct, c1);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off,
- H5T_NATIVE_SCHAR);
+ H5T_NATIVE_SCHAR);
CHECK(ret, FAIL, "H5Tinsert");
space4_field2_off=HOFFSET(struct space4_struct, u);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off,
- H5T_NATIVE_UINT);
+ H5T_NATIVE_UINT);
CHECK(ret, FAIL, "H5Tinsert");
space4_field3_off=HOFFSET(struct space4_struct, f);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off,
- H5T_NATIVE_FLOAT);
+ H5T_NATIVE_FLOAT);
CHECK(ret, FAIL, "H5Tinsert");
space4_field4_off=HOFFSET(struct space4_struct, c2);
ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off,
- H5T_NATIVE_SCHAR);
+ H5T_NATIVE_SCHAR);
CHECK(ret, FAIL, "H5Tinsert");
/* Create scalar dataspace */
@@ -1525,7 +2386,7 @@ test_h5s_compound_scalar_write(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_compound_scalar_write() */
+} /* test_h5s_compound_scalar_write() */
/****************************************************************
**
@@ -1536,15 +2397,15 @@ test_h5s_compound_scalar_write(void)
static void
test_h5s_compound_scalar_read(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t type; /* Datatype */
- int rank; /* Logical rank of dataspace */
- hsize_t tdims[4]; /* Dimension array to test with */
- hssize_t n; /* Number of dataspace elements */
- struct space4_struct rdata; /* Scalar data read in */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t type; /* Datatype */
+ int rank; /* Logical rank of dataspace */
+ hsize_t tdims[4]; /* Dimension array to test with */
+ hssize_t n; /* Number of dataspace elements */
+ struct space4_struct rdata; /* Scalar data read in */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Reading Compound Datatypes\n"));
@@ -1577,9 +2438,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 */
@@ -1598,11 +2459,12 @@ test_h5s_compound_scalar_read(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_h5s_compound_scalar_read() */
+} /* end test_h5s_compound_scalar_read() */
+
-/* Data arrays for chunk test */
-double chunk_data_dbl[50000][3];
-float chunk_data_flt[50000][3];
+/* Data array sizes for chunk test */
+#define CHUNK_DATA_NX 50000
+#define CHUNK_DATA_NY 3
/****************************************************************
**
@@ -1620,22 +2482,41 @@ test_h5s_chunk(void)
hid_t space_id;
hsize_t dims[2];
hsize_t csize[2];
+ double **chunk_data_dbl = NULL;
+ double *chunk_data_dbl_data = NULL;
+ float **chunk_data_flt = NULL;
+ float *chunk_data_flt_data = NULL;
int i,j;
+ /* Allocate memory */
+ chunk_data_dbl_data = (double *)HDcalloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(double));
+ CHECK_PTR(chunk_data_dbl_data, "HDcalloc");
+ chunk_data_dbl = (double **)HDcalloc(CHUNK_DATA_NX, sizeof(chunk_data_dbl_data));
+ CHECK_PTR(chunk_data_dbl, "HDcalloc");
+ for (i = 0; i < CHUNK_DATA_NX; i++)
+ chunk_data_dbl[i] = chunk_data_dbl_data + (i * CHUNK_DATA_NY);
+
+ chunk_data_flt_data = (float *)HDcalloc(CHUNK_DATA_NX * CHUNK_DATA_NY, sizeof(float));
+ CHECK_PTR(chunk_data_flt_data, "HDcalloc");
+ chunk_data_flt = (float **)HDcalloc(CHUNK_DATA_NX, sizeof(chunk_data_flt_data));
+ CHECK_PTR(chunk_data_flt, "HDcalloc");
+ for (i = 0; i < CHUNK_DATA_NX; i++)
+ chunk_data_flt[i] = chunk_data_flt_data + (i * CHUNK_DATA_NY);
+
fileID = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fileID, FAIL, "H5Fcreate");
plist_id = H5Pcreate(H5P_DATASET_CREATE);
CHECK(plist_id, FAIL, "H5Pcreate");
- csize[0] = 50000;
- csize[1] = 3;
+ csize[0] = CHUNK_DATA_NX;
+ csize[1] = CHUNK_DATA_NY;
status = H5Pset_chunk(plist_id, 2, csize);
CHECK(status, FAIL, "H5Pset_chunk");
- /* Create the data space */
- dims[0] = 50000;
- dims[1] = 3;
+ /* Create the dataspace */
+ dims[0] = CHUNK_DATA_NX;
+ dims[1] = CHUNK_DATA_NY;
space_id = H5Screate_simple(2, dims, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
@@ -1643,11 +2524,11 @@ test_h5s_chunk(void)
CHECK(dsetID, FAIL, "H5Dcreate2");
/* Initialize float array */
- for(i = 0; i < 50000; i++)
- for(j = 0; j < 3; j++)
+ for(i = 0; i < CHUNK_DATA_NX; i++)
+ for(j = 0; j < CHUNK_DATA_NY; j++)
chunk_data_flt[i][j] = (float)(i + 1) * 2.5F - (float)j * 100.3F;
- status = H5Dwrite(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt);
+ status = H5Dwrite(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt_data);
CHECK(status, FAIL, "H5Dwrite");
status = H5Pclose(plist_id);
@@ -1660,17 +2541,17 @@ test_h5s_chunk(void)
CHECK(status, FAIL, "H5Fclose");
/* Reset/initialize the data arrays to read in */
- HDmemset(chunk_data_dbl, 0, sizeof(double) * 50000 * 3);
- HDmemset(chunk_data_flt, 0, sizeof(float) * 50000 * 3);
+ HDmemset(chunk_data_dbl_data, 0, sizeof(double) * CHUNK_DATA_NX * CHUNK_DATA_NY);
+ HDmemset(chunk_data_flt_data, 0, sizeof(float) * CHUNK_DATA_NX * CHUNK_DATA_NY);
fileID = H5Fopen(DATAFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fileID, FAIL, "H5Fopen");
dsetID = H5Dopen2(fileID, "coords", H5P_DEFAULT);
CHECK(dsetID, FAIL, "H5Dopen2");
- status= H5Dread(dsetID, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_dbl);
+ status= H5Dread(dsetID, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_dbl_data);
CHECK(status, FAIL, "H5Dread");
- status= H5Dread(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt);
+ status= H5Dread(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt_data);
CHECK(status, FAIL, "H5Dread");
status = H5Dclose(dsetID);
@@ -1678,13 +2559,18 @@ test_h5s_chunk(void)
status = H5Fclose(fileID);
CHECK(status, FAIL, "H5Fclose");
- for(i=0; i<50000; i++) {
- for(j=0; j<3; j++) {
+ for(i = 0; i < CHUNK_DATA_NX; i++) {
+ for(j = 0; j < CHUNK_DATA_NY; j++) {
/* Check if the two values are within 0.001% range. */
if(!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], (double)chunk_data_flt[i][j], (double)0.00001F))
TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, (double)chunk_data_flt[i][j]);
} /* end for */
} /* end for */
+
+ HDfree(chunk_data_dbl);
+ HDfree(chunk_data_dbl_data);
+ HDfree(chunk_data_flt);
+ HDfree(chunk_data_flt_data);
} /* test_h5s_chunk() */
/****************************************************************
@@ -2364,6 +3250,130 @@ test_h5s_bug1(void)
CHECK(ret, FAIL, "H5Sclose");
} /* test_h5s_bug1() */
+
+/*-------------------------------------------------------------------------
+ * Function: test_versionbounds
+ *
+ * Purpose: Tests version bounds with dataspace.
+ *
+ * Description:
+ * This function creates a file with lower bounds then later
+ * reopens it with higher bounds to show that the dataspace
+ * version is upgraded appropriately.
+ *
+ * Return: Success: 0
+ * Failure: number of errors
+ *
+ *-------------------------------------------------------------------------
+ */
+#define VERBFNAME "tverbounds_dspace.h5"
+#define BASIC_DSET "Basic Dataset"
+#define LATEST_DSET "Latest Dataset"
+static void
+test_versionbounds(void)
+{
+ hid_t file = -1; /* File ID */
+ hid_t space = -1; /* Dataspace ID */
+ hid_t dset = -1; /* Dataset ID */
+ hid_t fapl = -1; /* File access property list ID */
+ hid_t dset_space = -1; /* Retrieved dataset's dataspace ID */
+ hsize_t dim[1]; /* Dataset dimensions */
+ H5F_libver_t low, high; /* File format bounds */
+ H5S_t *spacep = NULL; /* Pointer to internal dataspace */
+ herr_t ret = 0; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Version Bounds\n"));
+
+ /* Create a file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Create dataspace */
+ dim[0] = 10;
+ space = H5Screate_simple(1, dim, NULL);
+ CHECK(space, FAIL, "H5Screate");
+
+ /* Its version should be H5O_SDSPACE_VERSION_1 */
+ spacep = (H5S_t *)H5I_object(space);
+ CHECK(spacep, NULL, "H5I_object");
+ VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound");
+
+ /* Set high bound to V18 */
+ low = H5F_LIBVER_EARLIEST;
+ high = H5F_LIBVER_V18;
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create the file */
+ file = H5Fcreate(VERBFNAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(file, FAIL, "H5Fcreate");
+
+ /* Create a basic dataset */
+ dset = H5Dcreate2(file, BASIC_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (dset > 0) /* dataset created successfully */
+ {
+ /* Get the internal dataspace pointer */
+ dset_space = H5Dget_space(dset);
+ CHECK(dset_space, FAIL, "H5Dget_space");
+ spacep = (H5S_t *)H5I_object(dset_space);
+ CHECK(spacep, NULL, "H5I_object");
+
+ /* Dataspace version should remain as H5O_SDSPACE_VERSION_1 */
+ VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound");
+
+ /* Close dataspace */
+ ret = H5Sclose(dset_space);
+ CHECK(ret, FAIL, "H5Sclose");
+ }
+
+ /* Close basic dataset and the file */
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Set low and high bounds to latest to trigger the increment of the
+ dataspace version */
+ low = H5F_LIBVER_LATEST;
+ high = H5F_LIBVER_LATEST;
+ ret = H5Pset_libver_bounds(fapl, low, high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Reopen the file with new version bounds, LATEST/LATEST */
+ file = H5Fopen(VERBFNAME, H5F_ACC_RDWR, fapl);
+
+ /* Create another dataset using the same dspace as the previous dataset */
+ dset = H5Dcreate2(file, LATEST_DSET, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
+
+ /* Dataset created successfully. Verify that dataspace version has been
+ upgraded per the low bound */
+
+ /* Get the internal dataspace pointer */
+ dset_space = H5Dget_space(dset);
+ CHECK(dset_space, FAIL, "H5Dget_space");
+ spacep = (H5S_t *)H5I_object(dset_space);
+ CHECK(spacep, NULL, "H5I_object");
+
+ /* Verify the dataspace version */
+ VERIFY(spacep->extent.version, H5O_sdspace_ver_bounds[low], "upgraded dataspace version");
+
+ /* Close everything */
+ ret = H5Sclose(dset_space);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Dclose(dset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Sclose(space);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* end test_versionbounds() */
+
+
/****************************************************************
**
** test_h5s(): Main H5S (dataspace) testing routine.
@@ -2372,36 +3382,60 @@ test_h5s_bug1(void)
void
test_h5s(void)
{
+ H5F_libver_t low, high; /* Low and high bounds */
+
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataspaces\n"));
- test_h5s_basic(); /* Test basic H5S code */
- test_h5s_null(); /* Test Null dataspace H5S code */
+ test_h5s_basic(); /* Test basic H5S code */
+ test_h5s_null(); /* Test Null dataspace H5S code */
test_h5s_zero_dim(); /* Test dataspace with zero dimension size */
- test_h5s_encode(); /* Test encoding and decoding */
- test_h5s_scalar_write(); /* Test scalar H5S writing code */
- test_h5s_scalar_read(); /* Test scalar H5S reading code */
- test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */
- test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
+
+ test_h5s_encode(low, high); /* Test encoding and decoding */
+ test_h5s_encode_regular_hyper(low, high); /* Test encoding regular hyperslabs */
+ test_h5s_encode_irregular_hyper(low, high); /* Test encoding irregular hyperslabs */
+ test_h5s_encode_points(low, high); /* Test encoding points */
+
+ } /* end high bound */
+ } /* end low bound */
+
+ test_h5s_encode_length(); /* Test version 2 hyperslab encoding length is correct */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ test_h5s_encode1(); /* Test operations with old API routine (H5Sencode1) */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+ test_h5s_scalar_write(); /* Test scalar H5S writing code */
+ test_h5s_scalar_read(); /* Test scalar H5S reading code */
+
+ test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */
+ test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */
/* This test was added later to exercise a bug in chunked I/O */
- test_h5s_chunk(); /* Exercise bug fix for chunked I/O */
+ test_h5s_chunk(); /* Exercise bug fix for chunked I/O */
- test_h5s_extent_equal(); /* Test extent comparison code */
+ test_h5s_extent_equal(); /* Test extent comparison code */
test_h5s_extent_copy(); /* Test extent copy code */
test_h5s_bug1(); /* Test bug in offset initialization */
+ test_versionbounds(); /* Test version bounds with dataspace */
} /* test_h5s() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_h5s
+ * Function: cleanup_h5s
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Albert Cheng
+ * Programmer: Albert Cheng
* July 2, 1998
*
* Modifications:
@@ -2415,4 +3449,5 @@ cleanup_h5s(void)
remove(NULLFILE);
remove(BASICFILE);
remove(ZEROFILE);
+ remove(VERBFNAME);
}
diff --git a/test/theap.c b/test/theap.c
index 3c23025..7b2fadb 100644
--- a/test/theap.c
+++ b/test/theap.c
@@ -88,11 +88,11 @@ test_heap_init(void)
/* Allocate arrays */
rand_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS);
- CHECK(rand_num, NULL, "HDmalloc");
+ CHECK_PTR(rand_num, "HDmalloc");
inc_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS);
- CHECK(inc_sort_num, NULL, "HDmalloc");
+ CHECK_PTR(inc_sort_num, "HDmalloc");
dec_sort_num = (test_obj *)HDmalloc(sizeof(test_obj) * NUM_ELEMS);
- CHECK(dec_sort_num, NULL, "HDmalloc");
+ CHECK_PTR(dec_sort_num, "HDmalloc");
/* Create randomized set of numbers */
curr_time = HDtime(NULL);
@@ -127,7 +127,7 @@ test_heap_create(void)
/* Try creating a maximum Heap */
heap=H5HP_create(H5HP_MAX_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Try closing the heap */
ret=H5HP_close(heap);
@@ -135,7 +135,7 @@ test_heap_create(void)
/* Try creating a minimum Heap */
heap=H5HP_create(H5HP_MIN_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Try closing the heap */
ret=H5HP_close(heap);
@@ -163,7 +163,7 @@ test_heap_insert_min(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MIN_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -237,7 +237,7 @@ test_heap_insert_max(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MAX_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -325,7 +325,7 @@ test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, i
/* Create a Heap */
heap=H5HP_create(heap_type);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -405,7 +405,7 @@ test_heap_remove_min(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MIN_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -434,19 +434,19 @@ test_heap_remove_min(void)
ret=H5HP_remove(heap,&val,&ptr);
CHECK(ret, FAIL, "H5HP_remove");
VERIFY(val, 5, "H5HP_remove");
- VERIFY(ptr, &obj2, "H5HP_remove");
+ CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove");
/* Remove second maximum value from heap */
ret=H5HP_remove(heap,&val,&ptr);
CHECK(ret, FAIL, "H5HP_remove");
VERIFY(val, 10, "H5HP_remove");
- VERIFY(ptr, &obj1, "H5HP_remove");
+ CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove");
/* Remove third maximum value from heap */
ret=H5HP_remove(heap,&val,&ptr);
CHECK(ret, FAIL, "H5HP_remove");
VERIFY(val, 20, "H5HP_remove");
- VERIFY(ptr, &obj3, "H5HP_remove");
+ CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove");
/* Try removing an object from an empty heap */
ret=H5HP_remove(heap,&val,&ptr);
@@ -479,7 +479,7 @@ test_heap_remove_max(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MAX_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -508,19 +508,19 @@ test_heap_remove_max(void)
ret=H5HP_remove(heap,&val,&ptr);
CHECK(ret, FAIL, "H5HP_remove");
VERIFY(val, 20, "H5HP_remove");
- VERIFY(ptr, &obj3, "H5HP_remove");
+ CHECK_PTR_EQ(ptr, &obj3, "H5HP_remove");
/* Remove second maximum value from heap */
ret=H5HP_remove(heap,&val,&ptr);
CHECK(ret, FAIL, "H5HP_remove");
VERIFY(val, 10, "H5HP_remove");
- VERIFY(ptr, &obj1, "H5HP_remove");
+ CHECK_PTR_EQ(ptr, &obj1, "H5HP_remove");
/* Remove third maximum value from heap */
ret=H5HP_remove(heap,&val,&ptr);
CHECK(ret, FAIL, "H5HP_remove");
VERIFY(val, 5, "H5HP_remove");
- VERIFY(ptr, &obj2, "H5HP_remove");
+ CHECK_PTR_EQ(ptr, &obj2, "H5HP_remove");
/* Try removing an object from an empty heap */
ret=H5HP_remove(heap,&val,&ptr);
@@ -567,7 +567,7 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz
/* Create a Heap */
heap=H5HP_create(heap_type);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -714,7 +714,7 @@ test_heap_change_min(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MIN_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -788,7 +788,7 @@ test_heap_change_max(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MAX_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -880,7 +880,7 @@ test_heap_incdec_min(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MIN_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
@@ -955,7 +955,7 @@ test_heap_incdec_max(void)
/* Create a Heap */
heap=H5HP_create(H5HP_MAX_HEAP);
- CHECK(heap, NULL, "H5HP_create");
+ CHECK_PTR(heap, "H5HP_create");
/* Check that the heap has no elements */
num=H5HP_count(heap);
diff --git a/test/thread_id.c b/test/thread_id.c
new file mode 100644
index 0000000..24aef80
--- /dev/null
+++ b/test/thread_id.c
@@ -0,0 +1,330 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Check that a thread ID returned by H5TS_thread_id() possesses the
+ * following properties:
+ *
+ * 1 ID >= 1.
+ * 2 The ID is constant over the thread's lifetime.
+ * 3 No two threads share an ID during their lifetimes.
+ * 4 A thread's ID is available for reuse as soon as it is joined.
+ */
+
+/*
+ * Include required headers. This file tests internal library functions,
+ * so we include the private headers here.
+ */
+#include "testhdf5.h"
+
+static void my_errx(int, const char *, ...) H5_ATTR_FORMAT(printf, 2, 3);
+
+static void
+my_errx(int code, const char *fmt, ...)
+{
+ va_list ap;
+
+ (void)HDfprintf(stderr, "thread_id: ");
+ HDva_start(ap, fmt);
+ (void)HDvfprintf(stderr, fmt, ap);
+ HDva_end(ap);
+ (void)HDfputc('\n', stderr);
+ HDexit(code);
+}
+
+#if defined(H5_HAVE_THREADSAFE) && !defined(H5_HAVE_WIN_THREADS)
+
+#if defined(H5_HAVE_DARWIN)
+
+typedef struct _pthread_barrierattr {
+ uint8_t unused;
+} pthread_barrierattr_t;
+
+typedef struct _pthread_barrier {
+ uint32_t magic;
+ unsigned int count;
+ uint64_t nentered;
+ pthread_cond_t cv;
+ pthread_mutex_t mtx;
+} pthread_barrier_t;
+
+int pthread_barrier_init(pthread_barrier_t *, const pthread_barrierattr_t *,
+ unsigned int);
+int pthread_barrier_wait(pthread_barrier_t *);
+int pthread_barrier_destroy(pthread_barrier_t *);
+
+static const uint32_t barrier_magic = 0xf00dd00f;
+
+int
+pthread_barrier_init(pthread_barrier_t *barrier,
+ const pthread_barrierattr_t *attr, unsigned int count)
+{
+ int rc;
+
+ if (count == 0)
+ return EINVAL;
+
+ if (attr != NULL)
+ return EINVAL;
+
+ memset(barrier, 0, sizeof(*barrier));
+
+ barrier->count = count;
+
+ if ((rc = pthread_cond_init(&barrier->cv, NULL)) != 0)
+ return rc;
+
+ if ((rc = pthread_mutex_init(&barrier->mtx, NULL)) != 0) {
+ (void)pthread_cond_destroy(&barrier->cv);
+ return rc;
+ }
+
+ barrier->magic = barrier_magic;
+
+ return 0;
+}
+
+static void
+barrier_lock(pthread_barrier_t *barrier)
+{
+ int rc;
+
+ if ((rc = pthread_mutex_lock(&barrier->mtx)) != 0) {
+ my_errx(EXIT_FAILURE, "%s: pthread_mutex_lock: %s", __func__,
+ strerror(rc));
+ }
+}
+
+static void
+barrier_unlock(pthread_barrier_t *barrier)
+{
+ int rc;
+
+ if ((rc = pthread_mutex_unlock(&barrier->mtx)) != 0) {
+ my_errx(EXIT_FAILURE, "%s: pthread_mutex_unlock: %s", __func__,
+ strerror(rc));
+ }
+}
+
+int
+pthread_barrier_destroy(pthread_barrier_t *barrier)
+{
+ int rc;
+
+ barrier_lock(barrier);
+ if (barrier->magic != barrier_magic)
+ rc = EINVAL;
+ else if (barrier->nentered % barrier->count != 0)
+ rc = EBUSY;
+ else {
+ rc = 0;
+ barrier->magic = ~barrier->magic;
+ }
+ barrier_unlock(barrier);
+
+ if (rc != 0)
+ return rc;
+
+ (void)pthread_cond_destroy(&barrier->cv);
+ (void)pthread_mutex_destroy(&barrier->mtx);
+
+ return 0;
+}
+
+int
+pthread_barrier_wait(pthread_barrier_t *barrier)
+{
+ int rc;
+ uint64_t threshold;
+
+ if (barrier == NULL)
+ return EINVAL;
+
+ barrier_lock(barrier);
+ if (barrier->magic != barrier_magic) {
+ rc = EINVAL;
+ goto out;
+ }
+ /* Compute the release `threshold`. All threads entering with count = 5
+ * and `nentered` in [0, 4] should be released once `nentered` reaches 5:
+ * call 5 the release `threshold`. All threads entering with count = 5
+ * and `nentered` in [5, 9] should be released once `nentered` reaches 10.
+ */
+ threshold = (barrier->nentered / barrier->count + 1) * barrier->count;
+ barrier->nentered++;
+ while (barrier->nentered < threshold) {
+ if ((rc = pthread_cond_wait(&barrier->cv, &barrier->mtx)) != 0)
+ goto out;
+ }
+ rc = pthread_cond_broadcast(&barrier->cv);
+out:
+ barrier_unlock(barrier);
+ return rc;
+}
+
+#endif /* H5_HAVE_DARWIN */
+
+static void my_err(int, const char *, ...) H5_ATTR_FORMAT(printf, 2, 3);
+
+static void
+my_err(int code, const char *fmt, ...)
+{
+ va_list ap;
+ int errno_copy = errno;
+
+ (void)HDfprintf(stderr, "thread_id: ");
+ HDva_start(ap, fmt);
+ (void)HDvfprintf(stderr, fmt, ap);
+ HDva_end(ap);
+ (void)HDfprintf(stderr, ": %s\n", HDstrerror(errno_copy));
+ HDexit(code);
+}
+
+#define threads_failure(_call, _result) do { \
+ my_errx(EXIT_FAILURE, "%s.%d: " #_call ": %s", __func__, \
+ __LINE__, HDstrerror(_result)); \
+} while (false)
+
+#define NTHREADS 5
+
+static volatile bool failed = false;
+static pthread_barrier_t barrier;
+static bool used[NTHREADS];
+static pthread_mutex_t used_lock;
+
+static void
+atomic_printf(const char *fmt, ...)
+{
+ char buf[80];
+ va_list ap;
+ ssize_t nprinted, nwritten;
+
+ va_start(ap, fmt);
+ nprinted = vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+
+ if (nprinted == -1)
+ my_err(EXIT_FAILURE, "%s.%d: vsnprintf", __func__, __LINE__);
+ else if (nprinted >= (ssize_t)sizeof(buf))
+ my_errx(EXIT_FAILURE, "%s.%d: vsnprintf overflowed", __func__, __LINE__);
+
+ nwritten = write(STDOUT_FILENO, buf, (size_t)nprinted);
+ if (nwritten < nprinted) {
+ my_errx(EXIT_FAILURE, "%s.%d: write error or short write",
+ __func__, __LINE__);
+ }
+}
+
+/* Each thread runs this routine. The routine fetches the current
+ * thread's ID, makes sure that it is in the expected range, makes
+ * sure that in this round of testing, no two threads shared the
+ * same ID, and checks that each thread's ID is constant over its lifetime.
+ *
+ * main() checks that every ID in [1, NTHREADS] is used in each round
+ * of testing. All NTHREADS threads synchronize on a barrier after each
+ * has fetched its ID. The barrier guarantees that all threads' lifetimes
+ * overlap at least momentarily, so the IDs will be unique, and there
+ * will be NTHREADS of them. Further, since thread IDs are assigned
+ * starting with 1, and the number of threads with IDs alive never exceeds
+ * NTHREADS, the least ID has to be 1 and the greatest, NTHREADS.
+ */
+static void *
+thread_main(void H5_ATTR_UNUSED *arg)
+{
+ uint64_t ntid, tid;
+
+ tid = H5TS_thread_id();
+
+ if (tid < 1 || NTHREADS < tid) {
+ atomic_printf("unexpected tid %" PRIu64 " FAIL\n", tid);
+ goto pre_barrier_error;
+ }
+ pthread_mutex_lock(&used_lock);
+ if (used[tid - 1]) {
+ atomic_printf("reused tid %" PRIu64 " FAIL\n", tid);
+ pthread_mutex_unlock(&used_lock);
+ goto pre_barrier_error;
+ }
+ used[tid - 1] = true;
+ pthread_mutex_unlock(&used_lock);
+
+ atomic_printf("tid %" PRIu64 " in [1, %d] PASS\n", tid, NTHREADS);
+ pthread_barrier_wait(&barrier);
+
+ ntid = H5TS_thread_id();
+ if (ntid != tid) {
+ atomic_printf("tid changed from %" PRIu64 " to %" PRIu64 " FAIL\n",
+ tid, ntid);
+ failed = true;
+ }
+ return NULL;
+pre_barrier_error:
+ pthread_barrier_wait(&barrier);
+ failed = true;
+ return NULL;
+}
+
+int
+main(void)
+{
+ int i, rc, times;
+ pthread_t threads[NTHREADS];
+
+ /* Run H5open() to initialize the library's thread-ID freelist,
+ * mutex, etc.
+ */
+ if (H5open() != SUCCEED)
+ my_errx(EXIT_FAILURE, "%s.%d: H5open failed", __func__, __LINE__);
+
+ if ((rc = pthread_mutex_init(&used_lock, NULL)) == -1)
+ threads_failure(pthread_mutex_init, rc);
+
+ if ((rc = pthread_barrier_init(&barrier, NULL, NTHREADS)) != 0)
+ threads_failure(pthread_barrier_init, rc);
+
+ /* Start the test threads and join them twice to make sure that
+ * the thread IDs are recycled in the second round.
+ */
+ for (times = 0; times < 2; times++) {
+
+ for (i = 0; i < NTHREADS; i++)
+ used[i] = false; // access synchronized by thread create/join
+
+ for (i = 0; i < NTHREADS; i++) {
+ rc = pthread_create(&threads[i], NULL, thread_main, NULL);
+ if (rc != 0)
+ threads_failure(pthread_create, rc);
+ }
+
+ for (i = 0; i < NTHREADS; i++) {
+ rc = pthread_join(threads[i], NULL);
+ if (rc != 0)
+ threads_failure(pthread_join, rc);
+ }
+
+ for (i = 0; i < NTHREADS; i++) {
+ if (!used[i]) // access synchronized by thread create/join
+ my_errx(EXIT_FAILURE, "thread ID %d did not run.", i + 1);
+ }
+ }
+ if ((rc = pthread_barrier_destroy(&barrier)) != 0)
+ threads_failure(pthread_barrier_destroy, rc);
+ return failed ? EXIT_FAILURE : EXIT_SUCCESS;
+}
+
+#else /*H5_HAVE_THREADSAFE && !H5_HAVE_WIN_THREADS*/
+int
+main(void)
+{
+ HDfprintf(stderr, "not implemented in this configuration.\n");
+ return EXIT_SUCCESS;
+}
+#endif /*H5_HAVE_THREADSAFE && !H5_HAVE_WIN_THREADS*/
diff --git a/test/tid.c b/test/tid.c
index 494ee60..7a839d2 100644
--- a/test/tid.c
+++ b/test/tid.c
@@ -14,319 +14,349 @@
/* Test user-created identifiers (hid_t's) and identifier types. */
#include "testhdf5.h"
-#include "hdf5.h"
- /* Include H5Ipkg.h to calculate max number of groups */
-#define H5I_FRIEND /*suppress error about including H5Ipkg */
+/* Include H5Ipkg.h to calculate max number of groups */
+#define H5I_FRIEND /*suppress error about including H5Ipkg */
#include "H5Ipkg.h"
- /* Test basic functionality of registering and deleting types and IDs */
+static herr_t
+free_wrapper(void *p)
+{
+ HDfree(p);
+ return SUCCEED;
+}
+
+/* Test basic functionality of registering and deleting types and IDs */
static int basic_id_test(void)
{
- H5I_type_t myType = H5I_BADID;
- hid_t arrayID = H5I_INVALID_HID;
- void* testObj = NULL;
- void* testPtr = NULL;
- char nameString[10];
- hid_t testID;
- ssize_t testSize = -1;
- herr_t err;
- int num_ref;
- hsize_t num_members;
-
-
- /* Try to register an ID with ficticious types */
- H5E_BEGIN_TRY
- arrayID = H5Iregister((H5I_type_t) 420, testObj);
- H5E_END_TRY
-
- VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister");
- if(arrayID != H5I_INVALID_HID)
- goto out;
-
- H5E_BEGIN_TRY
- arrayID = H5Iregister((H5I_type_t) -1, testObj);
- H5E_END_TRY
-
- VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister");
- if(arrayID != H5I_INVALID_HID)
- goto out;
-
- /* Try to access IDs with ficticious types */
- H5E_BEGIN_TRY
- testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0);
- H5E_END_TRY
-
- VERIFY(testPtr, NULL, "H5Iobject_verify");
- if(testPtr != NULL)
- goto out;
-
- H5E_BEGIN_TRY
- testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700);
- H5E_END_TRY
-
- VERIFY(testPtr, NULL, "H5Iobject_verify");
- if(testPtr != NULL)
- goto out;
-
- /* Register a type */
- myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
-
- CHECK(myType, H5I_BADID, "H5Iregister_type");
- if(myType == H5I_BADID)
- goto out;
-
- /* Register an ID and retrieve the object it points to.
- * Once the ID has been registered, testObj will be freed when
- * its ID type is destroyed. */
- testObj = HDmalloc(7 * sizeof(int));
- arrayID = H5Iregister(myType, testObj);
-
- CHECK(arrayID, H5I_INVALID_HID, "H5Iregister");
- if(arrayID == H5I_INVALID_HID)
- {
- HDfree(testObj);
- goto out;
- }
-
- testPtr = (int *) H5Iobject_verify(arrayID, myType);
-
- VERIFY(testPtr, testObj, "H5Iobject_verify");
- if(testPtr != testObj)
- goto out;
-
- /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this
- * is an hid_t for the wrong kind of object */
- H5E_BEGIN_TRY
- testID = H5Iget_file_id(arrayID);
- H5E_END_TRY
-
- VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id");
- if(testID != H5I_INVALID_HID)
- goto out;
-
- H5E_BEGIN_TRY
- testSize = H5Iget_name(arrayID, nameString, (size_t)9);
- H5E_END_TRY
-
- VERIFY(testSize, -1, "H5Iget_name");
- if(testSize != -1)
- goto out;
-
- /* Make sure H5Iremove_verify catches objects of the wrong type */
- H5E_BEGIN_TRY
- testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0);
- H5E_END_TRY
-
- VERIFY(testPtr, NULL, "H5Iremove_verify");
- if(testPtr != NULL)
- goto out;
-
- H5E_BEGIN_TRY
- testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1));
- H5E_END_TRY
-
- VERIFY(testPtr, NULL, "H5Iremove_verify");
- if(testPtr != NULL)
- goto out;
-
- /* Remove an ID and make sure we can't access it */
- testPtr = (int*) H5Iremove_verify(arrayID, myType);
-
- CHECK(testPtr, NULL, "H5Iremove_verify");
- if(testPtr == NULL)
- goto out;
-
- H5E_BEGIN_TRY
- testPtr = (int*) H5Iobject_verify(arrayID, myType);
- H5E_END_TRY
-
- VERIFY(testPtr, NULL, "H5Iobject_verify");
- if(testPtr != NULL)
- goto out;
-
- /* Delete the type and make sure we can't access objects within it */
- arrayID = H5Iregister(myType, testObj);
-
- err = H5Idestroy_type(myType);
- VERIFY(err, 0, "H5Idestroy_type");
- if( err != 0)
- goto out;
- VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists");
- if(H5Itype_exists(myType) != 0)
- goto out;
+ H5I_type_t myType = H5I_BADID;
+ hid_t arrayID = H5I_INVALID_HID;
+ void* testObj = NULL;
+ void* testPtr = NULL;
+ char nameString[10];
+ hid_t testID;
+ ssize_t testSize = -1;
+ herr_t err;
+ int num_ref;
+ hsize_t num_members;
+
+
+ /* Try to register an ID with ficticious types */
+ H5E_BEGIN_TRY
+ arrayID = H5Iregister((H5I_type_t) 420, testObj);
+ H5E_END_TRY
- H5E_BEGIN_TRY
- VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers");
- if(H5Inmembers(myType, NULL) != -1)
- goto out;
- H5E_END_TRY
-
- /* Register another type and another object in that type */
- myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free );
-
- CHECK(myType, H5I_BADID, "H5Iregister_type");
- if(myType == H5I_BADID)
- goto out;
-
- /* The memory that testObj pointed to should already have been
- * freed when the previous type was destroyed. Allocate new
- * memory for it.
- */
- testObj = HDmalloc(7 * sizeof(int));
- arrayID = H5Iregister(myType, testObj);
-
- CHECK(arrayID, H5I_INVALID_HID, "H5Iregister");
- if(arrayID == H5I_INVALID_HID)
- {
- HDfree(testObj);
- goto out;
- }
-
- err = H5Inmembers(myType, &num_members);
- CHECK(err, -1, "H5Inmembers");
- if (err < 0)
- goto out;
- VERIFY(num_members, 1, "H5Inmembers");
- if(num_members != 1)
- goto out;
-
- /* Increment references to type and ensure that dec_type_ref
- doesn't destroy the type */
- num_ref = H5Iinc_type_ref(myType);
- VERIFY(num_ref, 2, "H5Iinc_type_ref");
- if( num_ref != 2)
- goto out;
- num_ref = H5Idec_type_ref(myType);
- VERIFY(num_ref, 1, "H5Idec_type_ref");
- if(num_ref != 1)
- goto out;
- err = H5Inmembers(myType, &num_members);
- CHECK(err, -1, "H5Inmembers");
- if (err < 0)
- goto out;
- VERIFY(num_members, 1, "H5Inmembers");
- if(num_members != 1)
- goto out;
-
- /* This call to dec_type_ref should destroy the type */
- num_ref = H5Idec_type_ref(myType);
- VERIFY(num_ref, 0, "H5Idec_type_ref");
- if(num_ref != 0)
- goto out;
- VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists");
- if (H5Itype_exists(myType) != 0)
+ VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister");
+ if(arrayID != H5I_INVALID_HID)
+ goto out;
+
+ H5E_BEGIN_TRY
+ arrayID = H5Iregister((H5I_type_t) -1, testObj);
+ H5E_END_TRY
+
+ VERIFY(arrayID, H5I_INVALID_HID, "H5Iregister");
+ if(arrayID != H5I_INVALID_HID)
+ goto out;
+
+ /* Try to access IDs with ficticious types */
+ H5E_BEGIN_TRY
+ testPtr = H5Iobject_verify((hid_t)100, (H5I_type_t) 0);
+ H5E_END_TRY
+
+ CHECK_PTR_NULL(testPtr, "H5Iobject_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testPtr = H5Iobject_verify((hid_t)700, (H5I_type_t) 700);
+ H5E_END_TRY
+
+ CHECK_PTR_NULL(testPtr, "H5Iobject_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ /* Register a type */
+ myType = H5Iregister_type((size_t)64, 0, free_wrapper);
+
+ CHECK(myType, H5I_BADID, "H5Iregister_type");
+ if(myType == H5I_BADID)
+ goto out;
+
+ /* Register an ID and retrieve the object it points to.
+ * Once the ID has been registered, testObj will be freed when
+ * its ID type is destroyed.
+ */
+ testObj = HDmalloc(7 * sizeof(int));
+ arrayID = H5Iregister(myType, testObj);
+
+ CHECK(arrayID, H5I_INVALID_HID, "H5Iregister");
+ if(arrayID == H5I_INVALID_HID) {
+ HDfree(testObj);
+ goto out;
+ }
+
+ testPtr = (int *)H5Iobject_verify(arrayID, myType);
+
+ CHECK_PTR_EQ(testPtr, testObj, "H5Iobject_verify");
+ if(testPtr != testObj)
+ goto out;
+
+ /* Ensure that H5Iget_file_id and H5Iget_name() fail, since this
+ * is an hid_t for the wrong kind of object
+ */
+ H5E_BEGIN_TRY
+ testID = H5Iget_file_id(arrayID);
+ H5E_END_TRY
+
+ VERIFY(testID, H5I_INVALID_HID, "H5Iget_file_id");
+ if(testID != H5I_INVALID_HID)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testSize = H5Iget_name(arrayID, nameString, (size_t)9);
+ H5E_END_TRY
+
+ VERIFY(testSize, -1, "H5Iget_name");
+ if(testSize != -1)
+ goto out;
+
+ /* Make sure H5Iremove_verify catches objects of the wrong type */
+ H5E_BEGIN_TRY
+ testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) 0);
+ H5E_END_TRY
+
+ CHECK_PTR_NULL(testPtr, "H5Iremove_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testPtr = (int*) H5Iremove_verify(arrayID, (H5I_type_t) ((int) myType-1));
+ H5E_END_TRY
+
+ CHECK_PTR_NULL(testPtr, "H5Iremove_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ /* Remove an ID and make sure we can't access it */
+ testPtr = (int*) H5Iremove_verify(arrayID, myType);
+
+ CHECK_PTR(testPtr, "H5Iremove_verify");
+ if(testPtr == NULL)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testPtr = (int*) H5Iobject_verify(arrayID, myType);
+ H5E_END_TRY
+
+ CHECK_PTR_NULL(testPtr, "H5Iobject_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ /* Delete the type and make sure we can't access objects within it */
+ arrayID = H5Iregister(myType, testObj);
+
+ err = H5Idestroy_type(myType);
+ VERIFY(err, 0, "H5Idestroy_type");
+ if( err != 0)
+ goto out;
+ VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists");
+ if(H5Itype_exists(myType) != 0)
+ goto out;
+
+ H5E_BEGIN_TRY
+ VERIFY(H5Inmembers(myType, NULL), -1, "H5Inmembers");
+ if(H5Inmembers(myType, NULL) != -1)
goto out;
+ H5E_END_TRY
+
+ /* Register another type and another object in that type */
+ myType = H5Iregister_type((size_t)64, 0, free_wrapper);
+
+ CHECK(myType, H5I_BADID, "H5Iregister_type");
+ if(myType == H5I_BADID)
+ goto out;
+
+ /* The memory that testObj pointed to should already have been
+ * freed when the previous type was destroyed. Allocate new
+ * memory for it.
+ */
+ testObj = HDmalloc(7 * sizeof(int));
+ arrayID = H5Iregister(myType, testObj);
+
+ CHECK(arrayID, H5I_INVALID_HID, "H5Iregister");
+ if(arrayID == H5I_INVALID_HID) {
+ HDfree(testObj);
+ goto out;
+ }
+
+ err = H5Inmembers(myType, &num_members);
+ CHECK(err, -1, "H5Inmembers");
+ if (err < 0)
+ goto out;
+ VERIFY(num_members, 1, "H5Inmembers");
+ if(num_members != 1)
+ goto out;
+
+ /* Increment references to type and ensure that dec_type_ref
+ * doesn't destroy the type
+ */
+ num_ref = H5Iinc_type_ref(myType);
+ VERIFY(num_ref, 2, "H5Iinc_type_ref");
+ if( num_ref != 2)
+ goto out;
+ num_ref = H5Idec_type_ref(myType);
+ VERIFY(num_ref, 1, "H5Idec_type_ref");
+ if(num_ref != 1)
+ goto out;
+ err = H5Inmembers(myType, &num_members);
+ CHECK(err, -1, "H5Inmembers");
+ if (err < 0)
+ goto out;
+ VERIFY(num_members, 1, "H5Inmembers");
+ if(num_members != 1)
+ goto out;
- H5E_BEGIN_TRY
+ /* This call to dec_type_ref should destroy the type */
+ num_ref = H5Idec_type_ref(myType);
+ VERIFY(num_ref, 0, "H5Idec_type_ref");
+ if(num_ref != 0)
+ goto out;
+ VERIFY(H5Itype_exists(myType), 0, "H5Itype_exists");
+ if (H5Itype_exists(myType) != 0)
+ goto out;
+
+ H5E_BEGIN_TRY
err = H5Inmembers(myType, &num_members);
- if(err >= 0)
- goto out;
- H5E_END_TRY
+ if(err >= 0)
+ goto out;
+ H5E_END_TRY
- return 0;
+ return 0;
out:
- /* Clean up type if it has been allocated and free memory used
- * by testObj */
- if(myType >= 0)
- H5Idestroy_type(myType);
+ /* Clean up type if it has been allocated and free memory used
+ * by testObj
+ */
+ if(myType >= 0)
+ H5Idestroy_type(myType);
- return -1;
+ return -1;
}
- /* A dummy search function for the next test */
-static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; }
+ /* A dummy search function for the next test */
+static int test_search_func(void H5_ATTR_UNUSED * ptr1, hid_t H5_ATTR_UNUSED id, void H5_ATTR_UNUSED * ptr2) { return 0; }
- /* Ensure that public functions cannot access "predefined" ID types */
+ /* Ensure that public functions cannot access "predefined" ID types */
static int id_predefined_test(void )
{
- void * testObj;
- hid_t testID;
- hid_t typeID = H5I_INVALID_HID;
- void * testPtr;
- herr_t testErr;
+ void * testObj;
+ hid_t testID;
+ hid_t typeID = H5I_INVALID_HID;
+ void * testPtr;
+ herr_t testErr;
- testObj = HDmalloc(sizeof(int));
+ testObj = HDmalloc(sizeof(int));
- /* Try to perform illegal functions on various predefined types */
- H5E_BEGIN_TRY
- testID = H5Iregister(H5I_FILE, testObj);
- H5E_END_TRY
+ /*
+ * Attempt to perform public functions on various library types
+ */
- VERIFY(testID, H5I_INVALID_HID, "H5Iregister");
- if(testID != H5I_INVALID_HID)
- goto out;
+ H5E_BEGIN_TRY
+ testID = H5Iregister(H5I_FILE, testObj);
+ H5E_END_TRY
- H5E_BEGIN_TRY
- testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj);
- H5E_END_TRY
+ VERIFY(testID, H5I_INVALID_HID, "H5Iregister");
+ if(testID != H5I_INVALID_HID)
+ goto out;
- VERIFY(testPtr, NULL, "H5Isearch");
- if(testPtr != NULL)
- goto out;
+ H5E_BEGIN_TRY
+ testPtr = H5Isearch(H5I_GENPROP_LST, test_search_func, testObj);
+ H5E_END_TRY
- H5E_BEGIN_TRY
- testErr = H5Inmembers(H5I_ERROR_STACK, NULL);
- H5E_END_TRY
+ CHECK_PTR_NULL(testPtr, "H5Isearch");
+ if(testPtr != NULL)
+ goto out;
- VERIFY(testErr, -1, "H5Inmembers");
- if(testErr != -1)
- goto out;
+ H5E_BEGIN_TRY
+ testErr = H5Inmembers(H5I_ERROR_STACK, NULL);
+ H5E_END_TRY
- H5E_BEGIN_TRY
- testErr = H5Iclear_type(H5I_FILE, 0);
- H5E_END_TRY
+ VERIFY(testErr, -1, "H5Inmembers");
+ if(testErr != -1)
+ goto out;
- VERIFY((testErr >= 0), 0, "H5Iclear_type");
- if(testErr >= 0)
- goto out;
+ H5E_BEGIN_TRY
+ testErr = H5Iclear_type(H5I_FILE, 0);
+ H5E_END_TRY
- H5E_BEGIN_TRY
- testErr = H5Idestroy_type(H5I_DATASET);
- H5E_END_TRY
+ VERIFY((testErr >= 0), 0, "H5Iclear_type");
+ if(testErr >= 0)
+ goto out;
- VERIFY((testErr >= 0), 0, "H5Idestroy_type");
- if(testErr >= 0)
- goto out;
+ H5E_BEGIN_TRY
+ testErr = H5Idestroy_type(H5I_DATASET);
+ H5E_END_TRY
- /* Create a datatype ID and try to perform illegal functions on it */
- typeID = H5Tcreate(H5T_OPAQUE, (size_t)42);
- CHECK(typeID, H5I_INVALID_HID, "H5Tcreate");
- if(typeID == H5I_INVALID_HID)
- goto out;
+ VERIFY((testErr >= 0), 0, "H5Idestroy_type");
+ if(testErr >= 0)
+ goto out;
- H5E_BEGIN_TRY
- testPtr = H5Iremove_verify(typeID, H5I_DATATYPE);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testErr = H5Itype_exists(H5I_GROUP);
+ H5E_END_TRY
- VERIFY(testPtr, NULL, "H5Iremove_verify");
- if(testPtr != NULL)
- goto out;
+ VERIFY(testErr, -1, "H5Itype_exists");
+ if(testErr != -1)
+ goto out;
- H5E_BEGIN_TRY
- testPtr = H5Iobject_verify(typeID, H5I_DATATYPE);
- H5E_END_TRY
+ H5E_BEGIN_TRY
+ testErr = H5Itype_exists(H5I_ATTR);
+ H5E_END_TRY
+
+ VERIFY(testErr, -1, "H5Itype_exists");
+ if(testErr != -1)
+ goto out;
+
+ /*
+ * Create a datatype ID and try to perform illegal functions on it
+ */
- VERIFY(testPtr, NULL, "H5Iobject_verify");
- if(testPtr != NULL)
- goto out;
+ typeID = H5Tcreate(H5T_OPAQUE, (size_t)42);
+ CHECK(typeID, H5I_INVALID_HID, "H5Tcreate");
+ if(typeID == H5I_INVALID_HID)
+ goto out;
- H5Tclose(typeID);
+ H5E_BEGIN_TRY
+ testPtr = H5Iremove_verify(typeID, H5I_DATATYPE);
+ H5E_END_TRY
- /* testObj was never registered as an atom, so it will not be
- * automatically freed. */
- HDfree(testObj);
- return 0;
+ CHECK_PTR_NULL(testPtr, "H5Iremove_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ H5E_BEGIN_TRY
+ testPtr = H5Iobject_verify(typeID, H5I_DATATYPE);
+ H5E_END_TRY
+
+ CHECK_PTR_NULL(testPtr, "H5Iobject_verify");
+ if(testPtr != NULL)
+ goto out;
+
+ H5Tclose(typeID);
+
+ /* testObj was never registered as an atom, so it will not be
+ * automatically freed. */
+ HDfree(testObj);
+ return 0;
out:
- if(typeID != H5I_INVALID_HID)
- H5Tclose(typeID);
- if(testObj != NULL)
- HDfree(testObj);
+ if(typeID != H5I_INVALID_HID)
+ H5Tclose(typeID);
+ if(testObj != NULL)
+ HDfree(testObj);
- return -1;
+ return -1;
}
@@ -442,12 +472,12 @@ static int test_get_type(void)
out:
if(dtype != H5I_INVALID_HID)
- H5Tclose(dtype);
+ H5Tclose(dtype);
return -1;
}
- /* Test boundary cases with lots of types */
+ /* Test boundary cases with lots of types */
/* Type IDs range from H5I_NTYPES to H5I_MAX_NUM_TYPES. The system will assign */
/* IDs in sequential order until H5I_MAX_NUM_TYPES IDs have been given out, at which */
@@ -457,78 +487,78 @@ out:
/* to low values successfully, ensure that an error is thrown when all possible */
/* type IDs are taken, then ensure that deleting types frees up their IDs. */
/* Note that this test depends on the implementation of IDs, so may break */
-/* if the implementation changes. */
+/* if the implementation changes. */
/* Also note that if someone else registered a user-defined type and forgot to */
/* destroy it, this test will mysteriously fail (because it will expect there to */
/* be one more "free" type ID than there is). */
/* H5I_NTYPES is defined in h5public.h, H5I_MAX_NUM_TYPES is defined in h5pkg.h */
static int test_id_type_list(void)
{
- H5I_type_t startType; /* The first type ID we were assigned in this test */
- H5I_type_t currentType;
- H5I_type_t testType;
- int i; /* Just a counter variable */
-
- startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- CHECK(startType, H5I_BADID, "H5Iregister_type");
- if(startType == H5I_BADID)
- goto out;
-
- /* Sanity check */
- if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
- {
- /* Error condition, throw an error */
- CHECK(1, 1, "H5Iregister_type");
- goto out;
- }
- /* Create types up to H5I_MAX_NUM_TYPES */
- for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++)
- {
- currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- CHECK(currentType, H5I_BADID, "H5Iregister_type");
- if(currentType == H5I_BADID)
- goto out;
- }
-
- /* Wrap around to low type ID numbers */
- for(i = H5I_NTYPES; i < startType; i++)
- {
- currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- CHECK(currentType, H5I_BADID, "H5Iregister_type");
- if(currentType == H5I_BADID)
- goto out;
- }
-
- /* There should be no room at the inn for a new ID type*/
- H5E_BEGIN_TRY
- testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
- H5E_END_TRY
-
- VERIFY(testType, H5I_BADID, "H5Iregister_type");
- if(testType != H5I_BADID)
- goto out;
-
- /* Now delete a type and try to insert again */
- H5Idestroy_type(H5I_NTYPES);
- testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free );
-
- VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
- if(testType != H5I_NTYPES)
- goto out;
-
- /* Cleanup. Destroy all types. */
- for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
- H5Idestroy_type((H5I_type_t) i);
-
- return 0;
+ H5I_type_t startType; /* The first type ID we were assigned in this test */
+ H5I_type_t currentType;
+ H5I_type_t testType;
+ int i; /* Just a counter variable */
+
+ startType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ CHECK(startType, H5I_BADID, "H5Iregister_type");
+ if(startType == H5I_BADID)
+ goto out;
+
+ /* Sanity check */
+ if((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES)
+ {
+ /* Error condition, throw an error */
+ CHECK(1, 1, "H5Iregister_type");
+ goto out;
+ }
+ /* Create types up to H5I_MAX_NUM_TYPES */
+ for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++)
+ {
+ currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ CHECK(currentType, H5I_BADID, "H5Iregister_type");
+ if(currentType == H5I_BADID)
+ goto out;
+ }
+
+ /* Wrap around to low type ID numbers */
+ for(i = H5I_NTYPES; i < startType; i++)
+ {
+ currentType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ CHECK(currentType, H5I_BADID, "H5Iregister_type");
+ if(currentType == H5I_BADID)
+ goto out;
+ }
+
+ /* There should be no room at the inn for a new ID type*/
+ H5E_BEGIN_TRY
+ testType = H5Iregister_type((size_t)8, 0, free_wrapper);
+ H5E_END_TRY
+
+ VERIFY(testType, H5I_BADID, "H5Iregister_type");
+ if(testType != H5I_BADID)
+ goto out;
+
+ /* Now delete a type and try to insert again */
+ H5Idestroy_type(H5I_NTYPES);
+ testType = H5Iregister_type((size_t)8, 0, free_wrapper);
+
+ VERIFY(testType, H5I_NTYPES, "H5Iregister_type");
+ if(testType != H5I_NTYPES)
+ goto out;
+
+ /* Cleanup. Destroy all types. */
+ for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
+ H5Idestroy_type((H5I_type_t) i);
+
+ return 0;
out:
/* Cleanup. For simplicity, just destroy all types and ignore errors. */
- H5E_BEGIN_TRY
- for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
- H5Idestroy_type((H5I_type_t) i);
- H5E_END_TRY
- return -1;
+ H5E_BEGIN_TRY
+ for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++)
+ H5Idestroy_type((H5I_type_t) i);
+ H5E_END_TRY
+ return -1;
}
/* Test removing ids in callback for H5Iclear_type */
@@ -731,11 +761,11 @@ void test_ids(void)
/* Set the random # seed */
HDsrandom((unsigned)HDtime(NULL));
- if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n");
- if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n");
- if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n");
- if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n");
- if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n");
- if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n");
+ if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n");
+ if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n");
+ if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n");
+ if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n");
+ if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n");
+ if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n");
}
diff --git a/test/titerate.c b/test/titerate.c
index aad62c9..9d60915 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -13,15 +13,14 @@
/***********************************************************
*
-* Test program: titerate
+* Test program: titerate
*
* Test the Group & Attribute functionality
*
*************************************************************/
#include "testhdf5.h"
-
-#include "hdf5.h"
+#include "H5srcdir.h"
#define DATAFILE "titerate.h5"
@@ -38,8 +37,8 @@
#define NAMELEN 80
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 4
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
typedef enum {
RET_ZERO,
@@ -55,12 +54,23 @@ typedef struct {
iter_enum command; /* The type of return value */
} iter_info;
+/* Definition for test_corrupted_attnamelen */
+#define CORRUPTED_ATNAMELEN_FILE "memleak_H5O_dtype_decode_helper_H5Odtype.h5"
+#define DSET_NAME "image"
+typedef struct searched_err_t {
+ char message[256];
+ bool found;
+} searched_err_t;
+
+/* Call back function for test_corrupted_attnamelen */
+static int find_err_msg_cb(unsigned n, const H5E_error2_t *err_desc, void *_client_data);
+
/* Local functions */
int iter_strcmp(const void *s1, const void *s2);
int iter_strcmp2(const void *s1, const void *s2);
-static herr_t liter_cb(hid_t group, const char *name, const H5L_info_t *info,
+static herr_t liter_cb(hid_t group, const char *name, const H5L_info2_t *info,
void *op_data);
-static herr_t liter_cb2(hid_t group, const char *name, const H5L_info_t *info,
+static herr_t liter_cb2(hid_t group, const char *name, const H5L_info2_t *info,
void *op_data);
herr_t aiter_cb(hid_t group, const char *name, const H5A_info_t *ainfo,
void *op_data);
@@ -81,7 +91,7 @@ H5_ATTR_PURE int iter_strcmp(const void *s1, const void *s2)
**
****************************************************************/
static herr_t
-liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info,
+liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t H5_ATTR_UNUSED *link_info,
void *op_data)
{
iter_info *info = (iter_info *)op_data;
@@ -106,7 +116,7 @@ liter_cb(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_
return(count2 > 10 ? 1 : 0);
default:
- printf("invalid iteration command");
+ HDprintf("invalid iteration command");
return(-1);
} /* end switch */
} /* end liter_cb() */
@@ -131,7 +141,7 @@ test_iter_group(hid_t fapl, hbool_t new_format)
char dataset_name[NAMELEN]; /* dataset name */
iter_info info; /* Custom iteration information */
H5G_info_t ginfo; /* Buffer for querying object's info */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Group Iteration Functionality\n"));
@@ -143,8 +153,8 @@ test_iter_group(hid_t fapl, hbool_t new_format)
/* Test iterating over empty group */
info.command = RET_ZERO;
idx = 0;
- ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
- VERIFY(ret, SUCCEED, "H5Literate");
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ VERIFY(ret, SUCCEED, "H5Literate2");
datatype = H5Tcopy(H5T_NATIVE_INT);
CHECK(datatype, FAIL, "H5Tcopy");
@@ -153,13 +163,13 @@ test_iter_group(hid_t fapl, hbool_t new_format)
CHECK(filespace, FAIL, "H5Screate");
for(i=0; i< NDATASETS; i++) {
- sprintf(name,"Dataset %d",i);
+ HDsprintf(name,"Dataset %d",i);
dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Keep a copy of the dataset names around for later */
lnames[i] = HDstrdup(name);
- CHECK(lnames[i], NULL, "strdup");
+ CHECK_PTR(lnames[i], "strdup");
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
@@ -170,13 +180,13 @@ test_iter_group(hid_t fapl, hbool_t new_format)
CHECK(ret, FAIL, "H5Gcreate2");
lnames[NDATASETS] = HDstrdup("grp");
- CHECK(lnames[NDATASETS], NULL, "strdup");
+ CHECK_PTR(lnames[NDATASETS], "strdup");
ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tcommit2");
lnames[NDATASETS + 1] = HDstrdup("dtype");
- CHECK(lnames[NDATASETS], NULL, "strdup");
+ CHECK_PTR(lnames[NDATASETS], "strdup");
/* Close everything up */
ret = H5Tclose(datatype);
@@ -210,12 +220,12 @@ test_iter_group(hid_t fapl, hbool_t new_format)
VERIFY(ginfo.nlinks, (NDATASETS + 2), "H5Gget_info");
for(i = 0; i< (int)ginfo.nlinks; i++) {
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
ret = (herr_t)H5Lget_name_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, dataset_name, (size_t)NAMELEN, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Lget_name_by_idx");
- ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_idx3(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info_by_idx");
} /* end for */
@@ -236,13 +246,13 @@ test_iter_group(hid_t fapl, hbool_t new_format)
VERIFY(ginfo.nlinks, NDATASETS + 2, "H5Gget_info");
for(i = 0; i< (int)ginfo.nlinks; i++) {
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
ret = (herr_t)H5Lget_name_by_idx(file, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, dataset_name, (size_t)NAMELEN, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Lget_name_by_idx");
- ret = H5Oget_info_by_idx(file, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_idx");
+ ret = H5Oget_info_by_idx3(file, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_idx3");
} /* end for */
H5E_BEGIN_TRY {
@@ -254,28 +264,28 @@ test_iter_group(hid_t fapl, hbool_t new_format)
info.command = RET_ZERO;
idx = (hsize_t)-1;
H5E_BEGIN_TRY {
- ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Literate");
+ VERIFY(ret, FAIL, "H5Literate2");
/* Test skipping exactly as many entries as in the group */
idx = NDATASETS + 2;
H5E_BEGIN_TRY {
- ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Literate");
+ VERIFY(ret, FAIL, "H5Literate2");
/* Test skipping more entries than are in the group */
idx = NDATASETS + 3;
H5E_BEGIN_TRY {
- ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Literate");
+ VERIFY(ret, FAIL, "H5Literate2");
/* Test all objects in group, when callback always returns 0 */
info.command = RET_ZERO;
idx = 0;
- if((ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0)
+ if((ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0)
TestErrPrintf("Group iteration function didn't return zero correctly!\n");
/* Test all objects in group, when callback always returns 1 */
@@ -283,15 +293,15 @@ test_iter_group(hid_t fapl, hbool_t new_format)
info.command = RET_TWO;
i = 0;
idx = 0;
- while((ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0) {
+ while((ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) > 0) {
/* Verify return value from iterator gets propagated correctly */
- VERIFY(ret, 2, "H5Literate");
+ VERIFY(ret, 2, "H5Literate2");
/* Increment the number of times "2" is returned */
i++;
/* Verify that the index is the correct value */
- VERIFY(idx, (hsize_t)i, "H5Literate");
+ VERIFY(idx, (hsize_t)i, "H5Literate2");
if(idx > (NDATASETS + 2))
TestErrPrintf("Group iteration function walked too far!\n");
@@ -299,7 +309,7 @@ test_iter_group(hid_t fapl, hbool_t new_format)
if(HDstrcmp(info.name, lnames[(size_t)(idx - 1)]) != 0)
TestErrPrintf("Group iteration function didn't return name correctly for link - lnames[%u] = '%s'!\n", (unsigned)(idx - 1), lnames[(size_t)(idx - 1)]);
} /* end while */
- VERIFY(ret, -1, "H5Literate");
+ VERIFY(ret, -1, "H5Literate2");
if(i != (NDATASETS + 2))
TestErrPrintf("%u: Group iteration function didn't perform multiple iterations correctly!\n", __LINE__);
@@ -309,15 +319,15 @@ test_iter_group(hid_t fapl, hbool_t new_format)
info.command = new_format ? RET_CHANGE2 : RET_CHANGE;
i = 0;
idx = 0;
- while((ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) >= 0) {
+ while((ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb, &info)) >= 0) {
/* Verify return value from iterator gets propagated correctly */
- VERIFY(ret, 1, "H5Literate");
+ VERIFY(ret, 1, "H5Literate2");
/* Increment the number of times "1" is returned */
i++;
/* Verify that the index is the correct value */
- VERIFY(idx, (hsize_t)(i + 10), "H5Literate");
+ VERIFY(idx, (hsize_t)(i + 10), "H5Literate2");
if(idx > (NDATASETS + 2))
TestErrPrintf("Group iteration function walked too far!\n");
@@ -325,7 +335,7 @@ test_iter_group(hid_t fapl, hbool_t new_format)
if(HDstrcmp(info.name, lnames[(size_t)(idx - 1)]) != 0)
TestErrPrintf("Group iteration function didn't return name correctly for link - lnames[%u] = '%s'!\n", (unsigned)(idx - 1), lnames[(size_t)(idx - 1)]);
} /* end while */
- VERIFY(ret, -1, "H5Literate");
+ VERIFY(ret, -1, "H5Literate2");
if(i != 42 || idx != 52)
TestErrPrintf("%u: Group iteration function didn't perform multiple iterations correctly!\n", __LINE__);
@@ -369,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() */
@@ -390,7 +400,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format)
char name[NAMELEN]; /* temporary name buffer */
char *anames[NATTR]; /* Names of the attributes created */
iter_info info; /* Custom iteration information */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Attribute Iteration Functionality\n"));
@@ -406,13 +416,13 @@ 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");
/* Keep a copy of the attribute names around for later */
anames[i] = HDstrdup(name);
- CHECK(anames[i], NULL, "strdup");
+ CHECK_PTR(anames[i], "strdup");
ret = H5Aclose(attribute);
CHECK(ret, FAIL, "H5Aclose");
@@ -540,12 +550,12 @@ H5_ATTR_PURE int iter_strcmp2(const void *s1, const void *s2)
**
****************************************************************/
static herr_t
-liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_info,
+liter_cb2(hid_t loc_id, const char *name, const H5L_info2_t H5_ATTR_UNUSED *link_info,
void *opdata)
{
const iter_info *test_info = (const iter_info *)opdata;
- H5O_info_t oinfo;
- herr_t ret; /* Generic return value */
+ H5O_info2_t oinfo;
+ herr_t ret; /* Generic return value */
if(HDstrcmp(name, test_info->name)) {
TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name);
@@ -555,8 +565,8 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_
/*
* Get type of the object and check it.
*/
- ret = H5Oget_info_by_name(loc_id, name, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(loc_id, name, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
if(test_info->type != oinfo.type) {
TestErrPrintf("test_info->type = %d, oinfo.type = %d\n", test_info->type, (int)oinfo.type);
@@ -575,13 +585,13 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_
static void
test_iter_group_large(hid_t fapl)
{
- hid_t file; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t group; /* Group ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t dims[] = {SPACE1_DIM1};
- herr_t ret; /* Generic return value */
+ hid_t file; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {SPACE1_DIM1};
+ herr_t ret; /* Generic return value */
char gname[20]; /* Temporary group name */
iter_info *names; /* Names of objects in the root group */
iter_info *curr_name; /* Pointer to the current name in the root group */
@@ -596,7 +606,7 @@ test_iter_group_large(hid_t fapl)
/* Allocate & initialize array */
names = (iter_info *)HDcalloc(sizeof(iter_info), (ITER_NGROUPS + 2));
- CHECK(names, NULL, "HDcalloc");
+ CHECK_PTR(names, "HDcalloc");
/* Output message about test being performed */
MESSAGE(5, ("Testing Large Group Iteration Functionality\n"));
@@ -611,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);
@@ -673,14 +683,14 @@ test_iter_group_large(hid_t fapl)
/* Iterate through the file to see members of the root group */
curr_name = &names[0];
- ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, NULL, liter_cb2, curr_name);
- CHECK(ret, FAIL, "H5Literate");
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, NULL, liter_cb2, curr_name);
+ CHECK(ret, FAIL, "H5Literate2");
for(i = 1; i < 100; i++) {
hsize_t idx = (hsize_t)i;
curr_name = &names[i];
- ret = H5Literate(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb2, curr_name);
- CHECK(ret, FAIL, "H5Literate");
+ ret = H5Literate2(file, H5_INDEX_NAME, H5_ITER_INC, &idx, liter_cb2, curr_name);
+ CHECK(ret, FAIL, "H5Literate2");
} /* end for */
/* Close file */
@@ -711,7 +721,7 @@ static void test_grp_memb_funcs(hid_t fapl)
char dataset_name[NAMELEN]; /* dataset name */
ssize_t name_len; /* Length of object's name */
H5G_info_t ginfo; /* Buffer for querying object's info */
- herr_t ret = SUCCEED; /* Generic return value */
+ herr_t ret = SUCCEED; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Group Member Information Functionality\n"));
@@ -727,13 +737,13 @@ static void test_grp_memb_funcs(hid_t fapl)
CHECK(filespace, FAIL, "H5Screate");
for(i = 0; i < NDATASETS; i++) {
- sprintf(name, "Dataset %d", i);
+ HDsprintf(name, "Dataset %d", i);
dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate2");
/* Keep a copy of the dataset names around for later */
dnames[i] = HDstrdup(name);
- CHECK(dnames[i], NULL, "strdup");
+ CHECK_PTR(dnames[i], "strdup");
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
@@ -744,13 +754,13 @@ static void test_grp_memb_funcs(hid_t fapl)
CHECK(ret, FAIL, "H5Gcreate2");
dnames[NDATASETS] = HDstrdup("grp");
- CHECK(dnames[NDATASETS], NULL, "strdup");
+ CHECK_PTR(dnames[NDATASETS], "strdup");
ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tcommit2");
dnames[NDATASETS + 1] = HDstrdup("dtype");
- CHECK(dnames[NDATASETS], NULL, "strdup");
+ CHECK_PTR(dnames[NDATASETS], "strdup");
/* Close everything up */
ret = H5Tclose(datatype);
@@ -783,7 +793,7 @@ static void test_grp_memb_funcs(hid_t fapl)
VERIFY(ginfo.nlinks, (NDATASETS + 2), "H5Gget_info");
for(i = 0; i < (int)ginfo.nlinks; i++) {
- H5O_info_t oinfo; /* Object info */
+ H5O_info2_t oinfo; /* Object info */
/* Test with NULL for name, to query length */
name_len = H5Lget_name_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, NULL, (size_t)NAMELEN, H5P_DEFAULT);
@@ -797,10 +807,10 @@ static void test_grp_memb_funcs(hid_t fapl)
/* Keep a copy of the dataset names around for later */
obj_names[i] = HDstrdup(dataset_name);
- CHECK(obj_names[i], NULL, "strdup");
+ CHECK_PTR(obj_names[i], "strdup");
- ret = H5Oget_info_by_idx(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_idx");
+ ret = H5Oget_info_by_idx3(root_group, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_idx3");
if(!HDstrcmp(dataset_name, "grp"))
VERIFY(oinfo.type, H5O_TYPE_GROUP, "H5Lget_name_by_idx");
@@ -851,7 +861,7 @@ static void test_links(hid_t fapl)
hid_t gid, gid1;
H5G_info_t ginfo; /* Buffer for querying object's info */
hsize_t i;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality\n"));
@@ -880,21 +890,21 @@ static void test_links(hid_t fapl)
/* Test these two functions, H5Oget_info_by_idx and H5Lget_name_by_idx */
for(i = 0; i < ginfo.nlinks; i++) {
- H5O_info_t oinfo; /* Object info */
- H5L_info_t linfo; /* Link info */
+ H5O_info2_t oinfo; /* Object info */
+ H5L_info2_t linfo; /* Link info */
/* Get link name */
name_len = H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, i, obj_name, (size_t)NAMELEN, H5P_DEFAULT);
CHECK(name_len, FAIL, "H5Lget_name_by_idx");
/* Get link type */
- ret = H5Lget_info_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &linfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Lget_info_by_idx");
+ ret = H5Lget_info_by_idx2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &linfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info_by_idx2");
/* Get object type */
if(linfo.type == H5L_TYPE_HARD) {
- ret = H5Oget_info_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_idx");
+ ret = H5Oget_info_by_idx3(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_idx3");
} /* end if */
if(!HDstrcmp(obj_name, "g1.1"))
@@ -917,6 +927,175 @@ static void test_links(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* test_links() */
+/*-------------------------------------------------------------------------
+ * Function: find_err_msg_cb
+ *
+ * Purpose: Callback function to find the given error message.
+ * Helper function for test_corrupted_attnamelen().
+ *
+ * Return: H5_ITER_STOP when the message is found
+ * H5_ITER_CONT, otherwise
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+find_err_msg_cb(unsigned H5_ATTR_UNUSED n, const H5E_error2_t *err_desc, void *_client_data)
+{
+ int status = H5_ITER_CONT;
+ searched_err_t *searched_err = (searched_err_t *)_client_data;
+
+ 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)
+ {
+ searched_err->found = true;
+ status = H5_ITER_STOP;
+ }
+
+ return status;
+} /* end find_err_msg_cb() */
+
+/**************************************************************************
+**
+** test_corrupted_attnamelen(): Test the fix for the JIRA issue HDFFV-10588,
+** where corrupted attribute's name length can be
+** detected and invalid read can be avoided.
+**
+**************************************************************************/
+static void test_corrupted_attnamelen(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t did = -1; /* Dataset ID */
+ searched_err_t err_caught; /* Data to be passed to callback func */
+ int err_status; /* Status returned by H5Aiterate2 */
+ herr_t ret; /* Return value */
+ const char *testfile = H5_get_srcdir_filename(CORRUPTED_ATNAMELEN_FILE); /* Corrected test file name */
+
+ const char *err_message = "attribute name has different length than stored length";
+ /* the error message produced when the failure occurs */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing the Handling of Corrupted Attribute's Name Length\n"));
+
+ fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Open the dataset */
+ did = H5Dopen2(fid, DSET_NAME, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dopen2");
+
+ /* Call H5Aiterate2 to trigger the failure in HDFFV-10588. Failure should
+ occur in the decoding stage, so some arguments are not needed. */
+ err_status = H5Aiterate2(did, H5_INDEX_NAME, H5_ITER_INC, NULL, NULL, NULL);
+ VERIFY(err_status, FAIL, "H5Aiterate2");
+
+ /* Make sure the intended error was caught */
+ if(err_status == -1)
+ {
+ /* Initialize client data */
+ HDstrcpy(err_caught.message, err_message);
+ err_caught.found = false;
+
+ /* Look for the correct error message */
+ ret = H5Ewalk2(H5E_DEFAULT, H5E_WALK_UPWARD, find_err_msg_cb, &err_caught);
+ CHECK(ret, FAIL, "H5Ewalk2");
+
+ /* Fail if the indicated message is not found */
+ CHECK(err_caught.found, false, "test_corrupted_attnamelen: Expected error not found");
+ }
+
+ /* Close the dataset and file */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+} /* test_corrupted_attnamelen() */
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+/****************************************************************
+**
+** test_links_deprec(): Test soft and hard link iteration
+**
+****************************************************************/
+static void test_links_deprec(hid_t fapl)
+{
+ hid_t file; /* File ID */
+ char obj_name[NAMELEN]; /* Names of the object in group */
+ ssize_t name_len; /* Length of object's name */
+ hid_t gid, gid1;
+ H5G_info_t ginfo; /* Buffer for querying object's info */
+ hsize_t i;
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality Using Deprecated Routines\n"));
+
+ /* Create the test file with the datasets */
+ file = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(file, FAIL, "H5Fcreate");
+
+ /* create groups */
+ gid = H5Gcreate2(file, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ gid1 = H5Gcreate2(file, "/g1/g1.1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid1, FAIL, "H5Gcreate2");
+
+ /* create soft and hard links to the group "/g1". */
+ ret = H5Lcreate_soft("something", gid, "softlink", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lcreate_soft");
+
+ ret = H5Lcreate_hard(gid, "/g1", H5L_SAME_LOC, "hardlink", H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lcreate_hard");
+
+ ret = H5Gget_info(gid, &ginfo);
+ CHECK(ret, FAIL, "H5Gget_info");
+ VERIFY(ginfo.nlinks, 3, "H5Gget_info");
+
+ /* Test these two functions, H5Oget_info_by_idx and H5Lget_name_by_idx */
+ for(i = 0; i < ginfo.nlinks; i++) {
+ H5O_info2_t oinfo; /* Object info */
+ H5L_info2_t linfo; /* Link info */
+
+ /* Get link name */
+ name_len = H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, i, obj_name, (size_t)NAMELEN, H5P_DEFAULT);
+ CHECK(name_len, FAIL, "H5Lget_name_by_idx");
+
+ /* Get link type */
+ ret = H5Lget_info_by_idx2(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &linfo, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Lget_info_by_idx1");
+
+ /* Get object type */
+ if(linfo.type == H5L_TYPE_HARD) {
+ ret = H5Oget_info_by_idx3(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)i, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_idx");
+ } /* end if */
+
+ if(!HDstrcmp(obj_name, "g1.1"))
+ VERIFY(oinfo.type, H5O_TYPE_GROUP, "H5Lget_name_by_idx");
+ else if(!HDstrcmp(obj_name, "hardlink"))
+ VERIFY(oinfo.type, H5O_TYPE_GROUP, "H5Lget_name_by_idx");
+ else if(!HDstrcmp(obj_name, "softlink"))
+ VERIFY(linfo.type, H5L_TYPE_SOFT, "H5Lget_name_by_idx");
+ else
+ CHECK(0, 0, "unknown object name");
+ } /* end for */
+
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ ret = H5Gclose(gid1);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ ret = H5Fclose(file);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_links_deprec() */
+#endif
+
/****************************************************************
**
** test_iterate(): Main iteration testing routine.
@@ -927,7 +1106,7 @@ test_iterate(void)
{
hid_t fapl, fapl2; /* File access property lists */
unsigned new_format; /* Whether to use the new format or not */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Iteration Operations\n"));
@@ -947,12 +1126,18 @@ test_iterate(void)
/* These next tests use the same file */
for(new_format = FALSE; new_format <= TRUE; new_format++) {
test_iter_group(new_format ? fapl2 : fapl, new_format); /* Test group iteration */
- test_iter_group_large(new_format ? fapl2 : fapl); /* Test group iteration for large # of objects */
+ test_iter_group_large(new_format ? fapl2 : fapl); /* Test group iteration for large # of objects */
test_iter_attr(new_format ? fapl2 : fapl, new_format); /* Test attribute iteration */
- test_grp_memb_funcs(new_format ? fapl2 : fapl); /* Test group member information functions */
- test_links(new_format ? fapl2 : fapl); /* Test soft and hard link iteration */
+ test_grp_memb_funcs(new_format ? fapl2 : fapl); /* Test group member information functions */
+ test_links(new_format ? fapl2 : fapl); /* Test soft and hard link iteration */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ test_links_deprec(new_format ? fapl2 : fapl); /* Test soft and hard link iteration */
+#endif
} /* end for */
+ /* Test the fix for issue HDFFV-10588 */
+ test_corrupted_attnamelen();
+
/* Close FAPLs */
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
@@ -960,15 +1145,15 @@ test_iterate(void)
CHECK(ret, FAIL, "H5Pclose");
} /* test_iterate() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_iterate
+ * Function: cleanup_iterate
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* April 5, 2000
*
* Modifications:
@@ -978,6 +1163,6 @@ test_iterate(void)
void
cleanup_iterate(void)
{
- remove(DATAFILE);
+ HDremove(DATAFILE);
}
diff --git a/test/tmeta.c b/test/tmeta.c
index 7eeb493..ceb7d2b 100644
--- a/test/tmeta.c
+++ b/test/tmeta.c
@@ -121,7 +121,7 @@ test_metadata(void)
*
*-------------------------------------------------------------------------
*/
-H5_ATTR_PURE H5_ATTR_CONST void
+void
cleanup_metadata(void)
{
/* no file to clean */
diff --git a/test/tmisc.c b/test/tmisc.c
index 102325a..6eb6872 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -21,15 +21,15 @@
*
*************************************************************/
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
+#define H5D_FRIEND /*suppress error about including H5Dpkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5D_TESTING
-#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
#include "H5Dpkg.h" /* Datasets */
+#include "H5MMprivate.h" /* Memory */
/* Definitions for misc. test #1 */
#define MISC1_FILE "tmisc1.h5"
@@ -128,15 +128,19 @@ typedef struct
/* Definitions for misc. test #8 */
#define MISC8_FILE "tmisc8.h5"
#define MISC8_DSETNAME1 "Dataset1"
-#define MISC8_DSETNAME2 "Dataset2"
-#define MISC8_DSETNAME3 "Dataset3"
#define MISC8_DSETNAME4 "Dataset4"
#define MISC8_DSETNAME5 "Dataset5"
+#define MISC8_DSETNAME8 "Dataset8"
+
+#ifndef H5_HAVE_PARALLEL
+#define MISC8_DSETNAME2 "Dataset2"
+#define MISC8_DSETNAME3 "Dataset3"
#define MISC8_DSETNAME6 "Dataset6"
#define MISC8_DSETNAME7 "Dataset7"
-#define MISC8_DSETNAME8 "Dataset8"
#define MISC8_DSETNAME9 "Dataset9"
#define MISC8_DSETNAME10 "Dataset10"
+#endif
+
#define MISC8_RANK 2
#define MISC8_DIM0 50
#define MISC8_DIM1 50
@@ -309,6 +313,7 @@ typedef struct
/* Definitions for misc. test #30 */
#define MISC30_FILE "tmisc30.h5"
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/* Definitions for misc. test #31 */
#define MISC31_FILE "tmisc31.h5"
#define MISC31_DSETNAME "dset"
@@ -317,12 +322,21 @@ typedef struct
#define MISC31_GROUPNAME "group"
#define MISC31_PROPNAME "misc31_prop"
#define MISC31_DTYPENAME "dtype"
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Definitions for misc. test #33 */
/* Note that this test file is generated by "gen_bad_offset.c" */
/* and bad offset values are written to that file for testing */
#define MISC33_FILE "bad_offset.h5"
+/* Definitions for misc. test #35 */
+#define MISC35_SPACE_RANK 3
+#define MISC35_SPACE_DIM1 3
+#define MISC35_SPACE_DIM2 15
+#define MISC35_SPACE_DIM3 13
+#define MISC35_NPOINTS 10
+
+
/****************************************************************
**
** test_misc1(): test unlinking a dataset from a group and immediately
@@ -460,8 +474,8 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att1, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- ret = H5Dvlen_reclaim(type, dataspace, H5P_DEFAULT, &data_check);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(type, dataspace, H5P_DEFAULT, &data_check);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Aclose(att1);
CHECK(ret, FAIL, "H5Aclose");
@@ -486,8 +500,8 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att2, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- ret = H5Dvlen_reclaim(type, dataspace, H5P_DEFAULT, &data_check);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(type, dataspace, H5P_DEFAULT, &data_check);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Aclose(att2);
CHECK(ret, FAIL, "H5Aclose");
@@ -535,8 +549,8 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name
ret = H5Aread(att, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &data_check);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(type, space, H5P_DEFAULT, &data_check);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Sclose(space);
CHECK(ret, FAIL, "H5Sclose");
@@ -649,7 +663,7 @@ static void
test_misc4(void)
{
hid_t file1, file2, group1, group2, group3;
- H5O_info_t oinfo1, oinfo2, oinfo3;
+ H5O_info2_t oinfo1, oinfo2, oinfo3;
herr_t ret;
/* Output message about test being performed */
@@ -674,12 +688,12 @@ test_misc4(void)
CHECK(group3, FAIL, "H5Gcreate2");
/* Get the stat information for each group */
- ret = H5Oget_info_by_name(file1, MISC4_GROUP_1, &oinfo1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Oget_info_by_name(file1, MISC4_GROUP_2, &oinfo2, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
- ret = H5Oget_info_by_name(file2, MISC4_GROUP_1, &oinfo3, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_name");
+ ret = H5Oget_info_by_name3(file1, MISC4_GROUP_1, &oinfo1, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(file1, MISC4_GROUP_2, &oinfo2, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
+ ret = H5Oget_info_by_name3(file2, MISC4_GROUP_1, &oinfo3, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name3");
/* Verify that the fileno values are the same for groups from file1 */
VERIFY(oinfo1.fileno, oinfo2.fileno, "H5Oget_info_by_name");
@@ -722,7 +736,7 @@ create_struct3(void)
herr_t ret; /* For error checking */
str3hndl = (misc5_struct3_hndl *)HDmalloc(sizeof(misc5_struct3_hndl));
- CHECK(str3hndl,NULL,"malloc");
+ CHECK_PTR(str3hndl, "malloc");
str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3));
CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate");
@@ -765,7 +779,7 @@ create_struct2(void)
herr_t ret; /* For error checking */
str2hndl = (misc5_struct2_hndl *)HDmalloc(sizeof(misc5_struct2_hndl));
- CHECK(str2hndl, NULL, "malloc");
+ CHECK_PTR(str2hndl, "HDmalloc");
str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2));
CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate");
@@ -774,7 +788,7 @@ create_struct2(void)
CHECK(ret, FAIL, "H5Tinsert");
str2hndl->st2h_st3hndl = create_struct3();
- CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3");
+ CHECK_PTR(str2hndl->st2h_st3hndl, "create_struct3");
ret = H5Tinsert(str2hndl->st2h_base, "st2_el2", HOFFSET(misc5_struct2, st2_el2), str2hndl->st2h_st3hndl->st3h_id);
CHECK(ret,FAIL,"H5Tinsert");
@@ -810,7 +824,7 @@ set_struct2(misc5_struct2 *buf)
buf->st2_el2.len = MISC5_DBGNELM3;
buf->st2_el2.p = HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3));
- CHECK(buf->st2_el2.p,NULL,"malloc");
+ CHECK_PTR(buf->st2_el2.p, "HDmalloc");
for(i=0; i<(buf->st2_el2.len); i++)
set_struct3(&(((misc5_struct3 *)(buf->st2_el2.p))[i]));
@@ -831,7 +845,7 @@ create_struct1(void)
herr_t ret; /* For error checking */
str1hndl = (misc5_struct1_hndl *)HDmalloc(sizeof(misc5_struct1_hndl));
- CHECK(str1hndl, NULL, "malloc");
+ CHECK_PTR(str1hndl, "HDmalloc");
str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1));
CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate");
@@ -840,7 +854,7 @@ create_struct1(void)
CHECK(ret, FAIL, "H5Tinsert");
str1hndl->st1h_st2hndl=create_struct2();
- CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2");
+ CHECK_PTR(str1hndl->st1h_st2hndl, "create_struct2");
ret = H5Tinsert(str1hndl->st1h_base, "st1_el2", HOFFSET(misc5_struct1, st1_el2), str1hndl->st1h_st2hndl->st2h_id);
CHECK(ret,FAIL,"H5Tinsert");
@@ -876,7 +890,7 @@ set_struct1(misc5_struct1 *buf)
buf->st1_el2.len=MISC5_DBGNELM2;
buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2));
- CHECK(buf->st1_el2.p,NULL,"malloc");
+ CHECK_PTR(buf->st1_el2.p, "HDmalloc");
for(i=0; i<(buf->st1_el2.len); i++)
set_struct2(&(((misc5_struct2 *)(buf->st1_el2.p))[i]));
@@ -912,7 +926,7 @@ test_misc5(void)
/* Create the memory structure to write */
str1hndl = create_struct1();
- CHECK(str1hndl, NULL, "create_struct1");
+ CHECK_PTR(str1hndl, "create_struct1");
/* Create the dataspace */
dims[0] = MISC5_NELMTOPLVL;
@@ -926,7 +940,7 @@ test_misc5(void)
/* Create the variable-length buffer */
buf.len = MISC5_DBGNELM1;
buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1));
- CHECK(buf.p, NULL, "malloc");
+ CHECK_PTR(buf.p, "HDmalloc");
/* Create the top-level VL information */
for(i = 0; i < MISC5_DBGNELM1; i++)
@@ -981,21 +995,21 @@ 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 */
}
}
/* Reclaim the memory for the VL information */
- ret=H5Dvlen_reclaim(mem_type_id, space_id, H5P_DEFAULT, &buf);
- CHECK(ret,FAIL,"H5Dvlen_reclaim");
+ ret=H5Treclaim(mem_type_id, space_id, H5P_DEFAULT, &buf);
+ CHECK(ret,FAIL,"H5Treclaim");
/* Close dataspace */
ret=H5Sclose(space_id);
@@ -1064,7 +1078,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);
@@ -1252,10 +1266,10 @@ test_misc8(void)
/* Allocate space for the data to write & read */
wdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1);
- CHECK(wdata,NULL,"malloc");
+ CHECK_PTR(wdata, "HDmalloc");
#ifdef VERIFY_DATA
rdata = (int *)HDmalloc(sizeof(int) * MISC8_DIM0 * MISC8_DIM1);
- CHECK(rdata,NULL,"malloc");
+ CHECK_PTR(rdata, "HDmalloc");
#endif /* VERIFY_DATA */
/* Initialize values */
@@ -1815,11 +1829,11 @@ test_misc11(void)
unsigned sym_ik; /* Symbol table B-tree initial 'K' value */
unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */
unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */
- unsigned nindexes; /* Shared message number of indexes */
+ unsigned nindexes; /* Shared message number of indexes */
H5F_info2_t finfo; /* global information about file */
H5F_fspace_strategy_t strategy; /* File space strategy */
- hsize_t threshold; /* Free-space section threshold */
- hbool_t persist; /* To persist free-space or not */
+ hsize_t threshold; /* Free-space section threshold */
+ hbool_t persist; /* To persist free-space or not */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1858,7 +1872,7 @@ test_misc11(void)
/* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */
H5E_BEGIN_TRY {
- ret=H5Pset_sym_k(fcpl, 32770, 0);
+ ret=H5Pset_sym_k(fcpl, 32770, 0);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_sym_k");
@@ -1867,7 +1881,7 @@ test_misc11(void)
/* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */
H5E_BEGIN_TRY {
- ret=H5Pset_istore_k(fcpl, 32770);
+ ret=H5Pset_istore_k(fcpl, 32770);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_istore_k");
@@ -1979,19 +1993,19 @@ test_misc12(void)
"las palabras del que murio en la cruz."
};
char *rdata [MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE]; /* Information read in */
- hid_t fid1;
- hid_t dataset;
- hid_t sid1, space, memspace;
- hid_t tid1, cparms;
- hsize_t dims1[] = {MISC12_SPACE1_DIM1};
- hsize_t dimsn[] = {MISC12_APPEND_SIZE};
- hsize_t maxdims1[1] = {H5S_UNLIMITED};
- hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
+ hid_t fid1;
+ hid_t dataset;
+ hid_t sid1, space, memspace;
+ hid_t tid1, cparms;
+ hsize_t dims1[] = {MISC12_SPACE1_DIM1};
+ hsize_t dimsn[] = {MISC12_APPEND_SIZE};
+ hsize_t maxdims1[1] = {H5S_UNLIMITED};
+ hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
- hsize_t offset[1] = {MISC12_SPACE1_DIM1};
+ hsize_t offset[1] = {MISC12_SPACE1_DIM1};
hsize_t count[1] = {MISC12_APPEND_SIZE};
int i; /* counting variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL-type in chunked dataset\n"));
@@ -2061,8 +2075,8 @@ test_misc12(void)
CHECK(ret, FAIL, "H5Sselect_all");
/* Reclaim VL data memory */
- ret = H5Dvlen_reclaim(tid1, space, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid1, space, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Everything */
ret = H5Dclose(dataset);
@@ -2143,7 +2157,7 @@ misc13_verify_dataset(hid_t loc_id, const char *name, const unsigned *data)
/* Create a data buffer for the dataset read */
read_data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned));
- CHECK(read_data, NULL, "HDcalloc");
+ CHECK_PTR(read_data, "HDcalloc");
/* Open the contiguous dataset in the root group */
dsid = H5Dopen2(loc_id, name, H5P_DEFAULT);
@@ -2269,14 +2283,14 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char
/* Allocate space for the user block */
user_block = HDcalloc(size, (size_t)1);
- CHECK(user_block, NULL, "HDcalloc");
+ CHECK_PTR(user_block, "HDcalloc");
/* Copy in the user block data */
- HDmemcpy(user_block, str, strlen(str));
+ HDmemcpy(user_block, str, HDstrlen(str));
/* Open the new file */
new_fp = HDfopen(new_name,"wb");
- CHECK(new_fp, NULL, "HDfopen");
+ CHECK_PTR(new_fp, "HDfopen");
/* Write the user block to the new file */
written = HDfwrite(user_block, (size_t)1, size, new_fp);
@@ -2284,11 +2298,11 @@ misc13_insert_user_block(const char *old_name, const char *new_name, const char
/* Open the old file */
old_fp = HDfopen(old_name,"rb");
- CHECK(old_fp, NULL, "HDfopen");
+ CHECK_PTR(old_fp, "HDfopen");
/* Allocate space for the copy buffer */
copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE);
- CHECK(copy_buf, NULL, "HDmalloc");
+ CHECK_PTR(copy_buf, "HDmalloc");
/* Copy data from the old file to the new file */
while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) {
@@ -2438,7 +2452,7 @@ test_misc13(void)
/* Create a data buffer for the datasets */
data = (unsigned *)HDcalloc(MISC13_DIM1, sizeof(unsigned));
- CHECK(data, NULL, "HDcalloc");
+ CHECK_PTR(data, "HDcalloc");
/* Initialize data to write */
misc13_init_data(data);
@@ -2713,16 +2727,16 @@ test_misc15(void)
fapl = H5Fget_access_plist(file);
CHECK(fapl, FAIL, "H5Fget_access_plist");
- ret = H5Pclose(fapl);
- CHECK(ret, FAIL, "H5Pclose");
-
ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is still OK */
- ret = H5Fis_hdf5(MISC15_FILE);
+ ret = H5Fis_accessible(MISC15_FILE, fapl);
CHECK(ret, FAIL, "H5Fis_hdf5");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
@@ -2745,10 +2759,10 @@ test_misc16(void)
herr_t ret; /* Generic return value */
char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE];
char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t dims[] = {MISC16_SPACE_DIM};
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {MISC16_SPACE_DIM};
int i;
/* Initialize the data */
@@ -2830,10 +2844,10 @@ test_misc17(void)
herr_t ret; /* Generic return value */
char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2];
char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */
- hid_t dataset; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid; /* Datatype ID */
- hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2};
+ hid_t dataset; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2};
int i;
/* Initialize the data */
@@ -2911,7 +2925,11 @@ test_misc18(void)
hid_t sid; /* 'Space ID */
hid_t did1, did2; /* Dataset IDs */
hid_t aid; /* Attribute ID */
- H5O_info_t oinfo; /* Information about object */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ H5O_info1_t old_oinfo; /* (deprecated) information about object */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ H5O_info2_t oinfo; /* Data model information about object */
+ H5O_native_info_t ninfo; /* Native file format information about object */
char attr_name[32]; /* Attribute name buffer */
unsigned u; /* Local index variable */
herr_t ret; /* Generic return value */
@@ -2929,31 +2947,53 @@ test_misc18(void)
CHECK(did1, FAIL, "H5Dcreate2");
/* Get object information */
- ret = H5Oget_info_by_name(fid, MISC18_DSET1_NAME, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, MISC18_DSET1_NAME, &oinfo, H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nmesgs, 6, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nchunks, 1, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.total, 272, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.free, 152, "H5Oget_info_by_name");
VERIFY(oinfo.num_attrs, 0, "H5Oget_info_by_name");
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ ret = H5Oget_info_by_name2(fid, MISC18_DSET1_NAME, &old_oinfo, H5O_INFO_HDR|H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nmesgs, 6, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nchunks, 1, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.total, 272, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.free, 152, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.num_attrs, 0, "H5Oget_info_by_name");
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ ret = H5Oget_native_info_by_name(fid, MISC18_DSET1_NAME, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nmesgs, 6, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nchunks, 1, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.total, 272, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.free, 152, "H5Oget_native_info_by_name");
/* Create second dataset */
did2 = H5Dcreate2(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(did2, FAIL, "H5Dcreate2");
/* Get object information */
- ret = H5Oget_info_by_name(fid, MISC18_DSET2_NAME, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, MISC18_DSET2_NAME, &oinfo, H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nmesgs, 6, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nchunks, 1, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.total, 272, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.free, 152, "H5Oget_info_by_name");
VERIFY(oinfo.num_attrs, 0, "H5Oget_info_by_name");
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ ret = H5Oget_info_by_name2(fid, MISC18_DSET2_NAME, &old_oinfo, H5O_INFO_HDR|H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nmesgs, 6, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nchunks, 1, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.total, 272, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.free, 152, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.num_attrs, 0, "H5Oget_info_by_name");
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ ret = H5Oget_native_info_by_name(fid, MISC18_DSET2_NAME, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nmesgs, 6, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nchunks, 1, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.total, 272, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.free, 152, "H5Oget_native_info_by_name");
/* 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);
@@ -2975,22 +3015,44 @@ test_misc18(void)
} /* end for */
/* Get object information for dataset #1 now */
- ret = H5Oget_info_by_name(fid, MISC18_DSET1_NAME, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, MISC18_DSET1_NAME, &oinfo, H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nmesgs, 24, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nchunks, 9, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.total, 888, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.free, 16, "H5Oget_info_by_name");
VERIFY(oinfo.num_attrs, 10, "H5Oget_info_by_name");
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ ret = H5Oget_info_by_name2(fid, MISC18_DSET1_NAME, &old_oinfo, H5O_INFO_HDR|H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nmesgs, 24, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nchunks, 9, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.total, 888, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.free, 16, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.num_attrs, 10, "H5Oget_info_by_name");
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ ret = H5Oget_native_info_by_name(fid, MISC18_DSET1_NAME, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nmesgs, 24, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nchunks, 9, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.total, 888, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.free, 16, "H5Oget_native_info_by_name");
/* Get object information for dataset #2 now */
- ret = H5Oget_info_by_name(fid, MISC18_DSET2_NAME, &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, MISC18_DSET2_NAME, &oinfo, H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nmesgs, 24, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.nchunks, 9, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.total, 888, "H5Oget_info_by_name");
- VERIFY(oinfo.hdr.space.free, 16, "H5Oget_info_by_name");
VERIFY(oinfo.num_attrs, 10, "H5Oget_info_by_name");
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ ret = H5Oget_info_by_name2(fid, MISC18_DSET2_NAME, &old_oinfo, H5O_INFO_HDR|H5O_INFO_NUM_ATTRS, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nmesgs, 24, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.nchunks, 9, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.total, 888, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.hdr.space.free, 16, "H5Oget_info_by_name");
+ VERIFY(old_oinfo.num_attrs, 10, "H5Oget_info_by_name");
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ ret = H5Oget_native_info_by_name(fid, MISC18_DSET2_NAME, &ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_mative_info_by_name");
+ VERIFY(ninfo.hdr.nmesgs, 24, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.nchunks, 9, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.total, 888, "H5Oget_native_info_by_name");
+ VERIFY(ninfo.hdr.space.free, 16, "H5Oget_native_info_by_name");
/* Close second dataset */
ret = H5Dclose(did2);
@@ -3028,7 +3090,9 @@ test_misc19(void)
hid_t emid = -1; /* Error Message ID */
hid_t esid = -1; /* Error Stack ID */
hid_t vfdid = -1; /* Virtual File Driver ID */
+ hid_t volid = -1; /* Virtual Object Layer ID */
H5FD_class_t *vfd_cls = NULL; /* VFD class */
+ H5VL_class_t *vol_cls = NULL; /* VOL class */
int rc; /* Reference count */
herr_t ret; /* Generic return value */
@@ -3445,7 +3509,7 @@ test_misc19(void)
/* Get a VFD class to register */
vfd_cls = h5_get_dummy_vfd_class();
- CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class");
+ CHECK_PTR(vfd_cls, "h5_get_dummy_vfd_class");
/* Register a virtual file driver */
vfdid = H5FDregister(vfd_cls);
@@ -3479,6 +3543,44 @@ test_misc19(void)
HDfree(vfd_cls);
+/* Check H5I operations on virtual object connectors */
+
+ /* Get a VOL class to register */
+ vol_cls = h5_get_dummy_vol_class();
+ CHECK(vol_cls, NULL, "h5_get_dummy_vol_class");
+
+ /* Register a VOL connector */
+ volid = H5VLregister_connector(vol_cls, H5P_DEFAULT);
+ CHECK(volid, FAIL, "H5VLregister_connector");
+
+ /* Check the reference count */
+ rc = H5Iget_ref(volid);
+ VERIFY(rc, 1, "H5Iget_ref");
+
+ /* Increment the reference count */
+ rc = H5Iinc_ref(volid);
+ VERIFY(rc, 2, "H5Iinc_ref");
+
+ /* Unregister the VOL connector normally */
+ ret = H5VLunregister_connector(volid);
+ CHECK(ret, FAIL, "H5VLunregister_connector");
+
+ /* Check the reference count */
+ rc = H5Iget_ref(volid);
+ VERIFY(rc, 1, "H5Iget_ref");
+
+ /* Unregister the VOL connector by decrementing the reference count */
+ rc = H5Idec_ref(volid);
+ VERIFY(rc, 0, "H5Idec_ref");
+
+ /* Try unregistering the VOL connector again (should fail) */
+ H5E_BEGIN_TRY {
+ ret = H5VLunregister_connector(volid);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5VLunregister_connector");
+
+ HDfree(vol_cls);
+
} /* end test_misc19() */
/****************************************************************
@@ -3797,13 +3899,13 @@ test_misc22(void)
/* compute the correct PPB that should be set by SZIP */
if(offsets[k] == 0)
- correct = prec[j];
+ correct = prec[j];
else
correct = H5Tget_size(idts[i]) * 8;
if(correct > 24) {
- if(correct <= 32)
+ if(correct <= 32)
correct = 32;
- else if(correct <= 64)
+ else if(correct <= 64)
correct = 64;
} /* end if */
@@ -3875,7 +3977,7 @@ test_misc23(void)
hid_t file_id=0, group_id=0, type_id=0, space_id=0,
tmp_id=0, create_id=H5P_DEFAULT, access_id=H5P_DEFAULT;
char objname[MISC23_NAME_BUF_SIZE]; /* Name of object */
- H5O_info_t oinfo;
+ H5O_info2_t oinfo;
htri_t tri_status;
ssize_t namelen;
herr_t status;
@@ -3958,9 +4060,9 @@ test_misc23(void)
tmp_id = H5Gopen2(file_id, "/A/B01", H5P_DEFAULT);
CHECK(tmp_id, FAIL, "H5Gopen2");
- status = H5Oget_info(tmp_id, &oinfo);
- CHECK(status, FAIL, "H5Oget_info");
- VERIFY(oinfo.rc, 1, "H5Oget_info");
+ status = H5Oget_info3(tmp_id, &oinfo, H5O_INFO_BASIC);
+ CHECK(status, FAIL, "H5Oget_info3");
+ VERIFY(oinfo.rc, 1, "H5Oget_info3");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
@@ -4721,6 +4823,7 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25a() */
+
/****************************************************************
**
** test_misc25b(): Exercise null object header message merge bug
@@ -4756,7 +4859,7 @@ test_misc25b(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25b() */
-
+
/****************************************************************
**
** test_misc25c(): Exercise another null object header message merge bug.
@@ -4890,7 +4993,7 @@ test_misc25c(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc25c() */
-
+
/****************************************************************
**
** test_misc26(): Regression test: ensure that copying filter
@@ -4976,7 +5079,7 @@ test_misc26(void)
CHECK_I(ret, "H5Pclose");
}
-
+
/****************************************************************
**
** test_misc27(): Ensure that objects with incorrect # of object
@@ -5021,7 +5124,7 @@ test_misc27(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc27() */
-
+
/****************************************************************
**
** test_misc28(): Ensure that the dataset chunk cache will hold
@@ -5198,7 +5301,7 @@ test_misc28(void)
CHECK_I(ret, "H5Pclose");
} /* end test_misc28() */
-
+
/****************************************************************
**
** test_misc29(): Ensure that speculative metadata reads don't
@@ -5233,21 +5336,21 @@ test_misc29(void)
static int
-test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *info,
+test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info2_t H5_ATTR_UNUSED *info,
void H5_ATTR_UNUSED *op_data)
{
- H5O_info_t object_info;
+ H5O_info2_t object_info;
- return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
+ return H5Oget_info_by_name3(loc_id, name, &object_info, H5O_INFO_BASIC, H5P_DEFAULT);
}
static int
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);
+ return H5Literate2(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL);
}
-
+
/****************************************************************
**
** test_misc30(): Exercise local heap code that loads prefix
@@ -5279,19 +5382,19 @@ test_misc30(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
-
+
for(i = 0; i < 20; i++) {
char gname[32];
fid = H5Fopen(MISC30_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
-
+
if(get_info) {
- ret = test_misc30_get_info(fid);
+ ret = test_misc30_get_info(fid);
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");
@@ -5299,20 +5402,20 @@ test_misc30(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- }
-
+ }
+
fid = H5Fopen(MISC30_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
ret = H5Fget_filesize(fid, &file_size[get_info]);
CHECK(fid, FAIL, "H5Fget_filesize");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
- }
-
+ }
+
VERIFY(file_size[0], file_size[1], "test_misc30");
} /* end test_misc30() */
-
+
/****************************************************************
**
** test_misc31(): Test reentering library through deprecated
@@ -5323,6 +5426,7 @@ test_misc30(void)
static void
test_misc31(void)
{
+#ifndef H5_NO_DEPRECATED_SYMBOLS
hid_t file_id; /* File id */
hid_t space_id; /* Dataspace id */
hid_t dset_id; /* Dataset id */
@@ -5330,6 +5434,7 @@ test_misc31(void)
hid_t group_id; /* Group id */
hid_t dtype_id; /* Datatype id */
herr_t ret; /* Generic return value */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Output message about test being performed */
MESSAGE(5, ("Deprecated routines initialize after H5close()\n"));
@@ -5403,14 +5508,14 @@ test_misc31(void)
CHECK(ret, FAIL, "H5Fclose");
ret = H5Tclose(dtype_id);
CHECK(ret, FAIL, "H5Tclose");
-
+
#else /* H5_NO_DEPRECATED_SYMBOLS */
/* Output message about test being skipped */
MESSAGE(5, (" ...Skipped"));
#endif /* H5_NO_DEPRECATED_SYMBOLS */
} /* end test_misc31() */
-
+
/****************************************************************
*
* test_misc32(): Simple test of filter memory allocation
@@ -5474,7 +5579,7 @@ test_misc32(void)
resized = H5resize_memory(NULL, 0);
CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/
#endif /* NDEBUG */
-
+
} /* end test_misc32() */
/****************************************************************
@@ -5492,33 +5597,33 @@ test_misc33(void)
{
hid_t fid = -1; /* File ID */
const char *testfile = H5_get_srcdir_filename(MISC33_FILE); /* Corrected test file name */
- H5O_info_t oinfo; /* Structure for object metadata information */
+ H5O_info2_t oinfo; /* Structure for object metadata information */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing that bad offset into the heap returns error"));
/* Open the test file */
- fid = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
/* Case (1) */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_name(fid, "/soft_two", &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, "/soft_two", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(ret, FAIL, "H5Oget_info_by_name3");
/* Case (2) */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_name(fid, "/dsetA", &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, "/dsetA", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(ret, FAIL, "H5Oget_info_by_name3");
/* Case (3) */
H5E_BEGIN_TRY {
- ret = H5Oget_info_by_name(fid, "/soft_one", &oinfo, H5P_DEFAULT);
+ ret = H5Oget_info_by_name3(fid, "/soft_one", &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Oget_info_by_name");
+ VERIFY(ret, FAIL, "H5Oget_info_by_name3");
/* Close the file */
ret = H5Fclose(fid);
@@ -5526,7 +5631,177 @@ test_misc33(void)
} /* end test_misc33() */
-
+/****************************************************************
+**
+** test_misc34(): Ensure zero-size memory allocations work
+**
+****************************************************************/
+static void
+test_misc34(void)
+{
+ void *mem = NULL; /* allocated buffer */
+ char *dup = NULL; /* 'duplicated' string */
+ size_t sz = 0; /* buffer size */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing O and NULL behavior in H5MM API calls"));
+
+ /* H5MM_xfree(): Ensure that passing NULL is allowed and returns NULL */
+ mem = H5MM_xfree(mem);
+ CHECK_PTR_NULL(mem, "H5MM_xfree");
+
+ /* H5MM_malloc(): Ensure that size 0 returns NULL */
+ mem = H5MM_malloc(sz);
+ CHECK_PTR_NULL(mem, "H5MM_malloc");
+ mem = H5MM_xfree(mem);
+
+ /* H5MM_calloc(): Ensure that size 0 returns NULL */
+ mem = H5MM_calloc(sz);
+ CHECK_PTR_NULL(mem, "H5MM_calloc");
+ mem = H5MM_xfree(mem);
+
+ /* H5MM_realloc(): Check behavior:
+ *
+ * H5MM_realloc(NULL, size) <==> H5MM_malloc(size)
+ * H5MM_realloc(ptr, 0) <==> H5MM_xfree(ptr)
+ * H5MM_realloc(NULL, 0) <==> NULL
+ */
+ mem = H5MM_xfree(mem);
+
+ sz = 1024;
+ mem = H5MM_realloc(mem, sz);
+ CHECK_PTR(mem, "H5MM_realloc (case 1)");
+ /* Don't free mem here! */
+
+ sz = 0;
+ mem = H5MM_realloc(mem, sz);
+ CHECK_PTR_NULL(mem, "H5MM_realloc (case 2)");
+ mem = H5MM_xfree(mem);
+
+ mem = H5MM_realloc(mem, sz);
+ CHECK_PTR_NULL(mem, "H5MM_realloc (case 3)");
+ mem = H5MM_xfree(mem);
+
+ /* H5MM_xstrdup(): Ensure NULL returns NULL */
+ dup = H5MM_xstrdup((const char *)mem);
+ CHECK_PTR_NULL(dup, "H5MM_xstrdup");
+ dup = (char *)H5MM_xfree((void *)dup);
+
+} /* end test_misc34() */
+
+
+/****************************************************************
+**
+** test_misc35(): Check operation of free-list routines
+**
+****************************************************************/
+static void
+test_misc35(void)
+{
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hsize_t dims[] = {MISC35_SPACE_DIM1, MISC35_SPACE_DIM2, MISC35_SPACE_DIM3}; /* Dataspace dims */
+ hsize_t coord[MISC35_NPOINTS][MISC35_SPACE_RANK] = /* Coordinates for point selection */
+ {{0,10, 5},
+ {1, 2, 7},
+ {2, 4, 9},
+ {0, 6,11},
+ {1, 8,13},
+ {2,12, 0},
+ {0,14, 2},
+ {1, 0, 4},
+ {2, 1, 6},
+ {0, 3, 8}};
+ size_t reg_size_start; /* Initial amount of regular memory allocated */
+ size_t arr_size_start; /* Initial amount of array memory allocated */
+ size_t blk_size_start; /* Initial amount of block memory allocated */
+ size_t fac_size_start; /* Initial amount of factory memory allocated */
+ size_t reg_size_final; /* Final amount of regular memory allocated */
+ size_t arr_size_final; /* Final amount of array memory allocated */
+ size_t blk_size_final; /* Final amount of block memory allocated */
+ size_t fac_size_final; /* Final amount of factory memory allocated */
+ H5_alloc_stats_t alloc_stats; /* Memory stats */
+ herr_t ret; /* Return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Free-list API calls"));
+
+ /* Create dataspace */
+ /* (Allocates array free-list nodes) */
+ sid = H5Screate_simple(MISC35_SPACE_RANK, dims, NULL);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Select sequence of ten points */
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)MISC35_NPOINTS, (const hsize_t *)coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Close dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+
+ /* Retrieve initial free list values */
+ ret = H5get_free_list_sizes(&reg_size_start, &arr_size_start, &blk_size_start, &fac_size_start);
+ CHECK(ret, FAIL, "H5get_free_list_sizes");
+
+#if !defined H5_USING_MEMCHECKER
+ /* All the free list values should be >0 */
+ CHECK(reg_size_start, 0, "H5get_free_list_sizes");
+ CHECK(arr_size_start, 0, "H5get_free_list_sizes");
+ CHECK(blk_size_start, 0, "H5get_free_list_sizes");
+ CHECK(fac_size_start, 0, "H5get_free_list_sizes");
+#else /* H5_MEMORY_ALLOC_SANITY_CHECK */
+ /* All the values should be == 0 */
+ VERIFY(reg_size_start, 0, "H5get_free_list_sizes");
+ VERIFY(arr_size_start, 0, "H5get_free_list_sizes");
+ VERIFY(blk_size_start, 0, "H5get_free_list_sizes");
+ VERIFY(fac_size_start, 0, "H5get_free_list_sizes");
+#endif /* H5_MEMORY_ALLOC_SANITY_CHECK */
+
+ /* Garbage collect the free lists */
+ ret = H5garbage_collect();
+ CHECK(ret, FAIL, "H5garbage_collect");
+
+ /* Retrieve free list values again */
+ ret = H5get_free_list_sizes(&reg_size_final, &arr_size_final, &blk_size_final, &fac_size_final);
+ CHECK(ret, FAIL, "H5get_free_list_sizes");
+
+ /* All the free list values should be <= previous values */
+ if(reg_size_final > reg_size_start)
+ ERROR("reg_size_final > reg_size_start");
+ if(arr_size_final > arr_size_start)
+ ERROR("arr_size_final > arr_size_start");
+ if(blk_size_final > blk_size_start)
+ ERROR("blk_size_final > blk_size_start");
+ if(fac_size_final > fac_size_start)
+ ERROR("fac_size_final > fac_size_start");
+
+ /* Retrieve memory allocation statistics */
+ ret = H5get_alloc_stats(&alloc_stats);
+ CHECK(ret, FAIL, "H5get_alloc_stats");
+
+#if defined H5_MEMORY_ALLOC_SANITY_CHECK
+ /* All the values should be >0 */
+ CHECK(alloc_stats.total_alloc_bytes, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.curr_alloc_bytes, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.peak_alloc_bytes, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.max_block_size, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.total_alloc_blocks_count, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.curr_alloc_blocks_count, 0, "H5get_alloc_stats");
+ CHECK(alloc_stats.peak_alloc_blocks_count, 0, "H5get_alloc_stats");
+#else /* H5_MEMORY_ALLOC_SANITY_CHECK */
+ /* All the values should be == 0 */
+ VERIFY(alloc_stats.total_alloc_bytes, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.curr_alloc_bytes, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.peak_alloc_bytes, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.max_block_size, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.total_alloc_blocks_count, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.curr_alloc_blocks_count, 0, "H5get_alloc_stats");
+ VERIFY(alloc_stats.peak_alloc_blocks_count, 0, "H5get_alloc_stats");
+#endif /* H5_MEMORY_ALLOC_SANITY_CHECK */
+
+} /* end test_misc35() */
+
+
/****************************************************************
**
** test_misc(): Main misc. test routine.
@@ -5575,22 +5850,21 @@ test_misc(void)
test_misc31(); /* Test Reentering library through deprecated routines after H5close() */
test_misc32(); /* Test filter memory allocation functions */
test_misc33(); /* Test to verify that H5HL_offset_into() returns error if offset exceeds heap block */
+ test_misc34(); /* Test behavior of 0 and NULL in H5MM API calls */
+ test_misc35(); /* Test behavior of free-list & allocation statistics API calls */
} /* test_misc() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_misc
+ * Function: cleanup_misc
*
- * 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
@@ -5631,6 +5905,8 @@ cleanup_misc(void)
HDremove(MISC28_FILE);
HDremove(MISC29_COPY_FILE);
HDremove(MISC30_FILE);
+#ifndef H5_NO_DEPRECATED_SYMBOLS
HDremove(MISC31_FILE);
-}
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+} /* end cleanup_misc() */
diff --git a/test/trefer.c b/test/trefer.c
index 05c0130..12651c7 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: trefer
+* Test program: trefer
*
* Test the Reference functionality
*
@@ -21,24 +21,29 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
-#define FILE1 "trefer1.h5"
-#define FILE2 "trefer2.h5"
-#define FILE3 "trefer3.h5"
+#define FILE_REF_PARAM "trefer_param.h5"
+#define FILE_REF_OBJ "trefer_obj.h5"
+#define FILE_REF_REG "trefer_reg.h5"
+#define FILE_REF_REG_1D "trefer_reg_1d.h5"
+#define FILE_REF_OBJ_DEL "trefer_obj_del.h5"
+#define FILE_REF_GRP "trefer_grp.h5"
+#define FILE_REF_ATTR "trefer_attr.h5"
+#define FILE_REF_EXT1 "trefer_ext1.h5"
+#define FILE_REF_EXT2 "trefer_ext2.h5"
+#define FILE_REF_COMPAT "trefer_compat.h5"
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 4
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
/* 2-D dataset with fixed dimensions */
-#define SPACE2_RANK 2
-#define SPACE2_DIM1 10
-#define SPACE2_DIM2 10
+#define SPACE2_RANK 2
+#define SPACE2_DIM1 10
+#define SPACE2_DIM2 10
/* Larger 1-D dataset with fixed dimensions */
-#define SPACE3_RANK 1
-#define SPACE3_DIM1 100
+#define SPACE3_RANK 1
+#define SPACE3_DIM1 100
/* Element selection information */
#define POINT1_NPOINTS 10
@@ -57,6 +62,10 @@ typedef struct s1_t {
#define DSETNAME2 "dset2"
#define NAME_SIZE 16
+#define MAX_ITER_CREATE 1000
+#define MAX_ITER_WRITE MAX_ITER_CREATE
+#define MAX_ITER_READ MAX_ITER_CREATE
+
/****************************************************************
**
@@ -67,47 +76,58 @@ typedef struct s1_t {
static void
test_reference_params(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
- hid_t group; /* Group ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hid_t dapl_id; /* Dataset access property list */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t group; /* Group ID */
+ hid_t attr; /* Attribute ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hid_t aapl_id; /* Attribute access property list */
+ hid_t dapl_id; /* Dataset access property list */
hsize_t dims1[] = {SPACE1_DIM1};
- hobj_ref_t *wbuf, /* buffer to write to disk */
- *rbuf, /* buffer read from disk */
- *tbuf; /* temp. buffer read from disk */
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i; /* counting variables */
- const char *write_comment = "Foo!"; /* Comments for group */
- hid_t ret_id; /* Generic hid_t return value */
- ssize_t name_size; /* Size of reference name */
- herr_t ret; /* Generic return value */
+ H5R_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf, /* buffer read from disk */
+ *tbuf; /* temp. buffer read from disk */
+ unsigned *obuf;
+ H5R_type_t type; /* Reference type */
+ unsigned int i; /* Counters */
+ const char *write_comment = "Foo!"; /* Comments for group */
+ hid_t ret_id; /* Generic hid_t return value */
+ ssize_t name_size; /* Size of reference name */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Reference Parameters\n"));
/* Allocate write & read buffers */
- wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ wbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ obuf[i] = i * 3;
/* Create file */
- fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid1 = H5Fcreate(FILE_REF_PARAM, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for datasets */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create attribute access property list */
+ aapl_id = H5Pcreate(H5P_ATTRIBUTE_ACCESS);
+ CHECK(aapl_id, H5I_INVALID_HID, "H5Pcreate");
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
- CHECK(dapl_id, FAIL, "H5Pcreate");
-
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(group, FAIL, "H5Gcreate2");
+ CHECK(group, H5I_INVALID_HID, "H5Gcreate2");
/* Set group's comment */
ret = H5Oset_comment(group, write_comment);
@@ -115,13 +135,10 @@ test_reference_params(void)
/* Create a dataset (inside Group1) */
dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
-
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)i * 3;
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -130,7 +147,19 @@ test_reference_params(void)
/* Create another dataset (inside Group1) */
dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Create an attribute for the dataset */
+ attr = H5Acreate2(dataset, "Attr", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, obuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -138,7 +167,7 @@ test_reference_params(void)
/* Create a datatype to refer to */
tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
- CHECK(tid1, FAIL, "H5Tcreate");
+ CHECK(tid1, H5I_INVALID_HID, "H5Tcreate");
/* Insert fields */
ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
@@ -163,58 +192,88 @@ test_reference_params(void)
CHECK(ret, FAIL, "H5Gclose");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate2");
-
- /* Test parameters to H5Rcreate */
- ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
- VERIFY(ret, FAIL, "H5Rcreate ref");
- ret = H5Rcreate(&wbuf[0], (hid_t)-1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
- VERIFY(ret, FAIL, "H5Rcreate loc_id");
- ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, (hid_t)-1);
- VERIFY(ret, FAIL, "H5Rcreate name");
- ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, (hid_t)-1);
- VERIFY(ret, FAIL, "H5Rcreate null name");
- ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)-1);
- VERIFY(ret, FAIL, "H5Rcreate type");
- ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, (hid_t)-1);
- VERIFY(ret, FAIL, "H5Rcreate region space");
- ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)0);
- VERIFY(ret, FAIL, "H5Rcreate space");
-
- /* Test parameters to H5Rdereference */
- dset2 = H5Rdereference2((hid_t)-1, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]);
- VERIFY(dset2, FAIL, "H5Rdereference2 loc_id");
- dset2 = H5Rdereference2(dataset, (hid_t)-1, H5R_OBJECT, &rbuf[0]);
- VERIFY(dset2, FAIL, "H5Rdereference2 oapl_id");
- dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, NULL);
- VERIFY(dset2, FAIL, "H5Rdereference2 ref");
- dset2 = H5Rdereference2(dataset, dapl_id, H5R_MAXTYPE, &rbuf[0]);
- VERIFY(dset2, FAIL, "H5Rdereference2 type");
-
- /* Test parameters to H5Rget_obj_type2 */
- ret = H5Rget_obj_type2((hid_t)-1, H5R_OBJECT, &rbuf[0], NULL);
- VERIFY(ret, FAIL, "H5Rget_obj_type2 loc_id");
- ret = H5Rget_obj_type2(fid1, H5R_OBJECT, NULL, NULL);
- VERIFY(ret, FAIL, "H5Rget_obj_type2 ref");
- ret = H5Rget_obj_type2(fid1, H5R_MAXTYPE, &rbuf[0], NULL);
- VERIFY(ret, FAIL, "H5Rget_obj_type2 type");
-
- /* Test parameters to H5Rget_name */
- name_size = H5Rget_name((hid_t)-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0);
- VERIFY(name_size, FAIL, "H5Rget_name loc_id");
- name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0);
- VERIFY(name_size, FAIL, "H5Rget_name ref");
- name_size = H5Rget_name(fid1, H5R_MAXTYPE, &rbuf[0], NULL, 0);
- VERIFY(name_size, FAIL, "H5Rget_name type");
-
- /* Test parameters to H5Rget_region */
- ret_id = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]);
- VERIFY(ret_id, FAIL, "H5Rget_region loc_id");
- ret_id = H5Rget_region(fid1, H5R_OBJECT, NULL);
- VERIFY(ret_id, FAIL, "H5Rget_region ref");
- ret_id = H5Rget_region(fid1, H5R_OBJECT, &rbuf[0]);
- VERIFY(ret_id, FAIL, "H5Rget_region type");
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Test parameters to H5Rcreate_object */
+ ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, NULL);
+ VERIFY(ret, FAIL, "H5Rcreate_object ref");
+ ret = H5Rcreate_object(H5I_INVALID_HID, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_object loc_id");
+ ret = H5Rcreate_object(fid1, NULL, H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_object name");
+ ret = H5Rcreate_object(fid1, "", H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_object null name");
+
+ /* Test parameters to H5Rcreate_region */
+ ret = H5Rcreate_region(fid1, "/Group1/Dataset1", sid1, H5P_DEFAULT, NULL);
+ VERIFY(ret, FAIL, "H5Rcreate_region ref");
+ ret = H5Rcreate_region(H5I_INVALID_HID, "/Group1/Dataset1", sid1, H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_region loc_id");
+ ret = H5Rcreate_region(fid1, NULL, sid1, H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_region name");
+ ret = H5Rcreate_region(fid1, "/Group1/Dataset1", H5I_INVALID_HID, H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_region dataspace");
+
+ /* Test parameters to H5Rcreate_attr */
+ ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", "Attr", H5P_DEFAULT, NULL);
+ VERIFY(ret, FAIL, "H5Rcreate_attr ref");
+ ret = H5Rcreate_attr(H5I_INVALID_HID, "/Group1/Dataset2", "Attr", H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_attr loc_id");
+ ret = H5Rcreate_attr(fid1, NULL, "Attr", H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_attr name");
+ ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", NULL, H5P_DEFAULT, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcreate_attr attr_name");
+
+ /* Test parameters to H5Rdestroy */
+ ret = H5Rdestroy(NULL);
+ VERIFY(ret, FAIL, "H5Rdestroy");
+
+ /* Test parameters to H5Rget_type */
+ type = H5Rget_type(NULL);
+ VERIFY(type, H5R_BADTYPE, "H5Rget_type ref");
+
+ /* Test parameters to H5Requal */
+ ret = H5Requal(NULL, &rbuf[0]);
+ VERIFY(ret, FAIL, "H5Requal ref1");
+ ret = H5Requal(&rbuf[0], NULL);
+ VERIFY(ret, FAIL, "H5Requal ref2");
+
+ /* Test parameters to H5Rcopy */
+ ret = H5Rcopy(NULL, &wbuf[0]);
+ VERIFY(ret, FAIL, "H5Rcopy src_ref");
+ ret = H5Rcopy(&rbuf[0], NULL);
+ VERIFY(ret, FAIL, "H5Rcopy dest_ref");
+
+ /* Test parameters to H5Ropen_object */
+ dset2 = H5Ropen_object(&rbuf[0], H5I_INVALID_HID, H5I_INVALID_HID);
+ VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object oapl_id");
+ dset2 = H5Ropen_object(NULL, H5P_DEFAULT, dapl_id);
+ VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object ref");
+
+ /* Test parameters to H5Ropen_region */
+ ret_id = H5Ropen_region(NULL, H5I_INVALID_HID, H5I_INVALID_HID);
+ VERIFY(ret_id, H5I_INVALID_HID, "H5Ropen_region ref");
+
+ /* Test parameters to H5Ropen_attr */
+ ret_id = H5Ropen_attr(NULL, H5P_DEFAULT, aapl_id);
+ VERIFY(ret_id, H5I_INVALID_HID, "H5Ropen_attr ref");
+
+ /* Test parameters to H5Rget_obj_type3 */
+ ret = H5Rget_obj_type3(NULL, H5P_DEFAULT, NULL);
+ VERIFY(ret, FAIL, "H5Rget_obj_type3 ref");
+
+ /* Test parameters to H5Rget_file_name */
+ name_size = H5Rget_file_name(NULL, NULL, 0);
+ VERIFY(name_size, (-1), "H5Rget_file_name ref");
+
+ /* Test parameters to H5Rget_obj_name */
+ name_size = H5Rget_obj_name(NULL, H5P_DEFAULT, NULL, 0);
+ VERIFY(name_size, (-1), "H5Rget_obj_name ref");
+
+ /* Test parameters to H5Rget_attr_name */
+ name_size = H5Rget_attr_name(NULL, NULL, 0);
+ VERIFY(name_size, (-1), "H5Rget_attr_name ref");
/* Close disk dataspace */
ret = H5Sclose(sid1);
@@ -224,6 +283,10 @@ test_reference_params(void)
ret = H5Pclose(dapl_id);
CHECK(ret, FAIL, "H5Pclose");
+ /* Close attribute access property list */
+ ret = H5Pclose(aapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
@@ -236,7 +299,8 @@ test_reference_params(void)
HDfree(wbuf);
HDfree(rbuf);
HDfree(tbuf);
-} /* test_reference_obj() */
+ HDfree(obuf);
+} /* test_reference_params() */
/****************************************************************
**
@@ -247,63 +311,55 @@ test_reference_params(void)
static void
test_reference_obj(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
- hid_t group; /* Group ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1};
- hid_t dapl_id; /* Dataset access property list */
- hobj_ref_t *wbuf, /* buffer to write to disk */
- *rbuf, /* buffer read from disk */
- *tbuf; /* temp. buffer read from disk */
- hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */
- unsigned *tu32; /* Temporary pointer to uint32 data */
- int i, j; /* counting variables */
- const char *write_comment="Foo!"; /* Comments for group */
- char read_comment[10];
- H5O_type_t obj_type; /* Object type */
- ssize_t size; /* Comment length */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t dapl_id; /* Dataset access property list */
+ H5R_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
+ unsigned *ibuf, *obuf;
+ unsigned i, j; /* Counters */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Object Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
- tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+
+ for (i = 0; i < SPACE1_DIM1; i++)
+ obuf[i] = i * 3;
/* Create file */
- fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid1 = H5Fcreate(FILE_REF_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for datasets */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
- CHECK(dapl_id, FAIL, "H5Pcreate");
-
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(group, FAIL, "H5Gcreate2");
-
- /* Set group's comment */
- ret = H5Oset_comment(group, write_comment);
- CHECK(ret, FAIL, "H5Oset_comment");
+ CHECK(group, H5I_INVALID_HID, "H5Gcreate2");
/* Create a dataset (inside Group1) */
dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
-
- for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
- *tu32++ = (unsigned)i * 3;
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -320,7 +376,7 @@ test_reference_obj(void)
/* Create a datatype to refer to */
tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
- CHECK(tid1, FAIL, "H5Tcreate");
+ CHECK(tid1, H5I_INVALID_HID, "H5Tcreate");
/* Insert fields */
ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
@@ -345,39 +401,39 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Gclose");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate2");
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Create reference to dataset */
- ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[0], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to dataset */
- ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[1], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ ret = H5Rcreate_object(fid1, "/Group1/Dataset2", H5P_DEFAULT, &wbuf[1]);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ ret = H5Rget_obj_type3(&wbuf[1], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Create reference to group */
- ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[2], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type2");
+ ret = H5Rcreate_object(fid1, "/Group1", H5P_DEFAULT, &wbuf[2]);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
/* Create reference to named datatype */
- ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[3], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type2");
+ ret = H5Rcreate_object(fid1, "/Group1/Datatype1", H5P_DEFAULT, &wbuf[3]);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ ret = H5Rget_obj_type3(&wbuf[3], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ ret = H5Dwrite(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close disk dataspace */
@@ -393,58 +449,50 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open the file */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fopen");
+ fid1 = H5Fopen(FILE_REF_OBJ, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fopen");
/* Open the dataset */
dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dopen2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
/* Read selection from disk */
- ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
CHECK(ret, FAIL, "H5Dread");
/* Open dataset object */
- dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, &rbuf[0]);
- CHECK(dset2, FAIL, "H5Rdereference2");
+ dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
/* Check information in referenced dataset */
sid1 = H5Dget_space(dset2);
- CHECK(sid1, FAIL, "H5Dget_space");
+ CHECK(sid1, H5I_INVALID_HID, "H5Dget_space");
ret = (int)H5Sget_simple_extent_npoints(sid1);
- VERIFY(ret, 4, "H5Sget_simple_extent_npoints");
+ VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints");
/* Read from disk */
- ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tbuf);
+ ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
CHECK(ret, FAIL, "H5Dread");
- for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
- VERIFY(*tu32, (uint32_t)(i*3), "Data");
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(ibuf[i], i * 3, "Data");
/* Close dereferenced Dataset */
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
/* Open group object. GAPL isn't supported yet. But it's harmless to pass in */
- group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &rbuf[2]);
- CHECK(group, FAIL, "H5Rdereference2");
-
- /* Get group's comment */
- size = H5Oget_comment(group, read_comment, (size_t)10);
- CHECK(size, FAIL, "H5Oget_comment");
-
- /* Check for correct comment value */
- if(HDstrcmp(write_comment, read_comment) != 0)
- TestErrPrintf("Error! Incorrect group comment, wanted: %s, got: %s\n",write_comment,read_comment);
+ group = H5Ropen_object(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, H5I_INVALID_HID, "H5Ropen_object");
/* Close group */
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
/* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */
- tid1 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &rbuf[3]);
- CHECK(tid1, FAIL, "H5Rdereference2");
+ tid1 = H5Ropen_object(&rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(tid1, H5I_INVALID_HID, "H5Ropen_object");
/* Verify correct datatype */
{
@@ -457,14 +505,6 @@ test_reference_obj(void)
VERIFY(ret, 3, "H5Tget_nmembers");
}
- /* Attempting to retrieve type of object using non-valid refs */
- for(j = 0; j < 3; j++) {
- H5E_BEGIN_TRY {
- ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &nvrbuf[j], &obj_type);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Rget_obj_type2");
- } /* end for */
-
/* Close datatype */
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
@@ -481,10 +521,19 @@ test_reference_obj(void)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
+ /* Destroy references */
+ for(j = 0; j < SPACE1_DIM1; j++) {
+ ret = H5Rdestroy(&wbuf[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&rbuf[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+
/* Free memory buffers */
HDfree(wbuf);
HDfree(rbuf);
- HDfree(tbuf);
+ HDfree(ibuf);
+ HDfree(obuf);
} /* test_reference_obj() */
/****************************************************************
@@ -492,71 +541,82 @@ test_reference_obj(void)
** test_reference_region(): Test basic H5R (reference) object reference code.
** Tests references to various kinds of objects
**
+** Note: The libver_low/libver_high parameters are added to create the file
+** with the low and high bounds setting in fapl.
+** Please see the RFC for "H5Sencode/H5Sdecode Format Change".
+**
****************************************************************/
static void
-test_reference_region(void)
+test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid2; /* Dataspace ID #2 */
- hid_t dapl_id; /* Dataset access property list */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- 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 */
- hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t * coords; /* Coordinate buffer */
- hsize_t low[SPACE2_RANK]; /* Selection bounds */
- hsize_t high[SPACE2_RANK]; /* Selection bounds */
- hdset_reg_ref_t *wbuf, /* buffer to write to disk */
- *rbuf; /* buffer read from disk */
- hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */
- uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
- *drbuf; /* Buffer for reading numeric data from disk */
- uint8_t *tu8; /* Temporary pointer to uint8 data */
- H5O_type_t obj_type; /* Type of object */
- int i, j; /* counting variables */
- hssize_t hssize_ret; /* hssize_t return value */
- htri_t tri_ret; /* htri_t return value */
- herr_t ret; /* Generic return value */
- haddr_t addr = HADDR_UNDEF; /* test for undefined reference */
- hid_t dset_NA; /* Dataset id for undefined reference */
- hid_t space_NA; /* Dataspace id for undefined reference */
- hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */
- hdset_reg_ref_t wdata_NA[1], /* Write buffer */
- rdata_NA[1]; /* Read buffer */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t fapl; /* File access property list */
+ hid_t dset1, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid2; /* Dataspace ID #2 */
+ hid_t dapl_id; /* Dataset access property list */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ 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 */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t *coords; /* Coordinate buffer */
+ hsize_t low[SPACE2_RANK]; /* Selection bounds */
+ hsize_t high[SPACE2_RANK]; /* Selection bounds */
+ H5R_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
+ H5R_ref_t nvrbuf[3]={{{{0}}},{{{101}}},{{{255}}}}; /* buffer with non-valid refs */
+ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
+ *drbuf; /* Buffer for reading numeric data from disk */
+ uint8_t *tu8; /* Temporary pointer to uint8 data */
+ H5O_type_t obj_type; /* Type of object */
+ int i, j; /* Counters */
+ hssize_t hssize_ret; /* hssize_t return value */
+ htri_t tri_ret; /* htri_t return value */
+ herr_t ret; /* Generic return value */
+ hid_t dset_NA; /* Dataset id for undefined reference */
+ hid_t space_NA; /* Dataspace id for undefined reference */
+ hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */
+ H5R_ref_t rdata_NA[1]; /* Read buffer */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataset Region Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
- dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
+ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- /* Create file */
- fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
+ for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++)
+ *tu8++ = (uint8_t)(i * 3);
+
+ /* Create file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Set the low/high version bounds in fapl */
+ ret = H5Pset_libver_bounds(fapl, libver_low, libver_high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create file with the fapl */
+ fid1 = H5Fcreate(FILE_REF_REG, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for datasets */
sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
- CHECK(sid2, FAIL, "H5Screate_simple");
+ CHECK(sid2, H5I_INVALID_HID, "H5Screate_simple");
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
- CHECK(dapl_id, FAIL, "H5Pcreate");
-
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
/* Create a dataset */
dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset2, FAIL, "H5Dcreate2");
-
- for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++)
- *tu8++ = (uint8_t)(i * 3);
+ CHECK(dset2, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
ret = H5Dwrite(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
@@ -568,320 +628,353 @@ test_reference_region(void)
/* Create dataspace for the reference dataset */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset */
- dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate2");
-
- /* Create references */
-
- /* Select 6x6 hyperslab for first reference */
- start[0] = 2; start[1] = 2;
- stride[0] = 1; stride[1] = 1;
- count[0] = 1; count[1] = 1;
- block[0] = 6; block[1] = 6;
- ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- ret = (int)H5Sget_select_npoints(sid2);
- VERIFY(ret, 36, "H5Sget_select_npoints");
-
- /* Store first dataset region */
- ret = H5Rcreate(&wbuf[0], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
-
- /* Select sequence of ten points for second reference */
- coord1[0][0] = 6; coord1[0][1] = 9;
- coord1[1][0] = 2; coord1[1][1] = 2;
- coord1[2][0] = 8; coord1[2][1] = 4;
- coord1[3][0] = 1; coord1[3][1] = 6;
- coord1[4][0] = 2; coord1[4][1] = 8;
- coord1[5][0] = 3; coord1[5][1] = 2;
- coord1[6][0] = 0; coord1[6][1] = 4;
- coord1[7][0] = 9; coord1[7][1] = 0;
- coord1[8][0] = 7; coord1[8][1] = 1;
- coord1[9][0] = 3; coord1[9][1] = 3;
- ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
- CHECK(ret, FAIL, "H5Sselect_elements");
-
- ret = (int)H5Sget_select_npoints(sid2);
- VERIFY(ret, 10, "H5Sget_select_npoints");
-
- /* Store second dataset region */
- ret = H5Rcreate(&wbuf[1], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
- CHECK(ret, FAIL, "H5Rcreate");
-
- /* Select unlimited hyperslab for third reference */
- start[0] = 1; start[1] = 8;
- stride[0] = 4; stride[1] = 1;
- count[0] = H5S_UNLIMITED; count[1] = 1;
- block[0] = 2; block[1] = 2;
- ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- hssize_ret = H5Sget_select_npoints(sid2);
- VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
-
- /* Store third dataset region */
- ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
-
- /* Write selection to disk */
- ret = H5Dwrite(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
- CHECK(ret, FAIL, "H5Dwrite");
-
- /*
- * Store a dataset region reference which will not get written to disk
- */
-
- /* Create reference to an element in dset1 */
- ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord1);
- CHECK(ret, FAIL, "H5Sselect_elements");
- ret = H5Rcreate(&wdata_NA[0], fid1, "/Dataset1", H5R_DATASET_REGION, sid2);
- CHECK(ret, FAIL, "H5Rcreate");
-
- /* Create the dataspace of the region references */
- space_NA = H5Screate_simple(1, dims_NA, NULL);
- CHECK(space_NA, FAIL, "H5Screate_simple");
-
- /* Create the dataset and write the region references to it */
- dset_NA = H5Dcreate2(fid1, "DS_NA", H5T_STD_REF_DSETREG, space_NA, H5P_DEFAULT,
- H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset_NA, FAIL, "H5Dcreate");
-
- /* Close and release resources for undefined region reference tests */
- ret = H5Dclose(dset_NA);
- CHECK(ret, FAIL, "H5Dclose");
- ret = H5Sclose(space_NA);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Close disk dataspace */
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Close Dataset */
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Close uint8 dataset dataspace */
- ret = H5Sclose(sid2);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Close file */
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
-
- /* Re-open the file */
- fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fopen");
-
- /*
- * Start the test of an undefined reference
- */
-
- /* Open the dataset of the undefined references */
- dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT);
- CHECK(dset_NA, FAIL, "H5Dopen2");
-
- /* Read the data */
- ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA);
- CHECK(ret, FAIL, "H5Dread");
-
- /*
- * Dereference an undefined reference (should fail)
- */
H5E_BEGIN_TRY {
- dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]);
- } H5E_END_TRY;
- VERIFY(dset2, FAIL, "H5Rdereference2");
-
- /* Close and release resources. */
- ret = H5Dclose(dset_NA);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* This close should fail since H5Rdereference2 never created
- * the id of the referenced object. */
- H5E_BEGIN_TRY {
- ret = H5Dclose(dset2);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Dclose");
-
- /*
- * End the test of an undefined reference
- */
-
- /* Open the dataset */
- dset1 = H5Dopen2(fid1, "/Dataset1", H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dopen2");
-
- /* Read selection from disk */
- ret = H5Dread(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
- CHECK(ret, FAIL, "H5Dread");
-
- /* Try to read an unaddressed dataset */
- dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &addr);
- VERIFY(dset2, FAIL, "H5Rdereference2 haddr_undef");
-
- /* Try to open objects */
- dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
- CHECK(dset2, FAIL, "H5Rdereference2");
-
- /* Check what H5Rget_obj_type2 function returns */
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[0], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
-
- /* Check information in referenced dataset */
- sid1 = H5Dget_space(dset2);
- CHECK(sid1, FAIL, "H5Dget_space");
-
- ret = (int)H5Sget_simple_extent_npoints(sid1);
- VERIFY(ret, 100, "H5Sget_simple_extent_npoints");
-
- /* Read from disk */
- ret = H5Dread(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf);
- CHECK(ret, FAIL, "H5Dread");
-
- for(tu8 = (uint8_t *)drbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++, tu8++)
- VERIFY(*tu8, (uint8_t)(i * 3), "Data");
-
- /* Get the hyperslab selection */
- sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[0]);
- CHECK(sid2, FAIL, "H5Rget_region");
-
- /* Verify correct hyperslab selected */
- ret = (int)H5Sget_select_npoints(sid2);
- VERIFY(ret, 36, "H5Sget_select_npoints");
- ret = (int)H5Sget_select_hyper_nblocks(sid2);
- VERIFY(ret, 1, "H5Sget_select_hyper_nblocks");
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */
- ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords);
- CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
- VERIFY(coords[0], 2, "Hyperslab Coordinates");
- VERIFY(coords[1], 2, "Hyperslab Coordinates");
- VERIFY(coords[2], 7, "Hyperslab Coordinates");
- VERIFY(coords[3], 7, "Hyperslab Coordinates");
- HDfree(coords);
- ret = H5Sget_select_bounds(sid2, low, high);
- CHECK(ret, FAIL, "H5Sget_select_bounds");
- VERIFY(low[0], 2, "Selection Bounds");
- VERIFY(low[1], 2, "Selection Bounds");
- VERIFY(high[0], 7, "Selection Bounds");
- VERIFY(high[1], 7, "Selection Bounds");
-
- /* Close region space */
- ret = H5Sclose(sid2);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Get the element selection */
- sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[1]);
- CHECK(sid2, FAIL, "H5Rget_region");
-
- /* Verify correct elements selected */
- ret = (int)H5Sget_select_npoints(sid2);
- VERIFY(ret, 10, "H5Sget_select_npoints");
- ret = (int)H5Sget_select_elem_npoints(sid2);
- VERIFY(ret, 10, "H5Sget_select_elem_npoints");
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); /* allocate space for the element points */
- ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords);
- CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
- VERIFY(coords[0], coord1[0][0], "Element Coordinates");
- VERIFY(coords[1], coord1[0][1], "Element Coordinates");
- VERIFY(coords[2], coord1[1][0], "Element Coordinates");
- VERIFY(coords[3], coord1[1][1], "Element Coordinates");
- VERIFY(coords[4], coord1[2][0], "Element Coordinates");
- VERIFY(coords[5], coord1[2][1], "Element Coordinates");
- VERIFY(coords[6], coord1[3][0], "Element Coordinates");
- VERIFY(coords[7], coord1[3][1], "Element Coordinates");
- VERIFY(coords[8], coord1[4][0], "Element Coordinates");
- VERIFY(coords[9], coord1[4][1], "Element Coordinates");
- VERIFY(coords[10], coord1[5][0], "Element Coordinates");
- VERIFY(coords[11], coord1[5][1], "Element Coordinates");
- VERIFY(coords[12], coord1[6][0], "Element Coordinates");
- VERIFY(coords[13], coord1[6][1], "Element Coordinates");
- VERIFY(coords[14], coord1[7][0], "Element Coordinates");
- VERIFY(coords[15], coord1[7][1], "Element Coordinates");
- VERIFY(coords[16], coord1[8][0], "Element Coordinates");
- VERIFY(coords[17], coord1[8][1], "Element Coordinates");
- VERIFY(coords[18], coord1[9][0], "Element Coordinates");
- VERIFY(coords[19], coord1[9][1], "Element Coordinates");
- HDfree(coords);
- ret = H5Sget_select_bounds(sid2, low, high);
- CHECK(ret, FAIL, "H5Sget_select_bounds");
- VERIFY(low[0], 0, "Selection Bounds");
- VERIFY(low[1], 0, "Selection Bounds");
- VERIFY(high[0], 9, "Selection Bounds");
- VERIFY(high[1], 9, "Selection Bounds");
-
- /* Close region space */
- ret = H5Sclose(sid2);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Get the unlimited selection */
- sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[2]);
- CHECK(sid2, FAIL, "H5Rget_region");
-
- /* Verify correct hyperslab selected */
- hssize_ret = H5Sget_select_npoints(sid2);
- VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
- tri_ret = H5Sis_regular_hyperslab(sid2);
- CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab");
- VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result");
- ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block);
- CHECK(ret, FAIL, "H5Sget_regular_hyperslab");
- VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates");
- VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates");
- VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates");
- VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates");
- VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates");
- VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates");
- VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates");
- VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates");
-
- /* Close region space */
- ret = H5Sclose(sid2);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Close first space */
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ } H5E_END_TRY;
+
+ if(dset1 < 0) {
+ VERIFY(libver_high <= H5F_LIBVER_V110, TRUE, "H5Dcreate2");
+
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+ } else {
+
+ CHECK(dset1, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Create references */
+
+ /* Select 6x6 hyperslab for first reference */
+ start[0] = 2; start[1] = 2;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 6; block[1] = 6;
+ ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, 36, "H5Sget_select_npoints");
+
+ /* Store first dataset region */
+ ret = H5Rcreate_region(fid1, "/Dataset2", sid2, H5P_DEFAULT, &wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Select sequence of ten points for second reference */
+ coord1[0][0] = 6; coord1[0][1] = 9;
+ coord1[1][0] = 2; coord1[1][1] = 2;
+ coord1[2][0] = 8; coord1[2][1] = 4;
+ coord1[3][0] = 1; coord1[3][1] = 6;
+ coord1[4][0] = 2; coord1[4][1] = 8;
+ coord1[5][0] = 3; coord1[5][1] = 2;
+ coord1[6][0] = 0; coord1[6][1] = 4;
+ coord1[7][0] = 9; coord1[7][1] = 0;
+ coord1[8][0] = 7; coord1[8][1] = 1;
+ coord1[9][0] = 3; coord1[9][1] = 3;
+ ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, SPACE2_DIM2, "H5Sget_select_npoints");
+
+ /* Store second dataset region */
+ ret = H5Rcreate_region(fid1, "/Dataset2", sid2, H5P_DEFAULT, &wbuf[1]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+
+ /* Select unlimited hyperslab for third reference */
+ start[0] = 1;
+ start[1] = 8;
+ stride[0] = 4;
+ stride[1] = 1;
+ count[0] = H5S_UNLIMITED;
+ count[1] = 1;
+ block[0] = 2;
+ block[1] = 2;
+ ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ hssize_ret = H5Sget_select_npoints(sid2);
+ VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
+
+ /* Store third dataset region */
+ ret = H5Rcreate_region(fid1, "/Dataset2", sid2, H5P_DEFAULT, &wbuf[2]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+
+ ret = H5Rget_obj_type3(&wbuf[2], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Store fourth dataset region */
+ ret = H5Rcreate_region(fid1, "/Dataset2", sid2, H5P_DEFAULT, &wbuf[3]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dset1, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+
+ /*
+ * Store a dataset region reference which will not get written to disk
+ */
+
+ /* Create the dataspace of the region references */
+ space_NA = H5Screate_simple(1, dims_NA, NULL);
+ CHECK(space_NA, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create the dataset and write the region references to it */
+ dset_NA = H5Dcreate2(fid1, "DS_NA", H5T_STD_REF, space_NA, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_NA, H5I_INVALID_HID, "H5Dcreate");
+
+ /* Close and release resources for undefined region reference tests */
+ ret = H5Dclose(dset_NA);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Sclose(space_NA);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close uint8 dataset dataspace */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE_REF_REG, H5F_ACC_RDWR, fapl);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fopen");
+
+ /*
+ * Start the test of an undefined reference
+ */
+
+ /* Open the dataset of the undefined references */
+ dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT);
+ CHECK(dset_NA, H5I_INVALID_HID, "H5Dopen2");
+
+ /* Read the data */
+ ret = H5Dread(dset_NA, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /*
+ * Dereference an undefined reference (should fail)
+ */
+ H5E_BEGIN_TRY {
+ dset2 = H5Ropen_object(&rdata_NA[0], H5P_DEFAULT, H5P_DEFAULT);
+ } H5E_END_TRY;
+ VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object");
- /* Close dereferenced Dataset */
- ret = H5Dclose(dset2);
- CHECK(ret, FAIL, "H5Dclose");
+ /* Close and release resources. */
+ ret = H5Dclose(dset_NA);
+ CHECK(ret, FAIL, "H5Dclose");
- /* Attempting to retrieve type of object using non-valid refs */
- for(j = 0; j < 3; j++) {
+ /* This close should fail since H5Ropen_object never created
+ * the id of the referenced object. */
H5E_BEGIN_TRY {
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &nvrbuf[j], &obj_type);
+ ret = H5Dclose(dset2);
} H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Rget_obj_type2");
- } /* end for */
-
- /* Close Dataset */
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Close dataset access property list */
- ret = H5Pclose(dapl_id);
- CHECK(ret, FAIL, "H5Pclose");
+ VERIFY(ret, FAIL, "H5Dclose");
+
+ /*
+ * End the test of an undefined reference
+ */
+
+ /* Open the dataset */
+ dset1 = H5Dopen2(fid1, "/Dataset1", H5P_DEFAULT);
+ CHECK(dset1, H5I_INVALID_HID, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dset1, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Try to open objects */
+ dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
+
+ /* Check what H5Rget_obj_type3 function returns */
+ ret = H5Rget_obj_type3(&rbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Check information in referenced dataset */
+ sid1 = H5Dget_space(dset2);
+ CHECK(sid1, H5I_INVALID_HID, "H5Dget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid1);
+ VERIFY(ret, (SPACE2_DIM1 * SPACE2_DIM2), "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Dread(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ for(tu8 = (uint8_t *)drbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++, tu8++)
+ VERIFY(*tu8, (uint8_t)(i * 3), "Data");
+
+ /* Get the hyperslab selection */
+ sid2 = H5Ropen_region(&rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(sid2, H5I_INVALID_HID, "H5Ropen_region");
+
+ /* Verify correct hyperslab selected */
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, 36, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_hyper_nblocks(sid2);
+ VERIFY(ret, 1, "H5Sget_select_hyper_nblocks");
+
+ /* allocate space for the hyperslab blocks */
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2);
+
+ ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
+ VERIFY(coords[0], 2, "Hyperslab Coordinates");
+ VERIFY(coords[1], 2, "Hyperslab Coordinates");
+ VERIFY(coords[2], 7, "Hyperslab Coordinates");
+ VERIFY(coords[3], 7, "Hyperslab Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid2, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 2, "Selection Bounds");
+ VERIFY(low[1], 2, "Selection Bounds");
+ VERIFY(high[0], 7, "Selection Bounds");
+ VERIFY(high[1], 7, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Get the element selection */
+ sid2 = H5Ropen_region(&rbuf[1], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(sid2, H5I_INVALID_HID, "H5Ropen_region");
+
+ /* Verify correct elements selected */
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, SPACE2_DIM2, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_elem_npoints(sid2);
+ VERIFY(ret, SPACE2_DIM2, "H5Sget_select_elem_npoints");
+
+ /* allocate space for the element points */
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t));
+
+ ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
+ VERIFY(coords[0], coord1[0][0], "Element Coordinates");
+ VERIFY(coords[1], coord1[0][1], "Element Coordinates");
+ VERIFY(coords[2], coord1[1][0], "Element Coordinates");
+ VERIFY(coords[3], coord1[1][1], "Element Coordinates");
+ VERIFY(coords[4], coord1[2][0], "Element Coordinates");
+ VERIFY(coords[5], coord1[2][1], "Element Coordinates");
+ VERIFY(coords[6], coord1[3][0], "Element Coordinates");
+ VERIFY(coords[7], coord1[3][1], "Element Coordinates");
+ VERIFY(coords[8], coord1[4][0], "Element Coordinates");
+ VERIFY(coords[9], coord1[4][1], "Element Coordinates");
+ VERIFY(coords[10], coord1[5][0], "Element Coordinates");
+ VERIFY(coords[11], coord1[5][1], "Element Coordinates");
+ VERIFY(coords[12], coord1[6][0], "Element Coordinates");
+ VERIFY(coords[13], coord1[6][1], "Element Coordinates");
+ VERIFY(coords[14], coord1[7][0], "Element Coordinates");
+ VERIFY(coords[15], coord1[7][1], "Element Coordinates");
+ VERIFY(coords[16], coord1[8][0], "Element Coordinates");
+ VERIFY(coords[17], coord1[8][1], "Element Coordinates");
+ VERIFY(coords[18], coord1[9][0], "Element Coordinates");
+ VERIFY(coords[19], coord1[9][1], "Element Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid2, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 0, "Selection Bounds");
+ VERIFY(low[1], 0, "Selection Bounds");
+ VERIFY(high[0], 9, "Selection Bounds");
+ VERIFY(high[1], 9, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Get the unlimited selection */
+ sid2 = H5Ropen_region(&rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(sid2, H5I_INVALID_HID, "H5Ropen_region");
+
+ /* Verify correct hyperslab selected */
+ hssize_ret = H5Sget_select_npoints(sid2);
+ VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
+ tri_ret = H5Sis_regular_hyperslab(sid2);
+ CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab");
+ VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result");
+ ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sget_regular_hyperslab");
+ VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates");
+ VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates");
+ VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates");
+ VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates");
+ VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close first space */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close dereferenced Dataset */
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Attempting to retrieve type of object using non-valid refs */
+ for(j = 0; j < 3; j++) {
+ H5E_BEGIN_TRY {
+ ret = H5Rget_obj_type3(&nvrbuf[j], H5P_DEFAULT, &obj_type);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Rget_obj_type3");
+ } /* end for */
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Destroy references */
+ for(j = 0; j < SPACE1_DIM1; j++) {
+ ret = H5Rdestroy(&wbuf[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&rbuf[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(dwbuf);
+ HDfree(drbuf);
- /* Close file */
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
-
- /* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(dwbuf);
- HDfree(drbuf);
+ }
} /* test_reference_region() */
/****************************************************************
@@ -889,62 +982,75 @@ test_reference_region(void)
** test_reference_region_1D(): Test H5R (reference) object reference code.
** Tests 1-D references to various kinds of objects
**
+** Note: The libver_low/libver_high parameters are added to create the file
+** with the low and high bounds setting in fapl.
+** Please see the RFC for "H5Sencode/H5Sdecode Format Change".
+**
****************************************************************/
static void
-test_reference_region_1D(void)
+test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
- dset3; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid3; /* Dataspace ID #3 */
- hid_t dapl_id; /* Dataset access property list */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims3[] = {SPACE3_DIM1};
- hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
- hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
- hsize_t * coords; /* Coordinate buffer */
- hsize_t low[SPACE3_RANK]; /* Selection bounds */
- hsize_t high[SPACE3_RANK]; /* Selection bounds */
- hdset_reg_ref_t *wbuf, /* buffer to write to disk */
- *rbuf; /* buffer read from disk */
- uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
- *drbuf; /* Buffer for reading numeric data from disk */
- 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 */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t fapl; /* File access property list */
+ hid_t dset1, /* Dataset ID */
+ dset3; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid3; /* Dataspace ID #3 */
+ hid_t dapl_id; /* Dataset access property list */
+ hsize_t dims1[] = {2}, /* Must be 2 */
+ dims3[] = {SPACE3_DIM1};
+ hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t *coords; /* Coordinate buffer */
+ hsize_t low[SPACE3_RANK]; /* Selection bounds */
+ hsize_t high[SPACE3_RANK]; /* Selection bounds */
+ H5R_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
+ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
+ *drbuf; /* Buffer for reading numeric data from disk */
+ uint8_t *tu8; /* Temporary pointer to uint8 data */
+ H5O_type_t obj_type; /* Object type */
+ int i; /* Counter */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));
/* Allocate write & read buffers */
- wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
- dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1);
+ wbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
+ rbuf = HDcalloc(sizeof(H5R_ref_t), (size_t)SPACE1_DIM1);
+ dwbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
- /* Create file */
- fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
+ for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++)
+ *tu8++ = (uint8_t)(i * 3);
+
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Set the low/high version bounds in fapl */
+ ret = H5Pset_libver_bounds(fapl, libver_low, libver_high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create file with the fapl */
+ fid1 = H5Fcreate(FILE_REF_REG_1D, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for datasets */
sid3 = H5Screate_simple(SPACE3_RANK, dims3, NULL);
- CHECK(sid3, FAIL, "H5Screate_simple");
+ CHECK(sid3, H5I_INVALID_HID, "H5Screate_simple");
/* Create dataset access property list */
dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
- CHECK(dapl_id, FAIL, "H5Pcreate");
-
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
/* Create a dataset */
dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset3, FAIL, "H5Dcreate2");
-
- for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++)
- *tu8++ = (uint8_t)(i * 3);
+ CHECK(dset3, H5I_INVALID_HID, "H5Dcreate2");
/* Write selection to disk */
ret = H5Dwrite(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
@@ -956,217 +1062,258 @@ test_reference_region_1D(void)
/* Create dataspace for the reference dataset */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset */
- dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate2");
-
- /* Create references */
-
- /* Select 15 2x1 hyperslabs for first reference */
- start[0] = 2;
- stride[0] = 5;
- count[0] = 15;
- block[0] = 2;
- ret = H5Sselect_hyperslab(sid3, H5S_SELECT_SET, start, stride, count, block);
- CHECK(ret, FAIL, "H5Sselect_hyperslab");
-
- ret = (int)H5Sget_select_npoints(sid3);
- VERIFY(ret, 30, "H5Sget_select_npoints");
-
- /* Store first dataset region */
- ret = H5Rcreate(&wbuf[0], fid1, "/Dataset2", H5R_DATASET_REGION, sid3);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
-
- /* Select sequence of ten points for second reference */
- coord1[0][0] = 16;
- coord1[1][0] = 22;
- coord1[2][0] = 38;
- coord1[3][0] = 41;
- coord1[4][0] = 52;
- coord1[5][0] = 63;
- coord1[6][0] = 70;
- coord1[7][0] = 89;
- coord1[8][0] = 97;
- coord1[9][0] = 03;
- ret = H5Sselect_elements(sid3, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
- CHECK(ret, FAIL, "H5Sselect_elements");
-
- ret = (int)H5Sget_select_npoints(sid3);
- VERIFY(ret, 10, "H5Sget_select_npoints");
-
- /* Store second dataset region */
- ret = H5Rcreate(&wbuf[1], fid1, "/Dataset2", H5R_DATASET_REGION, sid3);
- CHECK(ret, FAIL, "H5Rcreate");
-
- /* Write selection to disk */
- ret = H5Dwrite(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
- CHECK(ret, FAIL, "H5Dwrite");
-
- /* Close disk dataspace */
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
-
- /* Close Dataset */
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Close uint8 dataset dataspace */
- ret = H5Sclose(sid3);
- CHECK(ret, FAIL, "H5Sclose");
+ H5E_BEGIN_TRY {
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ } H5E_END_TRY;
- /* Close file */
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
+ if(dset1 < 0) {
- /* Re-open the file */
- fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fopen");
+ VERIFY(libver_high <= H5F_LIBVER_V110, TRUE, "H5Dcreate2");
- /* Open the dataset */
- dset1 = H5Dopen2(fid1, "/Dataset1", H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dopen2");
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
- /* Read selection from disk */
- ret = H5Dread(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
- CHECK(ret, FAIL, "H5Dread");
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
- /* Try to open objects */
- dset3 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
- CHECK(dset3, FAIL, "H5Rdereference2");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
- /* Check what H5Rget_obj_type2 function returns */
- ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[0], &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
- /* Check information in referenced dataset */
- sid1 = H5Dget_space(dset3);
- CHECK(sid1, FAIL, "H5Dget_space");
-
- ret = (int)H5Sget_simple_extent_npoints(sid1);
- VERIFY(ret, 100, "H5Sget_simple_extent_npoints");
+ } else {
- /* Read from disk */
- ret = H5Dread(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf);
- CHECK(ret, FAIL, "H5Dread");
+ CHECK(ret, FAIL, "H5Dcreate2");
- for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++)
- VERIFY(*tu8, (uint8_t)(i * 3), "Data");
-
- /* Get the hyperslab selection */
- sid3 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[0]);
- CHECK(sid3, FAIL, "H5Rget_region");
-
- /* Verify correct hyperslab selected */
- ret = (int)H5Sget_select_npoints(sid3);
- VERIFY(ret, 30, "H5Sget_select_npoints");
- ret = (int)H5Sget_select_hyper_nblocks(sid3);
- VERIFY(ret, 15, "H5Sget_select_hyper_nblocks");
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */
- ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords);
- CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
- VERIFY(coords[0], 2, "Hyperslab Coordinates");
- VERIFY(coords[1], 3, "Hyperslab Coordinates");
- VERIFY(coords[2], 7, "Hyperslab Coordinates");
- VERIFY(coords[3], 8, "Hyperslab Coordinates");
- VERIFY(coords[4], 12, "Hyperslab Coordinates");
- VERIFY(coords[5], 13, "Hyperslab Coordinates");
- VERIFY(coords[6], 17, "Hyperslab Coordinates");
- VERIFY(coords[7], 18, "Hyperslab Coordinates");
- VERIFY(coords[8], 22, "Hyperslab Coordinates");
- VERIFY(coords[9], 23, "Hyperslab Coordinates");
- VERIFY(coords[10], 27, "Hyperslab Coordinates");
- VERIFY(coords[11], 28, "Hyperslab Coordinates");
- VERIFY(coords[12], 32, "Hyperslab Coordinates");
- VERIFY(coords[13], 33, "Hyperslab Coordinates");
- VERIFY(coords[14], 37, "Hyperslab Coordinates");
- VERIFY(coords[15], 38, "Hyperslab Coordinates");
- VERIFY(coords[16], 42, "Hyperslab Coordinates");
- VERIFY(coords[17], 43, "Hyperslab Coordinates");
- VERIFY(coords[18], 47, "Hyperslab Coordinates");
- VERIFY(coords[19], 48, "Hyperslab Coordinates");
- VERIFY(coords[20], 52, "Hyperslab Coordinates");
- VERIFY(coords[21], 53, "Hyperslab Coordinates");
- VERIFY(coords[22], 57, "Hyperslab Coordinates");
- VERIFY(coords[23], 58, "Hyperslab Coordinates");
- VERIFY(coords[24], 62, "Hyperslab Coordinates");
- VERIFY(coords[25], 63, "Hyperslab Coordinates");
- VERIFY(coords[26], 67, "Hyperslab Coordinates");
- VERIFY(coords[27], 68, "Hyperslab Coordinates");
- VERIFY(coords[28], 72, "Hyperslab Coordinates");
- VERIFY(coords[29], 73, "Hyperslab Coordinates");
- HDfree(coords);
- ret = H5Sget_select_bounds(sid3, low, high);
- CHECK(ret, FAIL, "H5Sget_select_bounds");
- VERIFY(low[0], 2, "Selection Bounds");
- VERIFY(high[0], 73, "Selection Bounds");
-
- /* Close region space */
- ret = H5Sclose(sid3);
- CHECK(ret, FAIL, "H5Sclose");
+ /* Create references */
- /* Get the element selection */
- sid3 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[1]);
- CHECK(sid3, FAIL, "H5Rget_region");
-
- /* Verify correct elements selected */
- ret = (int)H5Sget_select_npoints(sid3);
- VERIFY(ret, 10, "H5Sget_select_npoints");
- ret = (int)H5Sget_select_elem_npoints(sid3);
- VERIFY(ret, 10, "H5Sget_select_elem_npoints");
- coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); /* allocate space for the element points */
- ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords);
- CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
- VERIFY(coords[0], coord1[0][0], "Element Coordinates");
- VERIFY(coords[1], coord1[1][0], "Element Coordinates");
- VERIFY(coords[2], coord1[2][0], "Element Coordinates");
- VERIFY(coords[3], coord1[3][0], "Element Coordinates");
- VERIFY(coords[4], coord1[4][0], "Element Coordinates");
- VERIFY(coords[5], coord1[5][0], "Element Coordinates");
- VERIFY(coords[6], coord1[6][0], "Element Coordinates");
- VERIFY(coords[7], coord1[7][0], "Element Coordinates");
- VERIFY(coords[8], coord1[8][0], "Element Coordinates");
- VERIFY(coords[9], coord1[9][0], "Element Coordinates");
- HDfree(coords);
- ret = H5Sget_select_bounds(sid3, low, high);
- CHECK(ret, FAIL, "H5Sget_select_bounds");
- VERIFY(low[0], 3, "Selection Bounds");
- VERIFY(high[0], 97, "Selection Bounds");
-
- /* Close region space */
- ret = H5Sclose(sid3);
- CHECK(ret, FAIL, "H5Sclose");
+ /* Select 15 2x1 hyperslabs for first reference */
+ start[0] = 2;
+ stride[0] = 5;
+ count[0] = 15;
+ block[0] = 2;
+ ret = H5Sselect_hyperslab(sid3, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* Close first space */
- ret = H5Sclose(sid1);
- CHECK(ret, FAIL, "H5Sclose");
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, (block[0] * count[0]), "H5Sget_select_npoints");
+
+ /* Store first dataset region */
+ ret = H5Rcreate_region(fid1, "/Dataset2", sid3, H5P_DEFAULT, &wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Select sequence of ten points for second reference */
+ coord1[0][0] = 16;
+ coord1[1][0] = 22;
+ coord1[2][0] = 38;
+ coord1[3][0] = 41;
+ coord1[4][0] = 52;
+ coord1[5][0] = 63;
+ coord1[6][0] = 70;
+ coord1[7][0] = 89;
+ coord1[8][0] = 97;
+ coord1[9][0] = 03;
+ ret = H5Sselect_elements(sid3, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, POINT1_NPOINTS, "H5Sget_select_npoints");
+
+ /* Store second dataset region */
+ ret = H5Rcreate_region(fid1, "/Dataset2", sid3, H5P_DEFAULT, &wbuf[1]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dset1, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close uint8 dataset dataspace */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE_REF_REG_1D, H5F_ACC_RDWR, fapl);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fopen");
+
+ /* Open the dataset */
+ dset1 = H5Dopen2(fid1, "/Dataset1", H5P_DEFAULT);
+ CHECK(dset1, H5I_INVALID_HID, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dset1, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Try to open objects */
+ dset3 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
+ CHECK(dset3, H5I_INVALID_HID, "H5Ropen_object");
+
+ /* Check what H5Rget_obj_type3 function returns */
+ ret = H5Rget_obj_type3(&rbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Check information in referenced dataset */
+ sid1 = H5Dget_space(dset3);
+ CHECK(sid1, H5I_INVALID_HID, "H5Dget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid1);
+ VERIFY(ret, SPACE3_DIM1, "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Dread(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++)
+ VERIFY(*tu8, (uint8_t)(i * 3), "Data");
+
+ /* Get the hyperslab selection */
+ sid3 = H5Ropen_region(&rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(sid3, H5I_INVALID_HID, "H5Ropen_region");
+
+ /* Verify correct hyperslab selected */
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, 30, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_hyper_nblocks(sid3);
+ VERIFY(ret, 15, "H5Sget_select_hyper_nblocks");
+
+ /* allocate space for the hyperslab blocks */
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2);
+
+ ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
+ VERIFY(coords[0], 2, "Hyperslab Coordinates");
+ VERIFY(coords[1], 3, "Hyperslab Coordinates");
+ VERIFY(coords[2], 7, "Hyperslab Coordinates");
+ VERIFY(coords[3], 8, "Hyperslab Coordinates");
+ VERIFY(coords[4], 12, "Hyperslab Coordinates");
+ VERIFY(coords[5], 13, "Hyperslab Coordinates");
+ VERIFY(coords[6], 17, "Hyperslab Coordinates");
+ VERIFY(coords[7], 18, "Hyperslab Coordinates");
+ VERIFY(coords[8], 22, "Hyperslab Coordinates");
+ VERIFY(coords[9], 23, "Hyperslab Coordinates");
+ VERIFY(coords[10], 27, "Hyperslab Coordinates");
+ VERIFY(coords[11], 28, "Hyperslab Coordinates");
+ VERIFY(coords[12], 32, "Hyperslab Coordinates");
+ VERIFY(coords[13], 33, "Hyperslab Coordinates");
+ VERIFY(coords[14], 37, "Hyperslab Coordinates");
+ VERIFY(coords[15], 38, "Hyperslab Coordinates");
+ VERIFY(coords[16], 42, "Hyperslab Coordinates");
+ VERIFY(coords[17], 43, "Hyperslab Coordinates");
+ VERIFY(coords[18], 47, "Hyperslab Coordinates");
+ VERIFY(coords[19], 48, "Hyperslab Coordinates");
+ VERIFY(coords[20], 52, "Hyperslab Coordinates");
+ VERIFY(coords[21], 53, "Hyperslab Coordinates");
+ VERIFY(coords[22], 57, "Hyperslab Coordinates");
+ VERIFY(coords[23], 58, "Hyperslab Coordinates");
+ VERIFY(coords[24], 62, "Hyperslab Coordinates");
+ VERIFY(coords[25], 63, "Hyperslab Coordinates");
+ VERIFY(coords[26], 67, "Hyperslab Coordinates");
+ VERIFY(coords[27], 68, "Hyperslab Coordinates");
+ VERIFY(coords[28], 72, "Hyperslab Coordinates");
+ VERIFY(coords[29], 73, "Hyperslab Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid3, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 2, "Selection Bounds");
+ VERIFY(high[0], 73, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Get the element selection */
+ sid3 = H5Ropen_region(&rbuf[1], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(sid3, H5I_INVALID_HID, "H5Ropen_region");
+
+ /* Verify correct elements selected */
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, 10, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_elem_npoints(sid3);
+ VERIFY(ret, 10, "H5Sget_select_elem_npoints");
+
+ /* allocate space for the element points */
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t));
+
+ ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
+ VERIFY(coords[0], coord1[0][0], "Element Coordinates");
+ VERIFY(coords[1], coord1[1][0], "Element Coordinates");
+ VERIFY(coords[2], coord1[2][0], "Element Coordinates");
+ VERIFY(coords[3], coord1[3][0], "Element Coordinates");
+ VERIFY(coords[4], coord1[4][0], "Element Coordinates");
+ VERIFY(coords[5], coord1[5][0], "Element Coordinates");
+ VERIFY(coords[6], coord1[6][0], "Element Coordinates");
+ VERIFY(coords[7], coord1[7][0], "Element Coordinates");
+ VERIFY(coords[8], coord1[8][0], "Element Coordinates");
+ VERIFY(coords[9], coord1[9][0], "Element Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid3, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 3, "Selection Bounds");
+ VERIFY(high[0], 97, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close first space */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close dereferenced Dataset */
+ ret = H5Dclose(dset3);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file access property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Destroy references */
+ for(i = 0; i < 2; i++) {
+ ret = H5Rdestroy(&wbuf[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&rbuf[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(dwbuf);
+ HDfree(drbuf);
- /* Close dereferenced Dataset */
- ret = H5Dclose(dset3);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Close Dataset */
- ret = H5Dclose(dset1);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Close dataset access property list */
- ret = H5Pclose(dapl_id);
- CHECK(ret, FAIL, "H5Pclose");
-
- /* Close file */
- ret = H5Fclose(fid1);
- CHECK(ret, FAIL, "H5Fclose");
-
- /* Free memory buffers */
- HDfree(wbuf);
- HDfree(rbuf);
- HDfree(dwbuf);
- HDfree(drbuf);
+ }
} /* test_reference_region_1D() */
/****************************************************************
@@ -1178,44 +1325,43 @@ test_reference_region_1D(void)
static void
test_reference_obj_deleted(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
- hid_t sid1; /* Dataspace ID */
- hobj_ref_t oref; /* Object Reference to test */
- H5O_type_t obj_type; /* Object type */
- haddr_t addr = HADDR_UNDEF; /* test for undefined reference */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ H5R_ref_t oref; /* Object Reference to test */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
/* Create file */
- fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid1 = H5Fcreate(FILE_REF_OBJ_DEL, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
/* Create scalar dataspace for datasets */
sid1 = H5Screate_simple(0, NULL, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
/* Create a dataset to reference (deleted later) */
dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
/* Create a dataset */
- dataset = H5Dcreate2(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ dataset = H5Dcreate2(fid1, "Dataset2", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Create reference to dataset */
- ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, (hid_t)-1);
- CHECK(ret, FAIL, "H5Rcreate");
- ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &oref, &obj_type);
- CHECK(ret, FAIL, "H5Rget_obj_type2");
- VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+ ret = H5Rcreate_object(fid1, "/Dataset1", H5P_DEFAULT, &oref);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ ret = H5Rget_obj_type3(&oref, H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Write selection to disk */
- ret = H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &oref);
+ ret = H5Dwrite(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, &oref);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -1234,31 +1380,25 @@ test_reference_obj_deleted(void)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
+ /* Destroy reference */
+ ret = H5Rdestroy(&oref);
+ CHECK(ret, FAIL, "H5Rdestroy");
+
/* Re-open the file */
- fid1 = H5Fopen(FILE3, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fopen");
+ fid1 = H5Fopen(FILE_REF_OBJ_DEL, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fopen");
/* Open the dataset */
dataset = H5Dopen2(fid1, "/Dataset2", H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dopen2");
-
- /* Open undefined reference */
- dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &addr);
- VERIFY(dset2, FAIL, "H5Rdereference2");
+ CHECK(ret, H5I_INVALID_HID, "H5Dopen2");
/* Read selection from disk */
- HDmemset(&oref, 0, sizeof(hobj_ref_t));
- ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &oref);
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, &oref);
CHECK(ret, FAIL, "H5Dread");
/* Open deleted dataset object */
- dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &oref);
- VERIFY(dset2, FAIL, "H5Rdereference2");
-
- /* Open nonsense reference */
- HDmemset(&oref, 0, sizeof(hobj_ref_t));
- dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &oref);
- VERIFY(dset2, FAIL, "H5Rdereference2");
+ dset2 = H5Ropen_object(&oref, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(dset2, H5I_INVALID_HID, "H5Ropen_object");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1267,6 +1407,10 @@ test_reference_obj_deleted(void)
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
+
+ /* Destroy reference */
+ ret = H5Rdestroy(&oref);
+ CHECK(ret, FAIL, "H5Rdestroy");
} /* test_reference_obj_deleted() */
/****************************************************************
@@ -1276,7 +1420,7 @@ test_reference_obj_deleted(void)
**
****************************************************************/
static herr_t
-test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *info,
+test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t H5_ATTR_UNUSED *info,
void *op_data)
{
int *count = (int *)op_data; /* Pointer to name counter */
@@ -1322,57 +1466,57 @@ test_reference_group(void)
hid_t gid = -1, gid2 = -1; /* Group IDs */
hid_t did; /* Dataset ID */
hid_t sid; /* Dataspace ID */
- hobj_ref_t wref; /* Reference to write */
- hobj_ref_t rref; /* Reference to read */
+ H5R_ref_t wref; /* Reference to write */
+ H5R_ref_t rref; /* Reference to read */
H5G_info_t ginfo; /* Group info struct */
char objname[NAME_SIZE]; /* Buffer to store name */
- H5O_info_t oinfo; /* Object info struct */
+ H5O_info2_t oinfo; /* Object info struct */
int count = 0; /* Count within iterated group */
ssize_t size; /* Name length */
herr_t ret;
/* Create file with a group and a dataset containing an object reference to the group */
- fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fcreate");
+ fid = H5Fcreate(FILE_REF_GRP, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace to use for dataset */
sid = H5Screate(H5S_SCALAR);
- CHECK(sid, FAIL, "H5Screate");
+ CHECK(sid, H5I_INVALID_HID, "H5Screate");
/* Create group to refer to */
gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(gid, FAIL, "H5Gcreate2");
+ CHECK(gid, H5I_INVALID_HID, "H5Gcreate2");
/* Create nested groups */
gid2 = H5Gcreate2(gid, GROUPNAME2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(gid2, FAIL, "H5Gcreate2");
+ CHECK(gid2, H5I_INVALID_HID, "H5Gcreate2");
ret = H5Gclose(gid2);
CHECK(ret, FAIL, "H5Gclose");
gid2 = H5Gcreate2(gid, GROUPNAME3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(gid2, FAIL, "H5Gcreate2");
+ CHECK(gid2, H5I_INVALID_HID, "H5Gcreate2");
ret = H5Gclose(gid2);
CHECK(ret, FAIL, "H5Gclose");
/* Create bottom dataset */
did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(did > 0);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
ret = H5Dclose(did);
- assert(ret >= 0);
+ CHECK(ret, FAIL, "H5Dclose");
ret = H5Gclose(gid);
CHECK(ret, FAIL, "H5Gclose");
/* Create dataset */
- did = H5Dcreate2(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate2");
+ did = H5Dcreate2(fid, DSETNAME, H5T_STD_REF, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
/* Create reference to group */
- ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, (hid_t)-1);
- CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rcreate_object(fid, GROUPNAME, H5P_DEFAULT, &wref);
+ CHECK(ret, FAIL, "H5Rcreate_object");
/* Write reference to disk */
- ret = H5Dwrite(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wref);
+ ret = H5Dwrite(did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wref);
CHECK(ret, FAIL, "H5Dwrite");
/* Close objects */
@@ -1383,25 +1527,28 @@ test_reference_group(void)
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
+ /* Destroy reference */
+ ret = H5Rdestroy(&wref);
+ CHECK(ret, FAIL, "H5Rdestroy");
/* Re-open file */
- fid = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid, FAIL, "H5Fopen");
+ fid = H5Fopen(FILE_REF_GRP, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
/* Re-open dataset */
did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dopen2");
+ CHECK(did, H5I_INVALID_HID, "H5Dopen2");
/* Read in the reference */
- ret = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rref);
+ ret = H5Dread(did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rref);
CHECK(ret, FAIL, "H5Dread");
/* Dereference to get the group */
- gid = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &rref);
- CHECK(gid, FAIL, "H5Rdereference2");
+ gid = H5Ropen_object(&rref, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, H5I_INVALID_HID, "H5Ropen_object");
/* Iterate through objects in dereferenced group */
- ret = H5Literate(gid, H5_INDEX_NAME, H5_ITER_INC, NULL, test_deref_iter_op, &count);
+ ret = H5Literate2(gid, H5_INDEX_NAME, H5_ITER_INC, NULL, test_deref_iter_op, &count);
CHECK(ret, FAIL, "H5Literate");
/* Various queries on the group opened */
@@ -1410,12 +1557,12 @@ test_reference_group(void)
VERIFY(ginfo.nlinks, 3, "H5Gget_info");
size = H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, objname, (size_t)NAME_SIZE, H5P_DEFAULT);
- CHECK(size, FAIL, "H5Lget_name_by_idx");
+ CHECK(size, (-1), "H5Lget_name_by_idx");
VERIFY_STR(objname, DSETNAME2, "H5Lget_name_by_idx");
- ret = H5Oget_info_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &oinfo, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Oget_info_by_idx");
- VERIFY(oinfo.type, H5O_TYPE_DATASET, "H5Oget_info_by_idx");
+ ret = H5Oget_info_by_idx3(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_idx3");
+ VERIFY(oinfo.type, H5O_TYPE_DATASET, "H5Oget_info_by_idx3");
/* Unlink one of the objects in the dereferenced group */
ret = H5Ldelete(gid, GROUPNAME2, H5P_DEFAULT);
@@ -1432,66 +1579,616 @@ test_reference_group(void)
CHECK(ret, FAIL, "H5Gclose");
ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
+
+ /* Destroy reference */
+ ret = H5Rdestroy(&rref);
+ CHECK(ret, FAIL, "H5Rdestroy");
} /* test_reference_group() */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
/****************************************************************
**
-** test_reference_compat(): Test basic H5R (reference) object reference code.
-** Tests deprecated API routines
+** test_reference_attr(): Test basic H5R (reference) attribute reference code.
+** Tests references to attributes on various kinds of objects
+**
+****************************************************************/
+static void
+test_reference_attr(void)
+{
+ hid_t fid; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t attr; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {SPACE1_DIM1};
+ hid_t dapl_id; /* Dataset access property list */
+ H5R_ref_t ref_wbuf[SPACE1_DIM1], /* Buffer to write to disk */
+ ref_rbuf[SPACE1_DIM1]; /* Buffer read from disk */
+ unsigned wbuf[SPACE1_DIM1], rbuf[SPACE1_DIM1];
+ unsigned i; /* Local index variables */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Attribute Reference Functions\n"));
+
+ /* Create file */
+ fid = H5Fcreate(FILE_REF_ATTR, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid = H5Screate_simple(SPACE1_RANK, dims, NULL);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create a group */
+ group = H5Gcreate2(fid, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, H5I_INVALID_HID, "H5Gcreate2");
+
+ /* Create an attribute for the dataset */
+ attr = H5Acreate2(group, "Attr2", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 1;
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Create a dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Create an attribute for the dataset */
+ attr = H5Acreate2(dataset, "Attr1", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = i * 3;
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create another dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a datatype to refer to */
+ tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
+ CHECK(tid, H5I_INVALID_HID, "H5Tcreate");
+
+ /* Insert fields */
+ ret = H5Tinsert(tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ /* Save datatype for later */
+ ret = H5Tcommit2(group, "Datatype1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Create an attribute for the datatype */
+ attr = H5Acreate2(tid, "Attr3", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 2;
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close datatype */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid, "Dataset3", H5T_STD_REF, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Create reference to dataset1 attribute */
+ ret = H5Rcreate_attr(fid, "/Group1/Dataset1", "Attr1", H5P_DEFAULT, &ref_wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Create reference to dataset2 attribute */
+ ret = H5Rcreate_attr(fid, "/Group1/Dataset2", "Attr1", H5P_DEFAULT, &ref_wbuf[1]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[1], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Create reference to group attribute */
+ ret = H5Rcreate_attr(fid, "/Group1", "Attr2", H5P_DEFAULT, &ref_wbuf[2]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[2], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
+
+ /* Create reference to named datatype attribute */
+ ret = H5Rcreate_attr(fid, "/Group1/Datatype1", "Attr3", H5P_DEFAULT, &ref_wbuf[3]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[3], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid = H5Fopen(FILE_REF_ATTR, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid, "/Dataset3", H5P_DEFAULT);
+ CHECK(ret, H5I_INVALID_HID, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Open attribute on dataset object */
+ attr = H5Ropen_attr(&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+
+ /* Check information in referenced dataset */
+ sid = H5Aget_space(attr);
+ CHECK(sid, H5I_INVALID_HID, "H5Aget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid);
+ VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
+ CHECK(ret, FAIL, "H5Aread");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], i * 3, "Data");
+
+ /* Close dereferenced Dataset */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Open attribute on group object */
+ attr = H5Ropen_attr(&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+
+ /* Read from disk */
+ ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
+ CHECK(ret, FAIL, "H5Aread");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 1, "Data");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Open attribute on named datatype object */
+ attr = H5Ropen_attr(&ref_rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+
+ /* Read from disk */
+ ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
+ CHECK(ret, FAIL, "H5Aread");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 2, "Data");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ for (i = 0; i < SPACE1_DIM1; i++) {
+ ret = H5Rdestroy(&ref_wbuf[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&ref_rbuf[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+} /* test_reference_attr() */
+
+/****************************************************************
+**
+** test_reference_external():
+** Tests external references on various kinds of objects
**
****************************************************************/
static void
-test_reference_compat(void)
+test_reference_external(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, dset2; /* Dataset ID */
- hid_t group, group2; /* Group ID */
- hid_t sid1, /* Dataspace IDs */
- sid2;
- hid_t tid1, tid2; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1},
- dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- 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 */
- hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hobj_ref_t *wbuf_obj, /* Buffer to write to disk */
- *rbuf_obj; /* Buffer read from disk */
- hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */
- *rbuf_reg; /* Buffer read from disk */
- H5G_obj_t obj_type; /* Object type */
- herr_t ret; /* Generic return value */
+ hid_t fid1, fid2; /* HDF5 File ID */
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t attr; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid; /* Datatype ID */
+ hsize_t dims[] = {SPACE1_DIM1};
+ hid_t dapl_id; /* Dataset access property list */
+ H5R_ref_t ref_wbuf[SPACE1_DIM1], /* Buffer to write to disk */
+ ref_rbuf[SPACE1_DIM1]; /* Buffer read from disk */
+ unsigned wbuf[SPACE1_DIM1], rbuf[SPACE1_DIM1];
+ unsigned i; /* Local index variables */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing External References Functions\n"));
+
+ /* Create file */
+ fid1 = H5Fcreate(FILE_REF_EXT1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid = H5Screate_simple(SPACE1_RANK, dims, NULL);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create a group */
+ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, H5I_INVALID_HID, "H5Gcreate2");
+
+ /* Create an attribute for the dataset */
+ attr = H5Acreate2(group, "Attr2", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 1;
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Create a dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Create an attribute for the dataset */
+ attr = H5Acreate2(dataset, "Attr1", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = i * 3;
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create another dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a datatype to refer to */
+ tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
+ CHECK(tid, H5I_INVALID_HID, "H5Tcreate");
+
+ /* Insert fields */
+ ret = H5Tinsert(tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ /* Save datatype for later */
+ ret = H5Tcommit2(group, "Datatype1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Create an attribute for the datatype */
+ attr = H5Acreate2(tid, "Attr3", H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Acreate2");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ wbuf[i] = (i * 3) + 2;
+
+ /* Write attribute to disk */
+ ret = H5Awrite(attr, H5T_NATIVE_UINT, wbuf);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close datatype */
+ ret = H5Tclose(tid);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create reference to dataset1 attribute */
+ ret = H5Rcreate_attr(fid1, "/Group1/Dataset1", "Attr1", H5P_DEFAULT, &ref_wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Create reference to dataset2 attribute */
+ ret = H5Rcreate_attr(fid1, "/Group1/Dataset2", "Attr1", H5P_DEFAULT, &ref_wbuf[1]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[1], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ /* Create reference to group attribute */
+ ret = H5Rcreate_attr(fid1, "/Group1", "Attr2", H5P_DEFAULT, &ref_wbuf[2]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[2], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
+
+ /* Create reference to named datatype attribute */
+ ret = H5Rcreate_attr(fid1, "/Group1/Datatype1", "Attr3", H5P_DEFAULT, &ref_wbuf[3]);
+ CHECK(ret, FAIL, "H5Rcreate_attr");
+ ret = H5Rget_obj_type3(&ref_wbuf[3], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create file */
+ fid2 = H5Fcreate(FILE_REF_EXT2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid2, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid = H5Screate_simple(SPACE1_RANK, dims, NULL);
+ CHECK(sid, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid2, "Dataset3", H5T_STD_REF, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close file */
+ ret = H5Fclose(fid2);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid2 = H5Fopen(FILE_REF_EXT2, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid2, FAIL, "H5Fopen");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid2, "/Dataset3", H5P_DEFAULT);
+ CHECK(ret, H5I_INVALID_HID, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Open attribute on dataset object */
+ attr = H5Ropen_attr(&ref_rbuf[0], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+
+ /* Check information in referenced dataset */
+ sid = H5Aget_space(attr);
+ CHECK(sid, H5I_INVALID_HID, "H5Aget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid);
+ VERIFY(ret, SPACE1_DIM1, "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
+ CHECK(ret, FAIL, "H5Aread");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], i * 3, "Data");
+
+ /* Close dereferenced Dataset */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Open attribute on group object */
+ attr = H5Ropen_attr(&ref_rbuf[2], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+
+ /* Read from disk */
+ ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
+ CHECK(ret, FAIL, "H5Aread");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 1, "Data");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Open attribute on named datatype object */
+ attr = H5Ropen_attr(&ref_rbuf[3], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attr, H5I_INVALID_HID, "H5Ropen_attr");
+
+ /* Read from disk */
+ ret = H5Aread(attr, H5T_NATIVE_UINT, rbuf);
+ CHECK(ret, FAIL, "H5Aread");
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ VERIFY(rbuf[i], (i * 3) + 2, "Data");
+
+ /* Close attribute */
+ ret = H5Aclose(attr);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ /* Close dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid2);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ for (i = 0; i < SPACE1_DIM1; i++) {
+ ret = H5Rdestroy(&ref_wbuf[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&ref_rbuf[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+} /* test_reference_external() */
+
+/****************************************************************
+**
+** test_reference_compat_conv(): Test basic H5R (reference) object reference code.
+** Tests deprecated API routines and type conversion.
+**
+****************************************************************/
+static void
+test_reference_compat_conv(void)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, dset2; /* Dataset ID */
+ hid_t group, group2; /* Group ID */
+ hid_t sid1, sid2, sid3; /* Dataspace IDs */
+ hid_t tid1, tid2; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2},
+ dims3[] = {SPACE1_DIM1}; /* Purposedly set dimension larger to test NULL references */
+ 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 */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hobj_ref_t *wbuf_obj; /* Buffer to write to disk */
+ H5R_ref_t *rbuf_obj; /* Buffer read from disk */
+ hdset_reg_ref_t *wbuf_reg; /* Buffer to write to disk */
+ H5R_ref_t *rbuf_reg; /* Buffer read from disk */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
+ unsigned int i; /* Counter */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deprecated Object Reference Functions\n"));
/* Allocate write & read buffers */
wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
- rbuf_obj = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1);
- wbuf_reg = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
- rbuf_reg = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
+ rbuf_obj = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg = HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ rbuf_reg = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
/* Create file */
- fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fcreate");
+ fid1 = H5Fcreate(FILE_REF_COMPAT, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
/* Create dataspace for datasets */
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
- CHECK(sid1, FAIL, "H5Screate_simple");
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
/* Create another dataspace for datasets */
sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
- CHECK(sid2, FAIL, "H5Screate_simple");
+ CHECK(sid2, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create another dataspace for datasets */
+ sid3 = H5Screate_simple(SPACE1_RANK, dims3, NULL);
+ CHECK(sid3, H5I_INVALID_HID, "H5Screate_simple");
/* Create a group */
group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(group, FAIL, "H5Gcreate2");
+ CHECK(group, H5I_INVALID_HID, "H5Gcreate2");
/* Create a dataset (inside Group1) */
dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1499,7 +2196,7 @@ test_reference_compat(void)
/* Create another dataset (inside Group1) */
dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1507,7 +2204,7 @@ test_reference_compat(void)
/* Create a datatype to refer to */
tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
- CHECK(tid1, FAIL, "H5Tcreate");
+ CHECK(tid1, H5I_INVALID_HID, "H5Tcreate");
/* Insert fields */
ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
@@ -1531,25 +2228,24 @@ test_reference_compat(void)
ret = H5Gclose(group);
CHECK(ret, FAIL, "H5Gclose");
-
/* Create a dataset with object reference datatype */
dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Create reference to dataset */
- ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
+ ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, H5I_INVALID_HID);
CHECK(ret, FAIL, "H5Rcreate");
/* Create reference to dataset */
- ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1);
+ ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, H5I_INVALID_HID);
CHECK(ret, FAIL, "H5Rcreate");
/* Create reference to group */
- ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1);
+ ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, H5I_INVALID_HID);
CHECK(ret, FAIL, "H5Rcreate");
/* Create reference to named datatype */
- ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1);
+ ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, H5I_INVALID_HID);
CHECK(ret, FAIL, "H5Rcreate");
/* Write references to disk */
@@ -1560,16 +2256,19 @@ test_reference_compat(void)
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
-
/* Create a dataset with region reference datatype */
- dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate2");
+ dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* Select 6x6 hyperslab for first reference */
- start[0] = 2; start[1] = 2;
- stride[0] = 1; stride[1] = 1;
- count[0] = 1; count[1] = 1;
- block[0] = 6; block[1] = 6;
+ start[0] = 2;
+ start[1] = 2;
+ stride[0] = 1;
+ stride[1] = 1;
+ count[0] = 1;
+ count[1] = 1;
+ block[0] = 6;
+ block[1] = 6;
ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
@@ -1603,69 +2302,69 @@ test_reference_compat(void)
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
-
/* Close disk dataspaces */
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
ret = H5Sclose(sid2);
CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
/* Close file */
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-
/* Re-open the file */
- fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK(fid1, FAIL, "H5Fopen");
+ fid1 = H5Fopen(FILE_REF_COMPAT, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fopen");
/* Open the object reference dataset */
dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dopen2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
/* Read selection from disk */
- ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_obj);
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_obj);
CHECK(ret, FAIL, "H5Dread");
/* Verify type of objects pointed at */
- obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[0]);
- CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
- VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+ ret = H5Rget_obj_type3(&rbuf_obj[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
- obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[1]);
- CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
- VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+ ret = H5Rget_obj_type3(&rbuf_obj[1], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
- obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[2]);
- CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
- VERIFY(obj_type, H5G_GROUP, "H5Rget_obj_type1");
+ ret = H5Rget_obj_type3(&rbuf_obj[2], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type3");
- obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[3]);
- CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
- VERIFY(obj_type, H5G_TYPE, "H5Rget_obj_type1");
+ ret = H5Rget_obj_type3(&rbuf_obj[3], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type3");
/* Make sure the referenced objects can be opened */
- dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[0]);
- CHECK(dset2, FAIL, "H5Rdereference1");
+ dset2 = H5Ropen_object(&rbuf_obj[0], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[1]);
- CHECK(dset2, FAIL, "H5Rdereference1");
+ dset2 = H5Ropen_object(&rbuf_obj[1], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- group2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[2]);
- CHECK(group2, FAIL, "H5Rdereference1");
+ group2 = H5Ropen_object(&rbuf_obj[2], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Gclose(group2);
CHECK(ret, FAIL, "H5Gclose");
- tid2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[3]);
- CHECK(tid2, FAIL, "H5Rdereference1");
+ tid2 = H5Ropen_object(&rbuf_obj[3], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(tid2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
@@ -1677,36 +2376,30 @@ test_reference_compat(void)
/* Open the dataset region reference dataset */
dataset = H5Dopen2(fid1, "/Dataset4", H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dopen2");
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
/* Read selection from disk */
- ret = H5Dread(dataset, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg);
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg);
CHECK(ret, FAIL, "H5Dread");
/* Verify type of objects pointed at */
- obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[0]);
- CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
- VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
-
- obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[1]);
- CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
- VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+ ret = H5Rget_obj_type3(&rbuf_reg[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
- obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[2]);
- VERIFY(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
-
- obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[3]);
- VERIFY(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ ret = H5Rget_obj_type3(&rbuf_reg[1], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
/* Make sure the referenced objects can be opened */
- dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[0]);
- CHECK(dset2, FAIL, "H5Rdereference1");
+ dset2 = H5Ropen_object(&rbuf_reg[0], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
- dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[1]);
- CHECK(dset2, FAIL, "H5Rdereference1");
+ dset2 = H5Ropen_object(&rbuf_reg[1], H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
@@ -1719,13 +2412,440 @@ test_reference_compat(void)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
+ /* Destroy references */
+ for(i = 0; i < dims1[0]; i++) {
+ ret = H5Rdestroy(&rbuf_obj[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+ for(i = 0; i < dims3[0]; i++) {
+ ret = H5Rdestroy(&rbuf_reg[i]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+
/* Free memory buffers */
HDfree(wbuf_obj);
HDfree(rbuf_obj);
HDfree(wbuf_reg);
HDfree(rbuf_reg);
} /* test_reference_compat() */
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+/****************************************************************
+**
+** test_reference_perf(): Test basic H5R (reference) object reference
+** performance.
+**
+****************************************************************/
+static void
+test_reference_perf(void)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hsize_t dims1[] = {1};
+ hid_t dapl_id; /* Dataset access property list */
+ H5R_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf, /* buffer read from disk */
+ *tbuf; /* temp. buffer read from disk */
+ H5R_ref_t *wbuf_reg, /* buffer to write to disk */
+ *rbuf_reg; /* buffer read from disk */
+ hobj_ref_t *wbuf_deprec,/* deprecated references */
+ *rbuf_deprec;/* deprecated references */
+ hdset_reg_ref_t *wbuf_reg_deprec, /* deprecated references*/
+ *rbuf_reg_deprec; /* deprecated references*/
+ unsigned *ibuf, *obuf;
+ unsigned i, j; /* Counters */
+ H5O_type_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
+ double t1, t2, t; /* Timers */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Object Reference Performance\n"));
+
+ /* Allocate write & read buffers */
+ wbuf = HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ obuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ ibuf = HDcalloc(sizeof(unsigned), SPACE1_DIM1);
+ wbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ rbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_deprec = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ tbuf = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ rbuf_reg = (H5R_ref_t *)HDcalloc(sizeof(H5R_ref_t), SPACE1_DIM1);
+ wbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ rbuf_reg_deprec = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+
+ for(i = 0; i < SPACE1_DIM1; i++)
+ obuf[i] = i * 3;
+
+ /* Create file */
+ fid1 = H5Fcreate(FILE_REF_OBJ, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, H5I_INVALID_HID, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create a group */
+ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, H5I_INVALID_HID, "H5Gcreate2");
+
+ /* Create a dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create another dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a datatype to refer to */
+ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
+ CHECK(tid1, H5I_INVALID_HID, "H5Tcreate");
+
+ /* Insert fields */
+ ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ /* Save datatype for later */
+ ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Close datatype */
+ ret = H5Tclose(tid1);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_CREATE; i++) {
+ t1 = H5_get_time();
+ ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ ret = H5Rdestroy(&wbuf[0]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Object reference create time: %lfs\n", t / MAX_ITER_CREATE);
+
+ /* Create reference to dataset */
+ ret = H5Rcreate_object(fid1, "/Group1/Dataset1", H5P_DEFAULT, &wbuf[0]);
+ CHECK(ret, FAIL, "H5Rcreate_object");
+ ret = H5Rget_obj_type3(&wbuf[0], H5P_DEFAULT, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type3");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type3");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_WRITE; i++) {
+ t1 = H5_get_time();
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Object reference write time: %lfs\n", t / MAX_ITER_WRITE);
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_CREATE; i++) {
+ t1 = H5_get_time();
+ ret = H5Rcreate(&wbuf_deprec[0], fid1, "/Group1/Dataset1", H5R_OBJECT1, H5I_INVALID_HID);
+ CHECK(ret, FAIL, "H5Rcreate");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Deprecated object reference create time: %lfs\n", t / MAX_ITER_CREATE);
+
+ /* Create reference to dataset */
+ ret = H5Rcreate(&wbuf_deprec[0], fid1, "/Group1/Dataset1", H5R_OBJECT1, H5I_INVALID_HID);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_WRITE; i++) {
+ t1 = H5_get_time();
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf_deprec);
+ CHECK(ret, FAIL, "H5Dwrite");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Deprecated object reference write time: %lfs\n", t / MAX_ITER_WRITE);
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset5", H5T_STD_REF, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_CREATE; i++) {
+ t1 = H5_get_time();
+ /* Store first dataset region */
+ ret = H5Rcreate_region(fid1, "/Group1/Dataset1", sid1, H5P_DEFAULT, &wbuf_reg[0]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ ret = H5Rdestroy(&wbuf_reg[0]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Region reference create time: %lfs\n", t / MAX_ITER_CREATE);
+
+ /* Store first dataset region */
+ ret = H5Rcreate_region(fid1, "/Group1/Dataset1", sid1, H5P_DEFAULT, &wbuf_reg[0]);
+ CHECK(ret, FAIL, "H5Rcreate_region");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_WRITE; i++) {
+ t1 = H5_get_time();
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf_reg);
+ CHECK(ret, FAIL, "H5Dwrite");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Region reference write time: %lfs\n", t / MAX_ITER_WRITE);
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset6", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_CREATE; i++) {
+ t1 = H5_get_time();
+ /* Store first dataset region */
+ ret = H5Rcreate(&wbuf_reg_deprec[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION1, sid1);
+ CHECK(ret, FAIL, "H5Rcreate");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Deprecated region reference create time: %lfs\n", t / MAX_ITER_CREATE);
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_WRITE; i++) {
+ t1 = H5_get_time();
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf_reg_deprec);
+ CHECK(ret, FAIL, "H5Dwrite");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Deprecated region reference write time: %lfs\n", t / MAX_ITER_WRITE);
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE_REF_OBJ, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, H5I_INVALID_HID, "H5Fopen");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_READ; i++) {
+ t1 = H5_get_time();
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ ret = H5Rdestroy(&rbuf[0]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Object reference read time: %lfs\n", t / MAX_ITER_READ);
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Open dataset object */
+ dset2 = H5Ropen_object(&rbuf[0], H5P_DEFAULT, dapl_id);
+ CHECK(dset2, H5I_INVALID_HID, "H5Ropen_object");
+
+ /* Check information in referenced dataset */
+ sid1 = H5Dget_space(dset2);
+ CHECK(sid1, H5I_INVALID_HID, "H5Dget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid1);
+ VERIFY(ret, dims1[0], "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ for(i = 0; i < dims1[0]; i++)
+ VERIFY(ibuf[i], i * 3, "Data");
+
+ /* Close dereferenced Dataset */
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid1, "/Dataset4", H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_READ; i++) {
+ t1 = H5_get_time();
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_deprec);
+ CHECK(ret, FAIL, "H5Dread");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Deprecated object reference read time: %lfs\n", t / MAX_ITER_READ);
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid1, "/Dataset5", H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_READ; i++) {
+ t1 = H5_get_time();
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg);
+ CHECK(ret, FAIL, "H5Dread");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ ret = H5Rdestroy(&rbuf_reg[0]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Region reference read time: %lfs\n", t / MAX_ITER_READ);
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid1, "/Dataset6", H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
+
+ t = 0;
+ for(i = 0; i < MAX_ITER_READ; i++) {
+ t1 = H5_get_time();
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg_deprec);
+ CHECK(ret, FAIL, "H5Dread");
+ t2 = H5_get_time();
+ t += t2 - t1;
+ }
+ if(VERBOSE_MED)
+ HDprintf("--- Deprecated region reference read time: %lfs\n", t / MAX_ITER_READ);
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Destroy references */
+ for(j = 0; j < dims1[0]; j++) {
+ ret = H5Rdestroy(&wbuf[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&wbuf_reg[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&rbuf[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ ret = H5Rdestroy(&rbuf_reg[j]);
+ CHECK(ret, FAIL, "H5Rdestroy");
+ }
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(wbuf_reg);
+ HDfree(rbuf_reg);
+ HDfree(wbuf_deprec);
+ HDfree(rbuf_deprec);
+ HDfree(wbuf_reg_deprec);
+ HDfree(rbuf_reg_deprec);
+ HDfree(tbuf);
+ HDfree(ibuf);
+ HDfree(obuf);
+} /* test_reference_perf() */
/****************************************************************
**
@@ -1735,30 +2855,47 @@ test_reference_compat(void)
void
test_reference(void)
{
+ H5F_libver_t low, high; /* Low and high bounds */
+
/* Output message about test being performed */
MESSAGE(5, ("Testing References\n"));
test_reference_params(); /* Test for correct parameter checking */
test_reference_obj(); /* Test basic H5R object reference code */
- test_reference_region(); /* Test basic H5R dataset region reference code */
- test_reference_region_1D(); /* Test H5R dataset region reference code for 1-D datasets */
- test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
- test_reference_group(); /* Test operations on dereferenced groups */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
- test_reference_compat(); /* Test operations with old API routines */
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
+
+ test_reference_region(low, high); /* Test basic H5R dataset region reference code */
+ test_reference_region_1D(low, high); /* Test H5R dataset region reference code for 1-D datasets */
+
+ } /* end high bound */
+ } /* end low bound */
+
+ test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
+ test_reference_group(); /* Test operations on dereferenced groups */
+ test_reference_attr(); /* Test attribute references */
+ test_reference_external(); /* Test external references */
+ test_reference_compat_conv(); /* Test operations with old types */
+
+ test_reference_perf();
} /* test_reference() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_reference
+ * Function: cleanup_reference
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* September 8, 1998
*
* Modifications:
@@ -1768,8 +2905,14 @@ test_reference(void)
void
cleanup_reference(void)
{
- remove(FILE1);
- remove(FILE2);
- remove(FILE3);
+ HDremove(FILE_REF_PARAM);
+ HDremove(FILE_REF_OBJ);
+ HDremove(FILE_REF_REG);
+ HDremove(FILE_REF_REG_1D);
+ HDremove(FILE_REF_OBJ_DEL);
+ HDremove(FILE_REF_GRP);
+ HDremove(FILE_REF_ATTR);
+ HDremove(FILE_REF_EXT1);
+ HDremove(FILE_REF_EXT2);
+ HDremove(FILE_REF_COMPAT);
}
-
diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c
new file mode 100644
index 0000000..db91b8e
--- /dev/null
+++ b/test/trefer_deprec.c
@@ -0,0 +1,1827 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/***********************************************************
+*
+* Test program: trefer_deprec
+*
+* Test the Reference functionality
+*
+*************************************************************/
+
+#include "testhdf5.h"
+
+#define FILE1 "trefer1.h5"
+#define FILE2 "trefer2.h5"
+#define FILE3 "trefer3.h5"
+
+/* 1-D dataset with fixed dimensions */
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
+
+/* 2-D dataset with fixed dimensions */
+#define SPACE2_RANK 2
+#define SPACE2_DIM1 10
+#define SPACE2_DIM2 10
+
+/* Larger 1-D dataset with fixed dimensions */
+#define SPACE3_RANK 1
+#define SPACE3_DIM1 100
+
+/* Element selection information */
+#define POINT1_NPOINTS 10
+
+/* Compound datatype */
+typedef struct s1_t {
+ unsigned int a;
+ unsigned int b;
+ float c;
+} s1_t;
+
+#define GROUPNAME "/group"
+#define GROUPNAME2 "group2"
+#define GROUPNAME3 "group3"
+#define DSETNAME "/dset"
+#define DSETNAME2 "dset2"
+#define NAME_SIZE 16
+
+
+/****************************************************************
+**
+** test_reference_params(): Test basic H5R (reference) parameters
+** for correct processing
+**
+****************************************************************/
+static void
+test_reference_params(void)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hid_t dapl_id; /* Dataset access property list */
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hobj_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf, /* buffer read from disk */
+ *tbuf; /* temp. buffer read from disk */
+ unsigned *tu32; /* Temporary pointer to uint32 data */
+ int i; /* counting variables */
+ const char *write_comment = "Foo!"; /* Comments for group */
+ hid_t ret_id; /* Generic hid_t return value */
+ ssize_t name_size; /* Size of reference name */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Reference Parameters\n"));
+
+ /* Allocate write & read buffers */
+ wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+
+ /* Create file */
+ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
+ /* Create a group */
+ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, FAIL, "H5Gcreate2");
+
+ /* Set group's comment */
+ ret = H5Oset_comment(group, write_comment);
+ CHECK(ret, FAIL, "H5Oset_comment");
+
+ /* Create a dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
+ *tu32++ = (unsigned)i * 3;
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create another dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a datatype to refer to */
+ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
+ CHECK(tid1, FAIL, "H5Tcreate");
+
+ /* Insert fields */
+ ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ /* Save datatype for later */
+ ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Close datatype */
+ ret = H5Tclose(tid1);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
+
+ /* Test parameters to H5Rcreate */
+ ret = H5Rcreate(NULL, fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
+ VERIFY(ret, FAIL, "H5Rcreate ref");
+ ret = H5Rcreate(&wbuf[0], (hid_t)-1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
+ VERIFY(ret, FAIL, "H5Rcreate loc_id");
+ ret = H5Rcreate(&wbuf[0], fid1, NULL, H5R_OBJECT, (hid_t)-1);
+ VERIFY(ret, FAIL, "H5Rcreate name");
+ ret = H5Rcreate(&wbuf[0], fid1, "", H5R_OBJECT, (hid_t)-1);
+ VERIFY(ret, FAIL, "H5Rcreate null name");
+ ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)-1);
+ VERIFY(ret, FAIL, "H5Rcreate type");
+ ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, (hid_t)-1);
+ VERIFY(ret, FAIL, "H5Rcreate region space");
+ ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_MAXTYPE, (hid_t)0);
+ VERIFY(ret, FAIL, "H5Rcreate space");
+
+ /* Test parameters to H5Rdereference */
+ dset2 = H5Rdereference2((hid_t)-1, H5P_DEFAULT, H5R_OBJECT, &rbuf[0]);
+ VERIFY(dset2, FAIL, "H5Rdereference2 loc_id");
+ dset2 = H5Rdereference2(dataset, (hid_t)-1, H5R_OBJECT, &rbuf[0]);
+ VERIFY(dset2, FAIL, "H5Rdereference2 oapl_id");
+ dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, NULL);
+ VERIFY(dset2, FAIL, "H5Rdereference2 ref");
+ dset2 = H5Rdereference2(dataset, dapl_id, H5R_MAXTYPE, &rbuf[0]);
+ VERIFY(dset2, FAIL, "H5Rdereference2 type");
+
+ /* Test parameters to H5Rget_obj_type2 */
+ ret = H5Rget_obj_type2((hid_t)-1, H5R_OBJECT, &rbuf[0], NULL);
+ VERIFY(ret, FAIL, "H5Rget_obj_type2 loc_id");
+ ret = H5Rget_obj_type2(fid1, H5R_OBJECT, NULL, NULL);
+ VERIFY(ret, FAIL, "H5Rget_obj_type2 ref");
+ ret = H5Rget_obj_type2(fid1, H5R_MAXTYPE, &rbuf[0], NULL);
+ VERIFY(ret, FAIL, "H5Rget_obj_type2 type");
+
+ /* Test parameters to H5Rget_name */
+ name_size = H5Rget_name((hid_t)-1, H5R_DATASET_REGION, &rbuf[0], NULL, 0);
+ VERIFY(name_size, FAIL, "H5Rget_name loc_id");
+ name_size = H5Rget_name(fid1, H5R_DATASET_REGION, NULL, NULL, 0);
+ VERIFY(name_size, FAIL, "H5Rget_name ref");
+ name_size = H5Rget_name(fid1, H5R_MAXTYPE, &rbuf[0], NULL, 0);
+ VERIFY(name_size, FAIL, "H5Rget_name type");
+
+ /* Test parameters to H5Rget_region */
+ ret_id = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]);
+ VERIFY(ret_id, FAIL, "H5Rget_region loc_id");
+ ret_id = H5Rget_region(fid1, H5R_OBJECT, NULL);
+ VERIFY(ret_id, FAIL, "H5Rget_region ref");
+ ret_id = H5Rget_region(fid1, H5R_OBJECT, &rbuf[0]);
+ VERIFY(ret_id, FAIL, "H5Rget_region type");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(tbuf);
+} /* test_reference_obj() */
+
+/****************************************************************
+**
+** test_reference_obj(): Test basic H5R (reference) object reference code.
+** Tests references to various kinds of objects
+**
+****************************************************************/
+static void
+test_reference_obj(void)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t dapl_id; /* Dataset access property list */
+ hobj_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf, /* buffer read from disk */
+ *tbuf; /* temp. buffer read from disk */
+ hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */
+ unsigned *tu32; /* Temporary pointer to uint32 data */
+ int i, j; /* counting variables */
+ const char *write_comment="Foo!"; /* Comments for group */
+ char read_comment[10];
+ H5O_type_t obj_type; /* Object type */
+ ssize_t size; /* Comment length */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Object Reference Functions\n"));
+
+ /* Allocate write & read buffers */
+ wbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ rbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+ tbuf = (hobj_ref_t *)HDmalloc(MAX(sizeof(unsigned), sizeof(hobj_ref_t)) * SPACE1_DIM1);
+
+ /* Create file */
+ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
+ /* Create a group */
+ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, FAIL, "H5Gcreate2");
+
+ /* Set group's comment */
+ ret = H5Oset_comment(group, write_comment);
+ CHECK(ret, FAIL, "H5Oset_comment");
+
+ /* Create a dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
+ *tu32++ = (unsigned)i * 3;
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create another dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a datatype to refer to */
+ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
+ CHECK(tid1, FAIL, "H5Tcreate");
+
+ /* Insert fields */
+ ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ /* Save datatype for later */
+ ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Close datatype */
+ ret = H5Tclose(tid1);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Create reference to dataset */
+ ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[0], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Create reference to dataset */
+ ret = H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[1], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Create reference to group */
+ ret = H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[2], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_GROUP, "H5Rget_obj_type2");
+
+ /* Create reference to named datatype */
+ ret = H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &wbuf[3], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_NAMED_DATATYPE, "H5Rget_obj_type2");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fopen");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Open dataset object */
+ dset2 = H5Rdereference2(dataset, dapl_id, H5R_OBJECT, &rbuf[0]);
+ CHECK(dset2, FAIL, "H5Rdereference2");
+
+ /* Check information in referenced dataset */
+ sid1 = H5Dget_space(dset2);
+ CHECK(sid1, FAIL, "H5Dget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid1);
+ VERIFY(ret, 4, "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++)
+ VERIFY(*tu32, (uint32_t)(i*3), "Data");
+
+ /* Close dereferenced Dataset */
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Open group object. GAPL isn't supported yet. But it's harmless to pass in */
+ group = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &rbuf[2]);
+ CHECK(group, FAIL, "H5Rdereference2");
+
+ /* Get group's comment */
+ size = H5Oget_comment(group, read_comment, (size_t)10);
+ CHECK(size, FAIL, "H5Oget_comment");
+
+ /* Check for correct comment value */
+ if(HDstrcmp(write_comment, read_comment) != 0)
+ TestErrPrintf("Error! Incorrect group comment, wanted: %s, got: %s\n",write_comment,read_comment);
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open datatype object. TAPL isn't supported yet. But it's harmless to pass in */
+ tid1 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &rbuf[3]);
+ CHECK(tid1, FAIL, "H5Rdereference2");
+
+ /* Verify correct datatype */
+ {
+ H5T_class_t tclass;
+
+ tclass = H5Tget_class(tid1);
+ VERIFY(tclass, H5T_COMPOUND, "H5Tget_class");
+
+ ret= H5Tget_nmembers(tid1);
+ VERIFY(ret, 3, "H5Tget_nmembers");
+ }
+
+ /* Attempting to retrieve type of object using non-valid refs */
+ for(j = 0; j < 3; j++) {
+ H5E_BEGIN_TRY {
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &nvrbuf[j], &obj_type);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Rget_obj_type2");
+ } /* end for */
+
+ /* Close datatype */
+ ret = H5Tclose(tid1);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(tbuf);
+} /* test_reference_obj() */
+
+/****************************************************************
+**
+** test_reference_region(): Test basic H5R (reference) object reference code.
+** Tests references to various kinds of objects
+**
+** Note: The libver_low/libver_high parameters are added to create the file
+** with the low and high bounds setting in fapl.
+** Please see the RFC for "H5Sencode/H5Sdecode Format Change".
+**
+****************************************************************/
+static void
+test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t fapl = -1; /* File access property list */
+ hid_t dset1, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid2; /* Dataspace ID #2 */
+ hid_t dapl_id; /* Dataset access property list */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ 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 */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t *coords; /* Coordinate buffer */
+ hsize_t low[SPACE2_RANK]; /* Selection bounds */
+ hsize_t high[SPACE2_RANK]; /* Selection bounds */
+ hdset_reg_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
+ hdset_reg_ref_t nvrbuf[3]={{{0}},{{101}},{{255}}}; /* buffer with non-valid refs */
+ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
+ *drbuf; /* Buffer for reading numeric data from disk */
+ uint8_t *tu8; /* Temporary pointer to uint8 data */
+ H5O_type_t obj_type; /* Type of object */
+ int i, j; /* counting variables */
+ hssize_t hssize_ret; /* hssize_t return value */
+ htri_t tri_ret; /* htri_t return value */
+ herr_t ret; /* Generic return value */
+ hdset_reg_ref_t undef_reg[1]; /* test for undefined reference */
+ hid_t dset_NA; /* Dataset id for undefined reference */
+ hid_t space_NA; /* Dataspace id for undefined reference */
+ hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */
+ hdset_reg_ref_t wdata_NA[1], /* Write buffer */
+ rdata_NA[1]; /* Read buffer */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Dataset Region Reference Functions\n"));
+
+ /* Allocate write & read buffers */
+ wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
+ rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
+ dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
+ drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
+
+ /* Create file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set the low/high version bounds in fapl */
+ ret = H5Pset_libver_bounds(fapl, libver_low, libver_high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create file with the fapl */
+ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
+ CHECK(sid2, FAIL, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
+ /* Create a dataset */
+ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+
+ for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++)
+ *tu8++ = (uint8_t)(i * 3);
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create dataspace for the reference dataset */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Create a dataset */
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+
+ /* Create references */
+
+ /* Select 6x6 hyperslab for first reference */
+ start[0] = 2; start[1] = 2;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 6; block[1] = 6;
+ ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, 36, "H5Sget_select_npoints");
+
+ /* Store first dataset region */
+ ret = H5Rcreate(&wbuf[0], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Select sequence of ten points for second reference */
+ coord1[0][0] = 6; coord1[0][1] = 9;
+ coord1[1][0] = 2; coord1[1][1] = 2;
+ coord1[2][0] = 8; coord1[2][1] = 4;
+ coord1[3][0] = 1; coord1[3][1] = 6;
+ coord1[4][0] = 2; coord1[4][1] = 8;
+ coord1[5][0] = 3; coord1[5][1] = 2;
+ coord1[6][0] = 0; coord1[6][1] = 4;
+ coord1[7][0] = 9; coord1[7][1] = 0;
+ coord1[8][0] = 7; coord1[8][1] = 1;
+ coord1[9][0] = 3; coord1[9][1] = 3;
+ ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, 10, "H5Sget_select_npoints");
+
+ /* Store second dataset region */
+ ret = H5Rcreate(&wbuf[1], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Select unlimited hyperslab for third reference */
+ start[0] = 1; start[1] = 8;
+ stride[0] = 4; stride[1] = 1;
+ count[0] = H5S_UNLIMITED; count[1] = 1;
+ block[0] = 2; block[1] = 2;
+ ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ hssize_ret = H5Sget_select_npoints(sid2);
+ VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
+
+ /* Store third dataset region */
+ H5E_BEGIN_TRY {
+ ret = H5Rcreate(&wbuf[2], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
+ } H5E_END_TRY;
+
+ if(libver_high < H5F_LIBVER_V110)
+ VERIFY(ret, FAIL, "H5Rcreate");
+ else
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /*
+ * Store a dataset region reference which will not get written to disk
+ */
+
+ /* Create reference to an element in dset1 */
+ ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+ ret = H5Rcreate(&wdata_NA[0], fid1, "/Dataset1", H5R_DATASET_REGION, sid2);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Create the dataspace of the region references */
+ space_NA = H5Screate_simple(1, dims_NA, NULL);
+ CHECK(space_NA, FAIL, "H5Screate_simple");
+
+ /* Create the dataset and write the region references to it */
+ dset_NA = H5Dcreate2(fid1, "DS_NA", H5T_STD_REF_DSETREG, space_NA, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_NA, FAIL, "H5Dcreate");
+
+ /* Close and release resources for undefined region reference tests */
+ ret = H5Dclose(dset_NA);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Sclose(space_NA);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close uint8 dataset dataspace */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl);
+ CHECK(fid1, FAIL, "H5Fopen");
+
+ /*
+ * Start the test of an undefined reference
+ */
+
+ /* Open the dataset of the undefined references */
+ dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT);
+ CHECK(dset_NA, FAIL, "H5Dopen2");
+
+ /* Read the data */
+ ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /*
+ * Dereference an undefined reference (should fail)
+ */
+ H5E_BEGIN_TRY {
+ dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]);
+ } H5E_END_TRY;
+ VERIFY(dset2, FAIL, "H5Rdereference2");
+
+ /* Close and release resources. */
+ ret = H5Dclose(dset_NA);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* This close should fail since H5Rdereference2 never created
+ * the id of the referenced object. */
+ H5E_BEGIN_TRY {
+ ret = H5Dclose(dset2);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Dclose");
+
+ /*
+ * End the test of an undefined reference
+ */
+
+ /* Open the dataset */
+ dset1 = H5Dopen2(fid1, "/Dataset1", H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Try to read an unaddressed dataset */
+ dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, undef_reg);
+ VERIFY(dset2, FAIL, "H5Rdereference2 haddr_undef");
+
+ /* Try to open objects */
+ dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
+ CHECK(dset2, FAIL, "H5Rdereference2");
+
+ /* Check what H5Rget_obj_type2 function returns */
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[0], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Check information in referenced dataset */
+ sid1 = H5Dget_space(dset2);
+ CHECK(sid1, FAIL, "H5Dget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid1);
+ VERIFY(ret, 100, "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Dread(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ for(tu8 = (uint8_t *)drbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++, tu8++)
+ VERIFY(*tu8, (uint8_t)(i * 3), "Data");
+
+ /* Get the hyperslab selection */
+ sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[0]);
+ CHECK(sid2, FAIL, "H5Rget_region");
+
+ /* Verify correct hyperslab selected */
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, 36, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_hyper_nblocks(sid2);
+ VERIFY(ret, 1, "H5Sget_select_hyper_nblocks");
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */
+ ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
+ VERIFY(coords[0], 2, "Hyperslab Coordinates");
+ VERIFY(coords[1], 2, "Hyperslab Coordinates");
+ VERIFY(coords[2], 7, "Hyperslab Coordinates");
+ VERIFY(coords[3], 7, "Hyperslab Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid2, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 2, "Selection Bounds");
+ VERIFY(low[1], 2, "Selection Bounds");
+ VERIFY(high[0], 7, "Selection Bounds");
+ VERIFY(high[1], 7, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Get the element selection */
+ sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[1]);
+ CHECK(sid2, FAIL, "H5Rget_region");
+
+ /* Verify correct elements selected */
+ ret = (int)H5Sget_select_npoints(sid2);
+ VERIFY(ret, 10, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_elem_npoints(sid2);
+ VERIFY(ret, 10, "H5Sget_select_elem_npoints");
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t)); /* allocate space for the element points */
+ ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
+ VERIFY(coords[0], coord1[0][0], "Element Coordinates");
+ VERIFY(coords[1], coord1[0][1], "Element Coordinates");
+ VERIFY(coords[2], coord1[1][0], "Element Coordinates");
+ VERIFY(coords[3], coord1[1][1], "Element Coordinates");
+ VERIFY(coords[4], coord1[2][0], "Element Coordinates");
+ VERIFY(coords[5], coord1[2][1], "Element Coordinates");
+ VERIFY(coords[6], coord1[3][0], "Element Coordinates");
+ VERIFY(coords[7], coord1[3][1], "Element Coordinates");
+ VERIFY(coords[8], coord1[4][0], "Element Coordinates");
+ VERIFY(coords[9], coord1[4][1], "Element Coordinates");
+ VERIFY(coords[10], coord1[5][0], "Element Coordinates");
+ VERIFY(coords[11], coord1[5][1], "Element Coordinates");
+ VERIFY(coords[12], coord1[6][0], "Element Coordinates");
+ VERIFY(coords[13], coord1[6][1], "Element Coordinates");
+ VERIFY(coords[14], coord1[7][0], "Element Coordinates");
+ VERIFY(coords[15], coord1[7][1], "Element Coordinates");
+ VERIFY(coords[16], coord1[8][0], "Element Coordinates");
+ VERIFY(coords[17], coord1[8][1], "Element Coordinates");
+ VERIFY(coords[18], coord1[9][0], "Element Coordinates");
+ VERIFY(coords[19], coord1[9][1], "Element Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid2, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 0, "Selection Bounds");
+ VERIFY(low[1], 0, "Selection Bounds");
+ VERIFY(high[0], 9, "Selection Bounds");
+ VERIFY(high[1], 9, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ if(libver_high >= H5F_LIBVER_V110) {
+ /* Get the unlimited selection */
+ sid2 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[2]);
+ CHECK(sid2, FAIL, "H5Rget_region");
+
+ /* Verify correct hyperslab selected */
+ hssize_ret = H5Sget_select_npoints(sid2);
+ VERIFY(hssize_ret, (hssize_t)H5S_UNLIMITED, "H5Sget_select_npoints");
+ tri_ret = H5Sis_regular_hyperslab(sid2);
+ CHECK(tri_ret, FAIL, "H5Sis_regular_hyperslab");
+ VERIFY(tri_ret, TRUE, "H5Sis_regular_hyperslab Result");
+ ret = H5Sget_regular_hyperslab(sid2, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sget_regular_hyperslab");
+ VERIFY(start[0], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(start[1], (hsize_t)8, "Hyperslab Coordinates");
+ VERIFY(stride[0], (hsize_t)4, "Hyperslab Coordinates");
+ VERIFY(stride[1], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(count[0], H5S_UNLIMITED, "Hyperslab Coordinates");
+ VERIFY(count[1], (hsize_t)1, "Hyperslab Coordinates");
+ VERIFY(block[0], (hsize_t)2, "Hyperslab Coordinates");
+ VERIFY(block[1], (hsize_t)2, "Hyperslab Coordinates");
+
+ /* Close region space */
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+ }
+
+ /* Close first space */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close dereferenced Dataset */
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Attempting to retrieve type of object using non-valid refs */
+ for(j = 0; j < 3; j++) {
+ H5E_BEGIN_TRY {
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &nvrbuf[j], &obj_type);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Rget_obj_type2");
+ } /* end for */
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(dwbuf);
+ HDfree(drbuf);
+} /* test_reference_region() */
+
+/****************************************************************
+**
+** test_reference_region_1D(): Test H5R (reference) object reference code.
+** Tests 1-D references to various kinds of objects
+**
+** Note: The libver_low/libver_high parameters are added to create the file
+** with the low and high bounds setting in fapl.
+** Please see the RFC for "H5Sencode/H5Sdecode Format Change".
+**
+****************************************************************/
+static void
+test_reference_region_1D(H5F_libver_t libver_low, H5F_libver_t libver_high)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t fapl = -1; /* File access property list */
+ hid_t dset1, /* Dataset ID */
+ dset3; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid3; /* Dataspace ID #3 */
+ hid_t dapl_id; /* Dataset access property list */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims3[] = {SPACE3_DIM1};
+ hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t *coords; /* Coordinate buffer */
+ hsize_t low[SPACE3_RANK]; /* Selection bounds */
+ hsize_t high[SPACE3_RANK]; /* Selection bounds */
+ hdset_reg_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
+ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
+ *drbuf; /* Buffer for reading numeric data from disk */
+ 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 */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n"));
+
+ /* Allocate write & read buffers */
+ wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
+ rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
+ dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1);
+ drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1);
+
+ /* Create the file access property list */
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(fapl, FAIL, "H5Pcreate");
+
+ /* Set the low/high version bounds in fapl */
+ ret = H5Pset_libver_bounds(fapl, libver_low, libver_high);
+ CHECK(ret, FAIL, "H5Pset_libver_bounds");
+
+ /* Create file with the fapl */
+ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid3 = H5Screate_simple(SPACE3_RANK, dims3, NULL);
+ CHECK(sid3, FAIL, "H5Screate_simple");
+
+ /* Create dataset access property list */
+ dapl_id = H5Pcreate(H5P_DATASET_ACCESS);
+ CHECK(dapl_id, FAIL, "H5Pcreate");
+
+ /* Create a dataset */
+ dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
+
+ for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++)
+ *tu8++ = (uint8_t)(i * 3);
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset3);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create dataspace for the reference dataset */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Create a dataset */
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
+
+ /* Create references */
+
+ /* Select 15 2x1 hyperslabs for first reference */
+ start[0] = 2;
+ stride[0] = 5;
+ count[0] = 15;
+ block[0] = 2;
+ ret = H5Sselect_hyperslab(sid3, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, 30, "H5Sget_select_npoints");
+
+ /* Store first dataset region */
+ ret = H5Rcreate(&wbuf[0], fid1, "/Dataset2", H5R_DATASET_REGION, sid3);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &wbuf[0], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Select sequence of ten points for second reference */
+ coord1[0][0] = 16;
+ coord1[1][0] = 22;
+ coord1[2][0] = 38;
+ coord1[3][0] = 41;
+ coord1[4][0] = 52;
+ coord1[5][0] = 63;
+ coord1[6][0] = 70;
+ coord1[7][0] = 89;
+ coord1[8][0] = 97;
+ coord1[9][0] = 03;
+ ret = H5Sselect_elements(sid3, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, 10, "H5Sget_select_npoints");
+
+ /* Store second dataset region */
+ ret = H5Rcreate(&wbuf[1], fid1, "/Dataset2", H5R_DATASET_REGION, sid3);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close uint8 dataset dataspace */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, fapl);
+ CHECK(fid1, FAIL, "H5Fopen");
+
+ /* Open the dataset */
+ dset1 = H5Dopen2(fid1, "/Dataset1", H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dset1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Try to open objects */
+ dset3 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, &rbuf[0]);
+ CHECK(dset3, FAIL, "H5Rdereference2");
+
+ /* Check what H5Rget_obj_type2 function returns */
+ ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &rbuf[0], &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Check information in referenced dataset */
+ sid1 = H5Dget_space(dset3);
+ CHECK(sid1, FAIL, "H5Dget_space");
+
+ ret = (int)H5Sget_simple_extent_npoints(sid1);
+ VERIFY(ret, 100, "H5Sget_simple_extent_npoints");
+
+ /* Read from disk */
+ ret = H5Dread(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+ for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++)
+ VERIFY(*tu8, (uint8_t)(i * 3), "Data");
+
+ /* Get the hyperslab selection */
+ sid3 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[0]);
+ CHECK(sid3, FAIL, "H5Rget_region");
+
+ /* Verify correct hyperslab selected */
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, 30, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_hyper_nblocks(sid3);
+ VERIFY(ret, 15, "H5Sget_select_hyper_nblocks");
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */
+ ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist");
+ VERIFY(coords[0], 2, "Hyperslab Coordinates");
+ VERIFY(coords[1], 3, "Hyperslab Coordinates");
+ VERIFY(coords[2], 7, "Hyperslab Coordinates");
+ VERIFY(coords[3], 8, "Hyperslab Coordinates");
+ VERIFY(coords[4], 12, "Hyperslab Coordinates");
+ VERIFY(coords[5], 13, "Hyperslab Coordinates");
+ VERIFY(coords[6], 17, "Hyperslab Coordinates");
+ VERIFY(coords[7], 18, "Hyperslab Coordinates");
+ VERIFY(coords[8], 22, "Hyperslab Coordinates");
+ VERIFY(coords[9], 23, "Hyperslab Coordinates");
+ VERIFY(coords[10], 27, "Hyperslab Coordinates");
+ VERIFY(coords[11], 28, "Hyperslab Coordinates");
+ VERIFY(coords[12], 32, "Hyperslab Coordinates");
+ VERIFY(coords[13], 33, "Hyperslab Coordinates");
+ VERIFY(coords[14], 37, "Hyperslab Coordinates");
+ VERIFY(coords[15], 38, "Hyperslab Coordinates");
+ VERIFY(coords[16], 42, "Hyperslab Coordinates");
+ VERIFY(coords[17], 43, "Hyperslab Coordinates");
+ VERIFY(coords[18], 47, "Hyperslab Coordinates");
+ VERIFY(coords[19], 48, "Hyperslab Coordinates");
+ VERIFY(coords[20], 52, "Hyperslab Coordinates");
+ VERIFY(coords[21], 53, "Hyperslab Coordinates");
+ VERIFY(coords[22], 57, "Hyperslab Coordinates");
+ VERIFY(coords[23], 58, "Hyperslab Coordinates");
+ VERIFY(coords[24], 62, "Hyperslab Coordinates");
+ VERIFY(coords[25], 63, "Hyperslab Coordinates");
+ VERIFY(coords[26], 67, "Hyperslab Coordinates");
+ VERIFY(coords[27], 68, "Hyperslab Coordinates");
+ VERIFY(coords[28], 72, "Hyperslab Coordinates");
+ VERIFY(coords[29], 73, "Hyperslab Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid3, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 2, "Selection Bounds");
+ VERIFY(high[0], 73, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Get the element selection */
+ sid3 = H5Rget_region(dset1, H5R_DATASET_REGION, &rbuf[1]);
+ CHECK(sid3, FAIL, "H5Rget_region");
+
+ /* Verify correct elements selected */
+ ret = (int)H5Sget_select_npoints(sid3);
+ VERIFY(ret, 10, "H5Sget_select_npoints");
+ ret = (int)H5Sget_select_elem_npoints(sid3);
+ VERIFY(ret, 10, "H5Sget_select_elem_npoints");
+ coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t)); /* allocate space for the element points */
+ ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords);
+ CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
+ VERIFY(coords[0], coord1[0][0], "Element Coordinates");
+ VERIFY(coords[1], coord1[1][0], "Element Coordinates");
+ VERIFY(coords[2], coord1[2][0], "Element Coordinates");
+ VERIFY(coords[3], coord1[3][0], "Element Coordinates");
+ VERIFY(coords[4], coord1[4][0], "Element Coordinates");
+ VERIFY(coords[5], coord1[5][0], "Element Coordinates");
+ VERIFY(coords[6], coord1[6][0], "Element Coordinates");
+ VERIFY(coords[7], coord1[7][0], "Element Coordinates");
+ VERIFY(coords[8], coord1[8][0], "Element Coordinates");
+ VERIFY(coords[9], coord1[9][0], "Element Coordinates");
+ HDfree(coords);
+ ret = H5Sget_select_bounds(sid3, low, high);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low[0], 3, "Selection Bounds");
+ VERIFY(high[0], 97, "Selection Bounds");
+
+ /* Close region space */
+ ret = H5Sclose(sid3);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close first space */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close dereferenced Dataset */
+ ret = H5Dclose(dset3);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close dataset access property list */
+ ret = H5Pclose(dapl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file access property list */
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ HDfree(wbuf);
+ HDfree(rbuf);
+ HDfree(dwbuf);
+ HDfree(drbuf);
+} /* test_reference_region_1D() */
+
+/****************************************************************
+**
+** test_reference_obj_deleted(): Test H5R (reference) object reference code.
+** Tests for correct failures for deleted and non-existent objects
+**
+****************************************************************/
+static void
+test_reference_obj_deleted(void)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hobj_ref_t oref; /* Object Reference to test */
+ H5O_type_t obj_type; /* Object type */
+ haddr_t addr = HADDR_UNDEF; /* test for undefined reference */
+ herr_t ret; /* Generic return value */
+
+ /* Create file */
+ fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /* Create scalar dataspace for datasets */
+ sid1 = H5Screate_simple(0, NULL, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Create a dataset to reference (deleted later) */
+ dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a dataset */
+ dataset = H5Dcreate2(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Create reference to dataset */
+ ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+ ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &oref, &obj_type);
+ CHECK(ret, FAIL, "H5Rget_obj_type2");
+ VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &oref);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Delete referenced dataset */
+ ret = H5Ldelete(fid1, "/Dataset1", H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close disk dataspace */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE3, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fopen");
+
+ /* Open the dataset */
+ dataset = H5Dopen2(fid1, "/Dataset2", H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dopen2");
+
+ /* Open undefined reference */
+ dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &addr);
+ VERIFY(dset2, FAIL, "H5Rdereference2");
+
+ /* Read selection from disk */
+ HDmemset(&oref, 0, sizeof(hobj_ref_t));
+ ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &oref);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Open deleted dataset object */
+ dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &oref);
+ VERIFY(dset2, FAIL, "H5Rdereference2");
+
+ /* Open nonsense reference */
+ HDmemset(&oref, 0, sizeof(hobj_ref_t));
+ dset2 = H5Rdereference2(dataset, H5P_DEFAULT, H5R_OBJECT, &oref);
+ VERIFY(dset2, FAIL, "H5Rdereference2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_reference_obj_deleted() */
+
+/****************************************************************
+**
+** test_deref_iter_op(): Iterator callback for test_reference_group_iterate()
+** test.
+**
+****************************************************************/
+static herr_t
+test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info2_t H5_ATTR_UNUSED *info,
+ void *op_data)
+{
+ int *count = (int *)op_data; /* Pointer to name counter */
+ herr_t ret_value;
+
+ /* Simple check for correct names */
+ if(*count == 0) {
+ if(HDstrcmp(name, DSETNAME2) == 0)
+ ret_value = 0;
+ else
+ ret_value = -1;
+ } /* end if */
+ else if(*count == 1) {
+ if(HDstrcmp(name, GROUPNAME2) == 0)
+ ret_value = 0;
+ else
+ ret_value = -1;
+ } /* end if */
+ else if(*count == 2) {
+ if(HDstrcmp(name, GROUPNAME3) == 0)
+ ret_value = 0;
+ else
+ ret_value = -1;
+ } /* end if */
+ else
+ ret_value = -1;
+
+ (*count)++;
+
+ return(ret_value);
+} /* end test_deref_iter_op() */
+
+/****************************************************************
+**
+** test_reference_group(): Test H5R (reference) object reference code.
+** Tests for correct behavior of various routines on dereferenced group
+**
+****************************************************************/
+static void
+test_reference_group(void)
+{
+ hid_t fid = -1; /* File ID */
+ hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t did; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hobj_ref_t wref; /* Reference to write */
+ hobj_ref_t rref; /* Reference to read */
+ H5G_info_t ginfo; /* Group info struct */
+ char objname[NAME_SIZE]; /* Buffer to store name */
+ H5O_info2_t oinfo; /* Object info struct */
+ int count = 0; /* Count within iterated group */
+ ssize_t size; /* Name length */
+ herr_t ret;
+
+ /* Create file with a group and a dataset containing an object reference to the group */
+ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create dataspace to use for dataset */
+ sid = H5Screate(H5S_SCALAR);
+ CHECK(sid, FAIL, "H5Screate");
+
+ /* Create group to refer to */
+ gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate2");
+
+ /* Create nested groups */
+ gid2 = H5Gcreate2(gid, GROUPNAME2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid2, FAIL, "H5Gcreate2");
+ ret = H5Gclose(gid2);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ gid2 = H5Gcreate2(gid, GROUPNAME3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid2, FAIL, "H5Gcreate2");
+ ret = H5Gclose(gid2);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create bottom dataset */
+ did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(did > 0);
+ ret = H5Dclose(did);
+ assert(ret >= 0);
+
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Create dataset */
+ did = H5Dcreate2(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
+
+ /* Create reference to group */
+ ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Write reference to disk */
+ ret = H5Dwrite(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wref);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close objects */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+
+ /* Re-open file */
+ fid = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Re-open dataset */
+ did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dopen2");
+
+ /* Read in the reference */
+ ret = H5Dread(did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rref);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Dereference to get the group */
+ gid = H5Rdereference2(did, H5P_DEFAULT, H5R_OBJECT, &rref);
+ CHECK(gid, FAIL, "H5Rdereference2");
+
+ /* Iterate through objects in dereferenced group */
+ ret = H5Literate2(gid, H5_INDEX_NAME, H5_ITER_INC, NULL, test_deref_iter_op, &count);
+ CHECK(ret, FAIL, "H5Literate");
+
+ /* Various queries on the group opened */
+ ret = H5Gget_info(gid, &ginfo);
+ CHECK(ret, FAIL, "H5Gget_info");
+ VERIFY(ginfo.nlinks, 3, "H5Gget_info");
+
+ size = H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, objname, (size_t)NAME_SIZE, H5P_DEFAULT);
+ CHECK(size, FAIL, "H5Lget_name_by_idx");
+ VERIFY_STR(objname, DSETNAME2, "H5Lget_name_by_idx");
+
+ ret = H5Oget_info_by_idx3(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &oinfo, H5O_INFO_BASIC, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_info_by_idx3");
+ VERIFY(oinfo.type, H5O_TYPE_DATASET, "H5Oget_info_by_idx3");
+
+ /* Unlink one of the objects in the dereferenced group */
+ ret = H5Ldelete(gid, GROUPNAME2, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Delete dataset object in dereferenced group (with other dataset still open) */
+ ret = H5Ldelete(gid, DSETNAME2, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Ldelete");
+
+ /* Close objects */
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_reference_group() */
+
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+/****************************************************************
+**
+** test_reference_compat(): Test basic H5R (reference) object reference code.
+** Tests deprecated API routines
+**
+****************************************************************/
+static void
+test_reference_compat(void)
+{
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, dset2; /* Dataset ID */
+ hid_t group, group2; /* Group ID */
+ hid_t sid1, /* Dataspace IDs */
+ sid2;
+ hid_t tid1, tid2; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ 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 */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hobj_ref_t *wbuf_obj, /* Buffer to write to disk */
+ *rbuf_obj; /* Buffer read from disk */
+ hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */
+ *rbuf_reg; /* Buffer read from disk */
+ H5G_obj_t obj_type; /* Object type */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Deprecated Object Reference Functions\n"));
+
+ /* Allocate write & read buffers */
+ wbuf_obj = (hobj_ref_t *)HDcalloc(sizeof(hobj_ref_t), SPACE1_DIM1);
+ rbuf_obj = (hobj_ref_t *)HDmalloc(sizeof(hobj_ref_t) * SPACE1_DIM1);
+ wbuf_reg = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1);
+ rbuf_reg = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1);
+
+ /* Create file */
+ fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fcreate");
+
+ /* Create dataspace for datasets */
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
+ CHECK(sid1, FAIL, "H5Screate_simple");
+
+ /* Create another dataspace for datasets */
+ sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
+ CHECK(sid2, FAIL, "H5Screate_simple");
+
+ /* Create a group */
+ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(group, FAIL, "H5Gcreate2");
+
+ /* Create a dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create another dataset (inside Group1) */
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Create a datatype to refer to */
+ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
+ CHECK(tid1, FAIL, "H5Tcreate");
+
+ /* Insert fields */
+ ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT);
+ CHECK(ret, FAIL, "H5Tinsert");
+
+ /* Save datatype for later */
+ ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Tcommit2");
+
+ /* Close datatype */
+ ret = H5Tclose(tid1);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close group */
+ ret = H5Gclose(group);
+ CHECK(ret, FAIL, "H5Gclose");
+
+
+ /* Create a dataset with object reference datatype */
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Create reference to dataset */
+ ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Create reference to dataset */
+ ret = H5Rcreate(&wbuf_obj[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Create reference to group */
+ ret = H5Rcreate(&wbuf_obj[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Create reference to named datatype */
+ ret = H5Rcreate(&wbuf_obj[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Write references to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf_obj);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+
+ /* Create a dataset with region reference datatype */
+ dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+
+ /* Select 6x6 hyperslab for first reference */
+ start[0] = 2; start[1] = 2;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 1; count[1] = 1;
+ block[0] = 6; block[1] = 6;
+ ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create first dataset region */
+ ret = H5Rcreate(&wbuf_reg[0], fid1, "/Group1/Dataset1", H5R_DATASET_REGION, sid2);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Select sequence of ten points for second reference */
+ coord1[0][0] = 6; coord1[0][1] = 9;
+ coord1[1][0] = 2; coord1[1][1] = 2;
+ coord1[2][0] = 8; coord1[2][1] = 4;
+ coord1[3][0] = 1; coord1[3][1] = 6;
+ coord1[4][0] = 2; coord1[4][1] = 8;
+ coord1[5][0] = 3; coord1[5][1] = 2;
+ coord1[6][0] = 0; coord1[6][1] = 4;
+ coord1[7][0] = 9; coord1[7][1] = 0;
+ coord1[8][0] = 7; coord1[8][1] = 1;
+ coord1[9][0] = 3; coord1[9][1] = 3;
+ ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Create second dataset region */
+ ret = H5Rcreate(&wbuf_reg[1], fid1, "/Group1/Dataset2", H5R_DATASET_REGION, sid2);
+ CHECK(ret, FAIL, "H5Rcreate");
+
+ /* Write selection to disk */
+ ret = H5Dwrite(dataset, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf_reg);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+
+ /* Close disk dataspaces */
+ ret = H5Sclose(sid1);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid2);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+
+ /* Re-open the file */
+ fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid1, FAIL, "H5Fopen");
+
+ /* Open the object reference dataset */
+ dataset = H5Dopen2(fid1, "/Dataset3", H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_obj);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Verify type of objects pointed at */
+ obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[0]);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+
+ obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[1]);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+
+ obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[2]);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ VERIFY(obj_type, H5G_GROUP, "H5Rget_obj_type1");
+
+ obj_type = H5Rget_obj_type1(dataset, H5R_OBJECT, &rbuf_obj[3]);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ VERIFY(obj_type, H5G_TYPE, "H5Rget_obj_type1");
+
+
+ /* Make sure the referenced objects can be opened */
+ dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[0]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ dset2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[1]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ group2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[2]);
+ CHECK(group2, FAIL, "H5Rdereference1");
+
+ ret = H5Gclose(group2);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ tid2 = H5Rdereference1(dataset, H5R_OBJECT, &rbuf_obj[3]);
+ CHECK(tid2, FAIL, "H5Rdereference1");
+
+ ret = H5Tclose(tid2);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+
+ /* Open the dataset region reference dataset */
+ dataset = H5Dopen2(fid1, "/Dataset4", H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dopen2");
+
+ /* Read selection from disk */
+ ret = H5Dread(dataset, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf_reg);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Verify type of objects pointed at */
+ obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[0]);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+
+ obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[1]);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+ VERIFY(obj_type, H5G_DATASET, "H5Rget_obj_type1");
+
+ obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[2]);
+ VERIFY(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+
+ obj_type = H5Rget_obj_type1(dataset, H5R_DATASET_REGION, &rbuf_reg[3]);
+ VERIFY(obj_type, H5G_UNKNOWN, "H5Rget_obj_type1");
+
+ /* Make sure the referenced objects can be opened */
+ dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[0]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ dset2 = H5Rdereference1(dataset, H5R_DATASET_REGION, &rbuf_reg[1]);
+ CHECK(dset2, FAIL, "H5Rdereference1");
+
+ ret = H5Dclose(dset2);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close Dataset */
+ ret = H5Dclose(dataset);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Close file */
+ ret = H5Fclose(fid1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free memory buffers */
+ HDfree(wbuf_obj);
+ HDfree(rbuf_obj);
+ HDfree(wbuf_reg);
+ HDfree(rbuf_reg);
+} /* test_reference_compat() */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+/****************************************************************
+**
+** test_reference_deprec(): Main H5R reference testing routine.
+**
+****************************************************************/
+void
+test_reference_deprec(void)
+{
+ H5F_libver_t low, high; /* Low and high bounds */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Deprecated References\n"));
+
+ test_reference_params(); /* Test for correct parameter checking */
+ test_reference_obj(); /* Test basic H5R object reference code */
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
+
+ test_reference_region(low, high); /* Test basic H5R dataset region reference code */
+ test_reference_region_1D(low, high); /* Test H5R dataset region reference code for 1-D datasets */
+
+ } /* end high bound */
+ } /* end low bound */
+
+ test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */
+ test_reference_group(); /* Test operations on dereferenced groups */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
+ test_reference_compat(); /* Test operations with old API routines */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
+
+} /* test_reference() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: cleanup_reference
+ *
+ * Purpose: Cleanup temporary test files
+ *
+ * Return: none
+ *
+ * Programmer: Quincey Koziol
+ * September 8, 1998
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+void
+cleanup_reference_deprec(void)
+{
+ HDremove(FILE1);
+ HDremove(FILE2);
+ HDremove(FILE3);
+}
+
diff --git a/test/trefer_shutdown.c b/test/trefer_shutdown.c
new file mode 100644
index 0000000..b1c43e0
--- /dev/null
+++ b/test/trefer_shutdown.c
@@ -0,0 +1,83 @@
+#include "h5test.h"
+
+int
+main(int argc, char **argv)
+{
+ H5R_ref_t write_ref, read_ref;
+ hid_t fid;
+ hid_t did;
+ hid_t sid;
+ int i;
+
+ if ((fid = H5Fcreate("HDFFV-10992.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ HDfprintf(stderr, "H5Fcreate failed\n");
+ return 1;
+ }
+
+ if ((sid = H5Screate(H5S_SCALAR)) < 0) {
+ HDfprintf(stderr, "H5Screate failed\n");
+ return 1;
+ }
+
+ /* Create a dataset of object references */
+ if ((did = H5Dcreate2(fid, "dset", H5T_STD_REF, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ HDfprintf(stderr, "H5Dcreate failed\n");
+ return 1;
+ }
+
+ for (i = 0; i < 100; i++) {
+ /* Create reference to the root group */
+ if (H5Rcreate_object(fid, "/dset", H5P_DEFAULT, &write_ref) < 0) {
+ HDfprintf(stderr, "H5Rcreate_object failed\n");
+ return 1;
+ }
+ }
+
+ /* Write reference to dataset */
+ if (H5Dwrite(did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, &write_ref) < 0) {
+ HDfprintf(stderr, "H5Dwrite failed\n");
+ return 1;
+ }
+
+ for (i = 0; i < 500; i++) {
+ /* Read reference back into different reference buffer */
+ if (H5Dread(did, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, &read_ref) < 0) {
+ HDfprintf(stderr, "H5Dread failed\n");
+ return 1;
+ }
+ }
+
+ /*
+ * "Forget" to call H5Rdestroy on reference objects. If H5Rdestroy
+ * is called at least once on either reference object, or both
+ * objects, the infinite loop goes away. If H5Rdestroy is never
+ * called, the infinite loop will appear.
+ */
+#if 0
+ if (H5Rdestroy(&write_ref) < 0) {
+ HDfprintf(stderr, "H5Rdestroy on reference write buffer failed\n");
+ return 1;
+ }
+ if (H5Rdestroy(&read_ref) < 0) {
+ HDfprintf(stderr, "H5Rdestroy on reference read buffer failed\n");
+ return 1;
+ }
+#endif
+
+ if (H5Sclose(sid) < 0) {
+ HDfprintf(stderr, "H5Sclose failed\n");
+ return 1;
+ }
+
+ if (H5Dclose(did) < 0) {
+ HDfprintf(stderr, "H5Dclose failed\n");
+ return 1;
+ }
+
+ if (H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "H5Fclose failed\n");
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/test/trefstr.c b/test/trefstr.c
index 40ce344..c33b5eb 100644
--- a/test/trefstr.c
+++ b/test/trefstr.c
@@ -67,7 +67,7 @@ test_refstr_create(void)
/* Try creating a ref-counted string */
rs=H5RS_create("foo");
- CHECK(rs, NULL, "H5RS_create");
+ CHECK_PTR(rs, "H5RS_create");
/* Get the reference count on the string */
count=H5RS_get_count(rs);
@@ -97,7 +97,7 @@ test_refstr_count(void)
/* Try creating a ref-counted string */
rs=H5RS_create("foo");
- CHECK(rs, NULL, "H5RS_create");
+ CHECK_PTR(rs, "H5RS_create");
/* Get the reference count on the string */
count=H5RS_get_count(rs);
@@ -144,7 +144,7 @@ test_refstr_dup(void)
/* Try creating a ref-counted string */
rs1=H5RS_create("foo");
- CHECK(rs1, NULL, "H5RS_create");
+ CHECK_PTR(rs1, "H5RS_create");
/* Get the reference count on the string */
count=H5RS_get_count(rs1);
@@ -152,7 +152,7 @@ test_refstr_dup(void)
/* Duplicate r-string */
rs2=H5RS_dup(rs1);
- CHECK(rs2, NULL, "H5RS_dup");
+ CHECK_PTR(rs2, "H5RS_dup");
/* Get the reference count on the strings */
count=H5RS_get_count(rs1);
@@ -194,11 +194,11 @@ test_refstr_cmp(void)
/* Create first reference counted string */
rs1=H5RS_create("foo");
- CHECK(rs1, NULL, "H5RS_create");
+ CHECK_PTR(rs1, "H5RS_create");
/* Create second reference counted string */
rs2=H5RS_create("foo2");
- CHECK(rs2, NULL, "H5RS_create");
+ CHECK_PTR(rs2, "H5RS_create");
/* Compare the strings in various ways */
cmp=H5RS_cmp(rs1,rs1);
@@ -246,12 +246,12 @@ test_refstr_wrap(void)
/* Wrap ref-counted string around existing buffer */
rs=H5RS_wrap(buf);
- CHECK(rs, NULL, "H5RS_wrap");
+ CHECK_PTR(rs, "H5RS_wrap");
/* Get pointer to raw string in ref-counted string */
s=H5RS_get_str(rs);
- CHECK(s, NULL, "H5RS_get_str");
- VERIFY(s, buf, "wrapping");
+ CHECK_PTR(s, "H5RS_get_str");
+ CHECK_PTR_EQ(s, buf, "wrapping");
cmp=HDstrcmp(s,buf);
VERIFY(cmp, 0, "HDstrcmp");
@@ -264,7 +264,7 @@ test_refstr_wrap(void)
/* Get pointer to raw string in ref-counted string */
s=H5RS_get_str(rs);
- CHECK(s, NULL, "H5RS_get_str");
+ CHECK_PTR(s, "H5RS_get_str");
CHECK(s, buf, "wrapping");
cmp=HDstrcmp(s,buf);
if(cmp<=0)
@@ -299,17 +299,17 @@ test_refstr_own(void)
/* Initialize buffer */
s = (char *)H5FL_BLK_MALLOC(str_buf,HDstrlen("foo") + 1);
- CHECK(s, NULL, "H5FL_BLK_MALLOC");
+ CHECK_PTR(s, "H5FL_BLK_MALLOC");
HDstrcpy(s, "foo");
/* Transfer ownership of dynamically allocated string to ref-counted string */
rs=H5RS_own(s);
- CHECK(rs, NULL, "H5RS_own");
+ CHECK_PTR(rs, "H5RS_own");
/* Get pointer to raw string in ref-counted string */
t=H5RS_get_str(rs);
- CHECK(t, NULL, "H5RS_get_str");
- VERIFY(t, s, "transferring");
+ CHECK_PTR(t, "H5RS_get_str");
+ CHECK_PTR_EQ(t, s, "transferring");
cmp=HDstrcmp(s,t);
VERIFY(cmp, 0, "HDstrcmp");
@@ -322,8 +322,8 @@ test_refstr_own(void)
/* Get pointer to raw string in ref-counted string */
t=H5RS_get_str(rs);
- CHECK(t, NULL, "H5RS_get_str");
- VERIFY(t, s, "transferring");
+ CHECK_PTR(t, "H5RS_get_str");
+ CHECK_PTR_EQ(t, s, "transferring");
cmp=HDstrcmp(t,s);
VERIFY(cmp, 0, "HDstrcmp");
diff --git a/test/tselect.c b/test/tselect.c
index 85c21bb..aa0ab11 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -13,50 +13,49 @@
/***********************************************************
*
-* 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 +65,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 +88,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 +124,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
@@ -157,16 +156,32 @@
#define SPACERE5_DIM3 12
#define SPACERE5_DIM4 8
+/* Information for Space update diminfo test */
+#define SPACEUD1_DIM0 20
+#define SPACEUD3_DIM0 9
+#define SPACEUD3_DIM1 12
+#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
#define SPACE13_NPOINTS 4
+/* Information for testing selection iterators */
+#define SEL_ITER_MAX_SEQ 256
+
+
+/* Defines for test_hyper_io_1d() */
+#define DNAME "DSET_1D"
+#define RANK 1
+#define NUMCHUNKS 3
+#define CHUNKSZ 20
+#define NUM_ELEMENTS NUMCHUNKS * CHUNKSZ
/* Location comparison function */
static int compare_size_t(const void *s1, const void *s2);
@@ -206,21 +221,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 */
@@ -228,9 +243,9 @@ test_select_hyper(hid_t xfer_plist)
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -371,7 +386,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 */
};
@@ -408,33 +423,33 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -694,15 +709,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 */
@@ -710,9 +725,9 @@ test_select_all(hid_t xfer_plist)
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE4_DIM1 * SPACE4_DIM2 * SPACE4_DIM3));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE4_DIM1; i++)
@@ -775,21 +790,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 */
@@ -797,9 +812,9 @@ test_select_all_hyper(hid_t xfer_plist)
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -860,7 +875,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);
@@ -881,7 +896,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");
@@ -916,32 +931,32 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -1060,16 +1075,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 */
@@ -1099,16 +1114,16 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -1179,8 +1194,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 */
@@ -1215,28 +1230,28 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -1308,14 +1323,8 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) {
+ if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12))
TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__);
-#ifdef QAK
- for(i=0, tbuf=wbuf; i<12; i++)
- for(j=0; j<30; j++)
- printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -1347,26 +1356,26 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE8_DIM1; i++)
@@ -1432,14 +1441,8 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1)) {
+ if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1))
TestErrPrintf("Error: hyperslab values don't match!\n");
-#ifdef QAK
- for(i=0, tbuf=wbuf; i<12; i++)
- for(j=0; j<30; j++)
- printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -1474,26 +1477,26 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE8_DIM1 * SPACE8_DIM2 * SPACE8_DIM3 * SPACE8_DIM4));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE8_DIM4; i++)
@@ -1568,13 +1571,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 */
@@ -1600,7 +1603,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,13 +1612,13 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
****************************************************************/
static void
verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf,
- size_t cube_size, unsigned edge_size, unsigned cube_rank)
+ size_t H5_ATTR_NDEBUG_UNUSED 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);
@@ -1644,8 +1647,8 @@ verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf,
/* Advance to next element */
cube_ptr++;
expected_value++;
- s++;
- m++;
+ s++;
+ m++;
} while((cube_rank > 0) && (m < edge_size));
l++;
} while((cube_rank > 1) && (l < edge_size));
@@ -1659,14 +1662,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.
+** 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 H5Sselect_shape_same in isolation, so now we try to do
+** I/O.
**
****************************************************************/
static void
@@ -1674,37 +1677,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));
@@ -1735,9 +1738,9 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
/* Allocate buffers */
small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size);
- CHECK(small_cube_buf_1, NULL, "HDcalloc");
+ CHECK_PTR(small_cube_buf_1, "HDcalloc");
large_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), large_cube_size);
- CHECK(large_cube_buf_1, NULL, "HDcalloc");
+ CHECK_PTR(large_cube_buf_1, "HDcalloc");
/* Create a dataset transfer property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
@@ -1769,14 +1772,14 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
CHECK(file_large_cube_sid, FAIL, "H5Screate_simple");
/* if chunk edge size is greater than zero, set up the small and
- * large data set creation property lists to specify chunked
+ * large data set creation property lists to specify chunked
* 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[0] = chunk_dims[1] =
+ 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");
@@ -1799,7 +1802,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} /* end if */
/* create the small cube dataset */
- small_cube_dataset = H5Dcreate2(fid1, "small_cube_dataset", dset_type,
+ small_cube_dataset = H5Dcreate2(fid1, "small_cube_dataset", dset_type,
small_cube_sid, H5P_DEFAULT, small_cube_dcpl_id, H5P_DEFAULT);
CHECK(small_cube_dataset, FAIL, "H5Dcreate2");
@@ -1810,7 +1813,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} /* end if */
/* create the large cube dataset */
- large_cube_dataset = H5Dcreate2(fid1, "large_cube_dataset", dset_type,
+ large_cube_dataset = H5Dcreate2(fid1, "large_cube_dataset", dset_type,
file_large_cube_sid, H5P_DEFAULT, large_cube_dcpl_id, H5P_DEFAULT);
CHECK(large_cube_dataset, FAIL, "H5Dcreate2");
@@ -1822,16 +1825,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
/* write initial data to the on disk datasets */
- ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid,
+ ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid,
small_cube_sid, xfer_plist, cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
- ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid,
+ ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid,
file_large_cube_sid, xfer_plist, cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
/* read initial data from disk and verify that it is as expected. */
- ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid,
+ ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, small_cube_sid,
small_cube_sid, xfer_plist, small_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
@@ -1839,7 +1842,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
verify_select_hyper_contig_dr__run_test(small_cube_buf_1, small_cube_size,
edge_size, small_rank);
- ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid,
+ ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, mem_large_cube_sid,
file_large_cube_sid, xfer_plist, large_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
@@ -1849,15 +1852,15 @@ 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()
+ * Start by reading small_rank-D slice from the on disk large cube, and
+ * verifying that the data read is correct. Verify that H5Sselect_shape_same()
* returns true on the memory and file selections.
*/
-
+
/* set up start, stride, count, and block -- note that we will
* change start[] so as to read slices of the large cube.
*/
@@ -1889,20 +1892,19 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
start[3] = (hsize_t)x;
start[4] = (hsize_t)0;
- ret = H5Sselect_hyperslab(file_large_cube_sid,
+ ret = H5Sselect_hyperslab(file_large_cube_sid,
H5S_SELECT_SET,
- start_ptr,
- stride_ptr,
- count_ptr,
+ start_ptr,
+ stride_ptr,
+ count_ptr,
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,
@@ -1937,7 +1939,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} while((large_rank >= 4) && (small_rank <= 3) && (v < edge_size));
u++;
} while((large_rank >= 5) && (small_rank <= 4) && (u < edge_size));
-
+
/* similarly, read the on disk small cube into slices through the in memory
* large cube, and verify that the correct data (and only the correct data)
@@ -1965,21 +1967,20 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
start[3] = (hsize_t)x;
start[4] = (hsize_t)0;
- ret = H5Sselect_hyperslab(mem_large_cube_sid,
+ ret = H5Sselect_hyperslab(mem_large_cube_sid,
H5S_SELECT_SET,
- start_ptr,
- stride_ptr,
- count_ptr,
+ start_ptr,
+ stride_ptr,
+ count_ptr,
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,
- 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 */
@@ -1992,7 +1993,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
CHECK(ret, FAIL, "H5Dread");
- /* verify that the expected data and only the
+ /* verify that the expected data and only the
* expected data was read.
*/
start_index = (u * edge_size * edge_size * edge_size * edge_size) +
@@ -2028,7 +2029,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
/* Zero out the buffer for the next pass */
HDmemset(large_cube_buf_1 + start_index, 0, small_cube_size * sizeof(uint16_t));
-
+
x++;
} while((large_rank >= 2) && (small_rank <= 1) && (x < edge_size));
w++;
@@ -2039,16 +2040,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} while((large_rank >= 5) && (small_rank <= 4) && (u < edge_size));
- /* 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.
+ /* now we go in the opposite direction, verifying that we can write
+ * from memory to file using selections of different rank that
+ * H5Sselect_shape_same() views as being of the same shape.
*
- * Start by writing small_rank D slices from the in memory large cube, to
+ * 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.
- */
+ */
u = 0;
do {
@@ -2064,15 +2065,15 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
*/
/* zero out the on disk small cube */
- ret = H5Dwrite(small_cube_dataset,
- H5T_NATIVE_UINT16,
- small_cube_sid,
- small_cube_sid,
- xfer_plist,
+ ret = H5Dwrite(small_cube_dataset,
+ H5T_NATIVE_UINT16,
+ small_cube_sid,
+ small_cube_sid,
+ xfer_plist,
zero_buf);
CHECK(ret, FAIL, "H5Dwrite");
- /* select the portion of the in memory large cube from which we
+ /* select the portion of the in memory large cube from which we
* are going to write data.
*/
start[0] = (hsize_t)u;
@@ -2081,40 +2082,39 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
start[3] = (hsize_t)x;
start[4] = (hsize_t)0;
- ret = H5Sselect_hyperslab(mem_large_cube_sid,
+ ret = H5Sselect_hyperslab(mem_large_cube_sid,
H5S_SELECT_SET,
- start_ptr,
- stride_ptr,
- count_ptr,
+ start_ptr,
+ stride_ptr,
+ count_ptr,
block_ptr);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* verify that H5S_select_shape_same() reports the in
- * memory slice through the cube selection and the
+ /* 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 */
- ret = H5Dwrite(small_cube_dataset,
- H5T_NATIVE_UINT16,
- mem_large_cube_sid,
- small_cube_sid,
- xfer_plist,
+ /* 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,
+ small_cube_sid,
+ xfer_plist,
cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
/* read the on disk small cube into memory */
- ret = H5Dread(small_cube_dataset,
+ ret = H5Dread(small_cube_dataset,
H5T_NATIVE_UINT16,
small_cube_sid,
- small_cube_sid,
- xfer_plist,
+ small_cube_sid,
+ xfer_plist,
small_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
@@ -2134,7 +2134,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} /* end for */
if(mis_match )
TestErrPrintf("small cube data don't match! Line=%d\n",__LINE__);
-
+
x++;
} while((large_rank >= 2) && (small_rank <= 1) && (x < edge_size));
w++;
@@ -2145,10 +2145,10 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} while((large_rank >= 5) && (small_rank <= 4) && (u < edge_size));
- /* Now write the contents of the in memory small cube to slices of
+ /* 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
+ * into memeory, and verify that it contains the expected
+ * data. Verify that H5Sselect_shape_same() returns true on
* the memory and file selections.
*/
@@ -2173,16 +2173,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
*/
/* zero out the on disk cube */
- ret = H5Dwrite(large_cube_dataset,
- H5T_NATIVE_USHORT,
- mem_large_cube_sid,
- file_large_cube_sid,
- xfer_plist,
+ ret = H5Dwrite(large_cube_dataset,
+ H5T_NATIVE_USHORT,
+ mem_large_cube_sid,
+ file_large_cube_sid,
+ xfer_plist,
zero_buf);
CHECK(ret, FAIL, "H5Dwrite");
- /* select the portion of the in memory large cube to which we
+ /* select the portion of the in memory large cube to which we
* are going to write data.
*/
start[0] = (hsize_t)u;
@@ -2191,31 +2191,30 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
start[3] = (hsize_t)x;
start[4] = (hsize_t)0;
- ret = H5Sselect_hyperslab(file_large_cube_sid,
+ ret = H5Sselect_hyperslab(file_large_cube_sid,
H5S_SELECT_SET,
- start_ptr,
- stride_ptr,
- count_ptr,
+ start_ptr,
+ stride_ptr,
+ count_ptr,
block_ptr);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* verify that H5S_select_shape_same() reports the in
- * memory full selection of the small cube and the
- * on disk slice through the large cube selection
+ /* 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 */
- ret = H5Dwrite(large_cube_dataset,
- H5T_NATIVE_UINT16,
- small_cube_sid,
- file_large_cube_sid,
- xfer_plist,
+ /* write the cube from memory to the target slice of the disk cube */
+ ret = H5Dwrite(large_cube_dataset,
+ H5T_NATIVE_UINT16,
+ small_cube_sid,
+ file_large_cube_sid,
+ xfer_plist,
cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
@@ -2224,16 +2223,16 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
ret = H5Sselect_all(file_large_cube_sid);
CHECK(ret, FAIL, "H5Sselect_all");
- ret = H5Dread(large_cube_dataset,
+ ret = H5Dread(large_cube_dataset,
H5T_NATIVE_UINT16,
mem_large_cube_sid,
- file_large_cube_sid,
- xfer_plist,
+ file_large_cube_sid,
+ xfer_plist,
large_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
- /* verify that the expected data and only the
+ /* verify that the expected data and only the
* expected data was read.
*/
start_index = (u * edge_size * edge_size * edge_size * edge_size) +
@@ -2266,7 +2265,7 @@ test_select_hyper_contig_dr__run_test(int test_num, const uint16_t *cube_buf,
} /* end for */
if(mis_match)
TestErrPrintf("large cube written from small cube has bad data! Line=%d\n", __LINE__);
-
+
x++;
} while((large_rank >= 2) && (small_rank <= 1) && (x < edge_size));
w++;
@@ -2306,14 +2305,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.
+** 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 H5Sselect_shape_same in isolation, so now we try to do
+** I/O.
**
****************************************************************/
static void
@@ -2342,7 +2341,7 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist)
/* Allocate cube buffer for writing values */
cube_buf = (uint16_t *)HDmalloc(sizeof(uint16_t) * max_cube_size);
- CHECK(cube_buf, NULL, "HDmalloc");
+ CHECK_PTR(cube_buf, "HDmalloc");
/* Initialize the cube buffer */
cube_ptr = cube_buf;
@@ -2351,7 +2350,7 @@ test_select_hyper_contig_dr(hid_t dset_type, hid_t xfer_plist)
/* Allocate cube buffer for zeroing values on disk */
zero_buf = (uint16_t *)HDcalloc(sizeof(uint16_t), max_cube_size);
- CHECK(zero_buf, NULL, "HDcalloc");
+ CHECK_PTR(zero_buf, "HDcalloc");
for(large_rank = 1; large_rank <= max_rank; large_rank++) {
for(small_rank = 1; small_rank < large_rank; small_rank++) {
@@ -2374,25 +2373,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
+** test_select_hyper_checker_board_dr__select_checker_board():
+** 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
@@ -2400,18 +2399,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);
@@ -2438,7 +2437,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
offset_count++;
/* Now set up the stride and block arrays, and portions of the start
- * and count arrays that will not be altered during the selection of
+ * and count arrays that will not be altered during the selection of
* the checker board.
*/
u = 0;
@@ -2467,7 +2466,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
u++;
} /* end while */
-
+
i = 0;
do {
if(0 >= sel_offset) {
@@ -2482,7 +2481,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
} /* end if */
j = 0;
- do {
+ do {
if(1 >= sel_offset) {
if(j == 0 ) {
start[1] = 0;
@@ -2535,22 +2534,22 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
if(((i + j + k + l + m) % 2) == 0) {
if(first_selection) {
- first_selection = FALSE;
+ first_selection = FALSE;
- ret = H5Sselect_hyperslab(tgt_n_cube_sid,
+ ret = H5Sselect_hyperslab(tgt_n_cube_sid,
H5S_SELECT_SET,
- &(start[n_cube_offset]),
- &(stride[n_cube_offset]),
- &(count[n_cube_offset]),
+ &(start[n_cube_offset]),
+ &(stride[n_cube_offset]),
+ &(count[n_cube_offset]),
&(block[n_cube_offset]));
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end if */
else {
- ret = H5Sselect_hyperslab(tgt_n_cube_sid,
+ ret = H5Sselect_hyperslab(tgt_n_cube_sid,
H5S_SELECT_OR,
- &(start[n_cube_offset]),
- &(stride[n_cube_offset]),
- &(count[n_cube_offset]),
+ &(start[n_cube_offset]),
+ &(stride[n_cube_offset]),
+ &(count[n_cube_offset]),
&(block[n_cube_offset]));
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end else */
@@ -2570,8 +2569,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++) {
@@ -2585,47 +2584,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():
+** 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
-** fastest changing indices.
+** 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
-** natural numbers listed in order from the origin along
+** 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
@@ -2683,7 +2682,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr,
l = 0;
y = 0;
start_in_checker[3] = start_in_checker[2];
- do {
+ do {
if(y >= checker_edge_size) {
start_in_checker[3] = ! start_in_checker[3];
y = 0;
@@ -2697,7 +2696,7 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr,
in_checker = ! in_checker;
z = 0;
} /* end if */
-
+
if(in_checker) {
if(*val_ptr != expected_value)
good_data = FALSE;
@@ -2706,10 +2705,10 @@ test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr,
if(*val_ptr != 0)
good_data = FALSE;
} /* end else */
-
+
val_ptr++;
expected_value++;
-
+
m++;
z++;
} while((rank >= (test_max_rank - 4)) && (m < edge_size));
@@ -2729,14 +2728,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.
+** 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 H5Sselect_shape_same in
+** isolation, so now we try to do I/O.
**
****************************************************************/
static void
@@ -2745,36 +2744,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));
@@ -2811,9 +2810,9 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
/* Allocate & initialize buffers */
small_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), small_cube_size);
- CHECK(small_cube_buf_1, NULL, "HDcalloc");
+ CHECK_PTR(small_cube_buf_1, "HDcalloc");
large_cube_buf_1 = (uint16_t *)HDcalloc(sizeof(uint16_t), large_cube_size);
- CHECK(large_cube_buf_1, NULL, "HDcalloc");
+ CHECK_PTR(large_cube_buf_1, "HDcalloc");
/* Create a dataset transfer property list */
@@ -2860,12 +2859,12 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
/* if chunk edge size is greater than zero, set up the small and
- * large data set creation property lists to specify chunked
+ * large data set creation property lists to specify chunked
* datasets.
*/
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[0] = chunk_dims[1] =
+ 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");
@@ -2889,7 +2888,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
/* create the small cube dataset */
- small_cube_dataset = H5Dcreate2(fid, "small_cube_dataset", dset_type,
+ small_cube_dataset = H5Dcreate2(fid, "small_cube_dataset", dset_type,
file_small_cube_sid, H5P_DEFAULT, small_cube_dcpl_id, H5P_DEFAULT);
CHECK(small_cube_dataset, FAIL, "H5Dcreate2");
@@ -2900,7 +2899,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
} /* end if */
/* create the large cube dataset */
- large_cube_dataset = H5Dcreate2(fid, "large_cube_dataset", dset_type,
+ large_cube_dataset = H5Dcreate2(fid, "large_cube_dataset", dset_type,
file_large_cube_sid, H5P_DEFAULT, large_cube_dcpl_id, H5P_DEFAULT);
CHECK(large_cube_dataset, FAIL, "H5Dcreate2");
@@ -2912,17 +2911,17 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
/* write initial data to the on disk datasets */
- ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid,
+ ret = H5Dwrite(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid,
full_small_cube_sid, xfer_plist, cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
- ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid,
+ ret = H5Dwrite(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid,
full_large_cube_sid, xfer_plist, cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
/* read initial small cube data from disk and verify that it is as expected. */
- ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid,
+ ret = H5Dread(small_cube_dataset, H5T_NATIVE_UINT16, full_small_cube_sid,
full_small_cube_sid, xfer_plist, small_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
@@ -2931,7 +2930,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
edge_size, small_rank);
/* read initial large cube data from disk and verify that it is as expected. */
- ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid,
+ ret = H5Dread(large_cube_dataset, H5T_NATIVE_UINT16, full_large_cube_sid,
full_large_cube_sid, xfer_plist, large_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
@@ -2941,14 +2940,14 @@ 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()
+ * Start by reading small_rank-D slice from the on disk large cube, and
+ * 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
+ * The first step is to set up the needed checker board selection in the
* in memory small small cube
*/
@@ -2961,8 +2960,8 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
small_rank,
sel_start);
- /* now read slices from the large, on-disk cube into the small cube.
- * Note how we adjust sel_start only in the dimensions peculiar to the
+ /* now read slices from the large, on-disk cube into the small cube.
+ * Note how we adjust sel_start only in the dimensions peculiar to the
* large cube.
*/
@@ -3007,12 +3006,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);
@@ -3045,18 +3043,18 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
TestErrPrintf("small cube read from largecube has bad data! Line=%d\n",__LINE__);
x++;
- } while((large_rank >= (test_max_rank - 3)) &&
+ } while((large_rank >= (test_max_rank - 3)) &&
(small_rank <= (test_max_rank - 4)) && (x < edge_size));
w++;
- } while((large_rank >= (test_max_rank - 2)) &&
+ } while((large_rank >= (test_max_rank - 2)) &&
(small_rank <= (test_max_rank - 3)) && (w < edge_size));
v++;
- } while((large_rank >= (test_max_rank - 1)) &&
+ } while((large_rank >= (test_max_rank - 1)) &&
(small_rank <= (test_max_rank - 2)) && (v < edge_size));
u++;
- } while((large_rank >= test_max_rank) &&
+ } while((large_rank >= test_max_rank) &&
(small_rank <= (test_max_rank - 1)) && (u < edge_size));
-
+
/* similarly, read the on disk small cube into slices through the in memory
* large cube, and verify that the correct data (and only the correct data)
@@ -3114,12 +3112,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 */
@@ -3135,7 +3132,7 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
CHECK(ret, FAIL, "H5Dread");
- /* verify that the expected data and only the
+ /* verify that the expected data and only the
* expected data was read.
*/
data_ok = TRUE;
@@ -3183,29 +3180,29 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
TestErrPrintf("large cube read from small cube has bad data! Line=%d\n",__LINE__);
x++;
- } while((large_rank >= (test_max_rank - 3)) &&
+ } while((large_rank >= (test_max_rank - 3)) &&
(small_rank <= (test_max_rank - 4)) && (x < edge_size));
w++;
- } while((large_rank >= (test_max_rank - 2)) &&
+ } while((large_rank >= (test_max_rank - 2)) &&
(small_rank <= (test_max_rank - 3)) && (w < edge_size));
v++;
- } while((large_rank >= (test_max_rank - 1)) &&
+ } while((large_rank >= (test_max_rank - 1)) &&
(small_rank <= (test_max_rank - 2)) && (v < edge_size));
u++;
- } while((large_rank >= test_max_rank) &&
+ } while((large_rank >= test_max_rank) &&
(small_rank <= (test_max_rank - 1)) && (u < edge_size));
- /* 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.
+ /* now we go in the opposite direction, verifying that we can write
+ * from memory to file using selections of different rank that
+ * H5Sselect_shape_same() views as being of the same shape.
*
- * Start by writing small_rank D slices from the in memory large cube, to
+ * 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.
- */
+ */
/* select a checker board in the file small cube dataspace */
sel_start[0] = sel_start[1] = sel_start[2] = sel_start[3] = sel_start[4] = 0;
@@ -3237,11 +3234,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
sel_start[3] = x;
/* zero out the on disk small cube */
- ret = H5Dwrite(small_cube_dataset,
- H5T_NATIVE_UINT16,
- full_small_cube_sid,
- full_small_cube_sid,
- xfer_plist,
+ ret = H5Dwrite(small_cube_dataset,
+ H5T_NATIVE_UINT16,
+ full_small_cube_sid,
+ full_small_cube_sid,
+ xfer_plist,
zero_buf);
CHECK(ret, FAIL, "H5Dwrite");
@@ -3267,22 +3264,21 @@ 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
- * 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,
- file_small_cube_sid,
- xfer_plist,
+ ret = H5Dwrite(small_cube_dataset,
+ H5T_NATIVE_UINT16,
+ mem_large_cube_sid,
+ file_small_cube_sid,
+ xfer_plist,
cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
@@ -3291,11 +3287,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
HDmemset(small_cube_buf_1, 0, sizeof(*small_cube_buf_1) * small_cube_size);
/* read the on disk small cube into memory */
- ret = H5Dread(small_cube_dataset,
+ ret = H5Dread(small_cube_dataset,
H5T_NATIVE_UINT16,
full_small_cube_sid,
- full_small_cube_sid,
- xfer_plist,
+ full_small_cube_sid,
+ xfer_plist,
small_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
@@ -3318,24 +3314,24 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
TestErrPrintf("small cube read from largecube has bad data! Line=%d\n",__LINE__);
x++;
- } while((large_rank >= (test_max_rank - 3)) &&
+ } while((large_rank >= (test_max_rank - 3)) &&
(small_rank <= (test_max_rank - 4)) && (x < edge_size));
w++;
- } while((large_rank >= (test_max_rank - 2)) &&
+ } while((large_rank >= (test_max_rank - 2)) &&
(small_rank <= (test_max_rank - 3)) && (w < edge_size));
v++;
- } while((large_rank >= (test_max_rank - 1)) &&
+ } while((large_rank >= (test_max_rank - 1)) &&
(small_rank <= (test_max_rank - 2)) && (v < edge_size));
u++;
- } while((large_rank >= test_max_rank) &&
+ } while((large_rank >= test_max_rank) &&
(small_rank <= (test_max_rank - 1)) && (u < edge_size));
- /* Now write checker board selections of the entries in memory
- * 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
+ /* Now write checker board selections of the entries in memory
+ * 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
+ * H5Sselect_shape_same() returns true on the memory and file
* selections.
*/
@@ -3369,11 +3365,11 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
sel_start[3] = x;
/* zero out the on disk cube */
- ret = H5Dwrite(large_cube_dataset,
- H5T_NATIVE_USHORT,
- full_large_cube_sid,
- full_large_cube_sid,
- xfer_plist,
+ ret = H5Dwrite(large_cube_dataset,
+ H5T_NATIVE_USHORT,
+ full_large_cube_sid,
+ full_large_cube_sid,
+ xfer_plist,
zero_buf);
CHECK(ret, FAIL, "H5Dwrite");
@@ -3399,23 +3395,22 @@ 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.
*/
- ret = H5Dwrite(large_cube_dataset,
- H5T_NATIVE_UINT16,
- mem_small_cube_sid,
- file_large_cube_sid,
- xfer_plist,
+ ret = H5Dwrite(large_cube_dataset,
+ H5T_NATIVE_UINT16,
+ mem_small_cube_sid,
+ file_large_cube_sid,
+ xfer_plist,
cube_buf);
CHECK(ret, FAIL, "H5Dwrite");
@@ -3424,16 +3419,16 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
HDmemset(large_cube_buf_1, 0, sizeof(*large_cube_buf_1) * large_cube_size);
/* read the on disk large cube into memory */
- ret = H5Dread(large_cube_dataset,
+ ret = H5Dread(large_cube_dataset,
H5T_NATIVE_UINT16,
full_large_cube_sid,
- full_large_cube_sid,
- xfer_plist,
+ full_large_cube_sid,
+ xfer_plist,
large_cube_buf_1);
CHECK(ret, FAIL, "H5Dread");
- /* verify that the expected data and only the
+ /* verify that the expected data and only the
* expected data was written to the on disk large
* cube.
*/
@@ -3483,18 +3478,18 @@ test_select_hyper_checker_board_dr__run_test(int test_num, const uint16_t *cube_
TestErrPrintf("large cube written from small cube has bad data! Line=%d\n",__LINE__);
x++;
- } while((large_rank >= (test_max_rank - 3)) &&
+ } while((large_rank >= (test_max_rank - 3)) &&
(small_rank <= (test_max_rank - 4)) && (x < edge_size));
w++;
- } while((large_rank >= (test_max_rank - 2)) &&
+ } while((large_rank >= (test_max_rank - 2)) &&
(small_rank <= (test_max_rank - 3)) && (w < edge_size));
v++;
- } while((large_rank >= (test_max_rank - 1)) &&
+ } while((large_rank >= (test_max_rank - 1)) &&
(small_rank <= (test_max_rank - 2)) && (v < edge_size));
u++;
- } while((large_rank >= test_max_rank) &&
+ } while((large_rank >= test_max_rank) &&
(small_rank <= (test_max_rank - 1)) && (u < edge_size));
-
+
/* Close memory dataspaces */
ret = H5Sclose(full_small_cube_sid);
@@ -3534,17 +3529,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.
+** 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 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
@@ -3574,7 +3569,7 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist)
/* Allocate cube buffer for writing values */
cube_buf = (uint16_t *)HDmalloc(sizeof(uint16_t) * max_cube_size);
- CHECK(cube_buf, NULL, "HDmalloc");
+ CHECK_PTR(cube_buf, "HDmalloc");
/* Initialize the cube buffer */
cube_ptr = cube_buf;
@@ -3583,7 +3578,7 @@ test_select_hyper_checker_board_dr(hid_t dset_type, hid_t xfer_plist)
/* Allocate cube buffer for zeroing values on disk */
zero_buf = (uint16_t *)HDcalloc(sizeof(uint16_t), max_cube_size);
- CHECK(zero_buf, NULL, "HDcalloc");
+ CHECK_PTR(zero_buf, "HDcalloc");
for(large_rank = 1; large_rank <= max_rank; large_rank++) {
for(small_rank = 1; small_rank < large_rank; small_rank++) {
@@ -3619,7 +3614,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.
@@ -3629,33 +3624,33 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
rbuf2 = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf2, NULL, "HDcalloc");
+ CHECK_PTR(rbuf2, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -3743,15 +3738,8 @@ test_select_hyper_copy(void)
CHECK(ret, FAIL, "H5Dread");
/* Compare data read with data written out */
- if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2)) {
+ if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2))
TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__);
-#ifdef QAK
- for(i=0; i<SPACE3_DIM1; i++)
- for(j=0; j<SPACE3_DIM2; j++)
- if((unsigned)*(rbuf+i*SPACE3_DIM2+j)!=(unsigned)*(rbuf2+i*SPACE3_DIM2+j))
- printf("i=%d, j=%d, *rbuf=%u, *rbuf2=%u\n",i,j,(unsigned)*(rbuf+i*SPACE3_DIM2+j),(unsigned)*(rbuf2+i*SPACE3_DIM2+j));
-#endif /* QAK */
- } /* end if */
/* Close memory dataspace */
ret = H5Sclose(sid2);
@@ -3792,32 +3780,32 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint16_t *)HDmalloc(sizeof(uint16_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
rbuf2 = (uint16_t *)HDcalloc(sizeof(uint16_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf2, NULL, "HDcalloc");
+ CHECK_PTR(rbuf2, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -3966,24 +3954,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 */
@@ -3991,9 +3979,9 @@ test_select_hyper_offset(void)
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -4128,30 +4116,30 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE7_DIM1 * SPACE7_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE7_DIM1; i++)
@@ -4249,32 +4237,32 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -4421,17 +4409,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 */
@@ -4444,17 +4432,17 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -4929,12 +4917,11 @@ test_select_hyper_union(void)
HDfree(rbuf);
} /* test_select_hyper_union() */
-#ifdef NEW_HYPERSLAB_API
/****************************************************************
**
** test_select_hyper_union_stagger(): Test basic H5S (dataspace) selection code.
** Tests unions of staggered hyperslabs. (Uses H5Scombine_hyperslab
-** and H5Sselect_select instead of H5Sselect_hyperslab)
+** and H5Smodify_select instead of H5Sselect_hyperslab)
**
****************************************************************/
static void
@@ -4951,11 +4938,11 @@ test_select_hyper_union_stagger(void)
hsize_t count[2]={3,1}; /* 1st Hyperslab size */
hsize_t count2[2]={3,1}; /* 2nd Hyperslab size */
hsize_t count3[2]={2,1}; /* 3rd Hyperslab size */
- hssize_t offset[2]={0,0}; /* 1st Hyperslab offset */
- hssize_t offset2[2]={2,1}; /* 2nd Hyperslab offset */
- hssize_t offset3[2]={4,2}; /* 3rd Hyperslab offset */
+ hsize_t start[2]={0,0}; /* 1st Hyperslab offset */
+ hsize_t start2[2]={2,1}; /* 2nd Hyperslab offset */
+ hsize_t start3[2]={4,2}; /* 3rd Hyperslab offset */
hsize_t count_out[2]={4,2}; /* Hyperslab size in memory */
- hssize_t offset_out[2]={0,3}; /* Hyperslab offset in memory */
+ hsize_t start_out[2]={0,3}; /* Hyperslab offset in memory */
int data[6][5]; /* Data to write */
int data_out[7][7]; /* Data read in */
int input_loc[8][2]={{0,0},
@@ -5026,27 +5013,27 @@ test_select_hyper_union_stagger(void)
CHECK(dataspace, FAIL, "H5Dget_space");
/* Select the hyperslabs */
- error = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
+ error = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, start, stride, count, block);
CHECK(error, FAIL, "H5Sselect_hyperslab");
- tmp_space = H5Scombine_hyperslab(dataspace, H5S_SELECT_OR, offset2, stride, count2, block);
+ tmp_space = H5Scombine_hyperslab(dataspace, H5S_SELECT_OR, start2, stride, count2, block);
CHECK(tmp_space, FAIL, "H5Scombine_hyperslab");
/* Copy the file dataspace and select hyperslab */
tmp2_space = H5Scopy(dataspace);
CHECK(tmp2_space, FAIL, "H5Scopy");
- error=H5Sselect_hyperslab(tmp2_space,H5S_SELECT_SET,offset3,stride,count3,block);
+ error=H5Sselect_hyperslab(tmp2_space, H5S_SELECT_SET, start3, stride, count3, block);
CHECK(error, FAIL, "H5Sselect_hyperslab");
/* Combine the copied dataspace with the temporary dataspace */
- error=H5Sselect_select(tmp_space,H5S_SELECT_OR,tmp2_space);
- CHECK(error, FAIL, "H5Sselect_select");
+ error=H5Smodify_select(tmp_space,H5S_SELECT_OR,tmp2_space);
+ CHECK(error, FAIL, "H5Smodify_select");
/* Create Memory Dataspace */
memspace=H5Screate_simple(memrank,dimsm,NULL);
CHECK(memspace, FAIL, "H5Screate_simple");
/* Select hyperslab in memory */
- error=H5Sselect_hyperslab(memspace,H5S_SELECT_SET,offset_out,stride,count_out,block);
+ error=H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start_out, stride, count_out, block);
CHECK(error, FAIL, "H5Sselect_hyperslab");
/* Read File Dataset */
@@ -5056,10 +5043,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 */
@@ -5089,18 +5076,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;
@@ -5161,8 +5148,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"));
@@ -5220,7 +5207,7 @@ test_select_hyper_union_3d(void)
tmp2_space = H5Scombine_select(sid2,H5S_SELECT_OR,tmp_space);
CHECK(tmp2_space, FAIL, "H5Scombin_select");
- npoints = H5Sget_select_npoints(tmp2_space);
+ npoints = (hsize_t)H5Sget_select_npoints(tmp2_space);
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
@@ -5286,7 +5273,109 @@ test_select_hyper_union_3d(void)
HDfree(wbuf);
HDfree(rbuf);
} /* test_select_hyper_union_3d() */
-#endif /* NEW_HYPERSLAB_API */
+
+/****************************************************************
+**
+** test_select_hyper_valid_combination(): Tests invalid and valid
+** combinations of selections on dataspace for H5Scombine_select
+** and H5Smodify_select.
+**
+****************************************************************/
+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 */
+ 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 */
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing Selection Combination Validity\n"));
+ assert(SPACE9_DIM2>=POINT1_NPOINTS);
+
+ /* Create dataspace for single point selection */
+ single_pt_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL);
+ CHECK(single_pt_sid, FAIL, "H5Screate_simple");
+
+ /* Select sequence of ten points for multiple point selection */
+ coord1[0][0] = 2; coord1[0][1] = 2;
+ ret = H5Sselect_elements(single_pt_sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Create dataspace for single hyperslab selection */
+ single_hyper_sid = H5Screate_simple(SPACE9_RANK, dims2D, NULL);
+ CHECK(single_hyper_sid, FAIL, "H5Screate_simple");
+
+ /* Select 10x10 hyperslab for single hyperslab selection */
+ start[0]=1; start[1]=1;
+ stride[0]=1; stride[1]=1;
+ count[0]=1; count[1]=1;
+ block[0]=(SPACE9_DIM1-2); block[1]=(SPACE9_DIM2-2);
+ ret = H5Sselect_hyperslab(single_hyper_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create dataspace for regular hyperslab selection */
+ regular_hyper_sid = H5Screate_simple(SPACE4_RANK, dims3D, NULL);
+ CHECK(regular_hyper_sid, FAIL, "H5Screate_simple");
+
+ /* Select regular, strided hyperslab selection */
+ start[0]=2; start[1]=2; start[2]=2;
+ stride[0]=2; stride[1]=2; stride[2]=2;
+ count[0]=5; count[1]=2; count[2]=5;
+ block[0]=1; block[1]=1; block[2]=1;
+ ret = H5Sselect_hyperslab(regular_hyper_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+
+ /* 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");
+
+ 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");
+
+ 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");
+
+ 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");
+
+ tmp_sid = H5Smodify_select(single_hyper_sid, H5S_SELECT_AND, non_existent_sid);
+ VERIFY(tmp_sid, FAIL, "H5Smodify_select");
+
+ /* Close dataspaces */
+ ret = H5Sclose(single_pt_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(single_hyper_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(regular_hyper_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+} /* test_select_hyper_valid_combination() */
+
/****************************************************************
**
@@ -5297,31 +5386,31 @@ test_select_hyper_union_3d(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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -5387,12 +5476,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 */
@@ -5426,31 +5515,31 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -5518,12 +5607,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 */
@@ -5557,31 +5646,31 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -5648,12 +5737,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 */
@@ -5687,31 +5776,31 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE2_DIM1; i++)
@@ -5822,14 +5911,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 {
@@ -5847,20 +5936,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 */
@@ -5869,9 +5958,9 @@ test_select_hyper_union_random_5d(hid_t read_plist)
/* Allocate write & read buffers */
wbuf = (int *)HDmalloc(sizeof(int) * SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (int *)HDcalloc(sizeof(int), (size_t)(SPACE5_DIM1 * SPACE5_DIM2 * SPACE5_DIM3 * SPACE5_DIM4 * SPACE5_DIM5));
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE5_DIM1; i++)
@@ -5902,42 +5991,29 @@ test_select_hyper_union_random_5d(hid_t read_plist)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Get initial random # seed */
- seed=(unsigned)time(NULL)+(unsigned)clock();
+ seed = (unsigned)HDtime(NULL) + (unsigned)HDclock();
/* Crunch through a bunch of random hyperslab reads from the file dataset */
for(test_num=0; test_num<NRAND_HYPER; test_num++) {
/* Save random # seed for later use */
/* (Used in case of errors, to regenerate the hyperslab sequence) */
-#ifndef QAK
- seed+=(unsigned)clock();
-#else /* QAK */
- seed=987909620;
-#endif /* QAK */
+ seed += (unsigned)HDclock();
HDsrandom(seed);
-#ifdef QAK
-printf("test_num=%d, seed=%u\n",test_num,seed);
-#endif /* QAK */
-#ifndef QAK
for(i=0; i<NHYPERSLABS; i++) {
-#else /* QAK */
- for(i=0; i<2; i++) {
-#endif /* QAK */
-#ifdef QAK
-printf("hyperslab=%d\n",i);
-#endif /* QAK */
/* Select random hyperslab location & size for selection */
for(j=0; j<SPACE5_RANK; j++) {
start[j] = ((hsize_t)HDrandom() % dims1[j]);
count[j] = (((hsize_t)HDrandom() % (dims1[j] - start[j])) + 1);
-#ifdef QAK
-printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[j],j,(int)(start[j]+count[j]-1));
-#endif /* QAK */
} /* end for */
/* Select hyperslab */
ret = H5Sselect_hyperslab(sid1, (i == 0 ? H5S_SELECT_SET : H5S_SELECT_OR), start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
+ break;
+ } /* end if */
} /* end for */
/* Get the number of elements selected */
@@ -5953,49 +6029,21 @@ printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[
npoints2 = H5Sget_select_npoints(sid2);
VERIFY(npoints, npoints2, "H5Sget_select_npoints");
-#ifdef QAK
-printf("random I/O, before H5Dread(), npoints=%lu\n",(unsigned long)npoints);
-{
- hsize_t blocks[128][2][SPACE5_RANK];
- hssize_t nblocks;
- int k;
-
- nblocks=H5Sget_select_hyper_nblocks(sid1);
- printf("nblocks=%d\n",(int)nblocks);
- H5Sget_select_hyper_blocklist(sid1,0,nblocks,blocks);
- for(j=0; j<nblocks; j++) {
- printf("Block #%d, start = {",j);
- for(k=0; k<SPACE5_RANK; k++) {
- printf("%d",blocks[j][0][k]);
- if(k<(SPACE5_RANK-1))
- printf(", ");
- else
- printf("}, end = {");
- } /* end for */
- for(k=0; k<SPACE5_RANK; k++) {
- printf("%d",blocks[j][1][k]);
- if(k<(SPACE5_RANK-1))
- printf(", ");
- else
- printf("}\n");
- } /* end for */
- } /* end for */
-}
-#endif /* QAK */
/* Read selection from disk */
ret=H5Dread(dataset,H5T_NATIVE_INT,sid2,sid1,read_plist,rbuf);
CHECK(ret, FAIL, "H5Dread");
-#ifdef QAK
-printf("random I/O, after H5Dread()\n");
-#endif /* QAK */
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
+ break;
+ } /* end if */
/* Compare data read with data written out */
tbuf=rbuf;
ret = H5Diterate(wbuf,H5T_NATIVE_INT,sid1,test_select_hyper_iter2,&tbuf);
- if(ret<0) {
- TestErrPrintf("Random hyperslabs for seed %u failed!\n",seed);
+ if(ret < 0) {
+ TestErrPrintf("Random hyperslabs for seed %u failed!\n", seed);
break;
- }
+ } /* end if */
/* Set the read buffer back to all zeroes */
HDmemset(rbuf, 0, (size_t)SPACE6_DIM1);
@@ -6061,17 +6109,17 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist)
/* Allocate the transfer buffers */
data = (short *)HDmalloc(sizeof(short) * X * Y * Z);
- CHECK(data, NULL, "HDmalloc");
+ CHECK_PTR(data, "HDmalloc");
data_out = (short *)HDcalloc((size_t)(NX * NY * NZ), sizeof(short));
- CHECK(data_out, NULL, "HDcalloc");
+ CHECK_PTR(data_out, "HDcalloc");
/*
* Data buffer initialization.
*/
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);
/*
@@ -6083,7 +6131,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;
@@ -6233,8 +6281,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 */
@@ -6281,10 +6329,7 @@ test_select_point_chunk(void)
hid_t dcpl;
herr_t ret; /* Generic return value */
- unsigned *data_out; /* output buffer */
-#ifdef LATER
- unsigned *tmpdata_out; /* output buffer */
-#endif /* LATER */
+ unsigned *data_out; /* output buffer */
hsize_t start[SPACE7_RANK]; /* hyperslab offset */
hsize_t count[SPACE7_RANK]; /* size of the hyperslab */
@@ -6296,16 +6341,16 @@ test_select_point_chunk(void)
/* Allocate the transfer buffers */
data = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(data, NULL, "HDmalloc");
+ CHECK_PTR(data, "HDmalloc");
data_out = (unsigned *)HDcalloc((size_t)(SPACE7_DIM1 * SPACE7_DIM2), sizeof(unsigned));
- CHECK(data_out, NULL, "HDcalloc");
+ CHECK_PTR(data_out, "HDcalloc");
/*
* Data buffer initialization.
*/
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;
/*
@@ -6653,7 +6698,7 @@ test_select_combine(void)
hsize_t dims[SPACE7_RANK]={SPACE7_DIM1,SPACE7_DIM2}; /* Dimensions of dataspace */
H5S_sel_type sel_type; /* Selection type */
hssize_t nblocks; /* Number of hyperslab blocks */
- hsize_t blocks[128][2][SPACE7_RANK]; /* List of blocks */
+ hsize_t blocks[16][2][SPACE7_RANK]; /* List of blocks */
herr_t error;
/* Output message about test being performed */
@@ -7042,22 +7087,22 @@ 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"));
/* Allocate memory buffer */
wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
/* Initialize memory buffer */
for(u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++)
@@ -7116,8 +7161,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 */
@@ -7126,14 +7171,14 @@ 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"));
/* Allocate memory buffer */
wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
/* Initialize memory buffer */
for(u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++)
@@ -7211,8 +7256,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 */
@@ -7223,14 +7268,14 @@ 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"));
/* Allocate memory buffer */
wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
/* Initialize memory buffer */
for(u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++)
@@ -7311,8 +7356,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 */
@@ -7330,14 +7375,14 @@ 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"));
/* Allocate memory buffer */
wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
/* Initialize memory buffer */
for(u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++)
@@ -7419,8 +7464,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 */
@@ -7449,14 +7494,14 @@ 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"));
/* Allocate memory buffer */
wbuf = (unsigned *)HDmalloc(sizeof(unsigned) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
/* Initialize memory buffer */
for(u = 0, tbuf = wbuf; u < SPACE7_DIM1; u++)
@@ -7542,25 +7587,25 @@ 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"));
/* Allocate write & read buffers */
wbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize write buffer */
for(i=0, tbuf=wbuf; i<SPACE7_DIM1; i++)
@@ -7640,11 +7685,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 */
@@ -7654,16 +7699,16 @@ 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"));
/* Allocate write & read buffers */
wbuf_uint8 = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf_uint8, NULL, "HDmalloc");
+ CHECK_PTR(wbuf_uint8, "HDmalloc");
wbuf_ushort = (unsigned short *)HDmalloc(sizeof(unsigned short) * SPACE7_DIM1 * SPACE7_DIM2);
- CHECK(wbuf_ushort, NULL, "HDmalloc");
+ CHECK_PTR(wbuf_ushort, "HDmalloc");
/* Initialize write buffers */
for(i=0, tbuf_uint8=wbuf_uint8, tbuf_ushort=wbuf_ushort; i<SPACE7_DIM1; i++)
@@ -7786,18 +7831,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"));
@@ -7809,7 +7854,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");
@@ -7817,7 +7862,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");
@@ -7827,7 +7872,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);
@@ -7843,18 +7888,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"));
@@ -7977,40 +8022,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"));
@@ -8155,294 +8200,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
@@ -8453,17 +8498,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");
@@ -8479,80 +8526,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
@@ -8567,17 +8614,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");
@@ -8593,139 +8641,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 */
@@ -8733,17 +8781,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");
@@ -8758,18 +8807,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");
@@ -8780,237 +8829,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 */
@@ -9042,54 +9091,54 @@ test_shape_same(void)
/****************************************************************
**
-** test_shape_same_dr__smoke_check_1():
+** 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);
@@ -9105,24 +9154,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");
@@ -9148,24 +9197,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");
@@ -9197,24 +9246,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);
@@ -9251,42 +9300,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 */
@@ -9333,100 +9382,100 @@ 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:
-**
-** * * - - * * - - * *
-** * * - - * * - - * *
-** - - * * - - * * - -
-** - - * * - - * * - -
-** * * - - * * - - * *
-** * * - - * * - - * *
-** - - * * - - * * - -
-** - - * * - - * * - -
-** * * - - * * - - * *
-** * * - - * * - - * *
-**
-** 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.
+** test_shape_same_dr__smoke_check_2():
+**
+** 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 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");
@@ -9443,21 +9492,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");
@@ -9473,21 +9522,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");
@@ -9514,21 +9563,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");
@@ -9543,21 +9592,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");
@@ -9586,21 +9635,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");
@@ -9621,21 +9670,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");
@@ -9652,7 +9701,7 @@ test_shape_same_dr__smoke_check_2(void)
start[0] = 4;
/* This test gets the right answer, but it fails the shape same
- * test in an unexpected point. Bring this up with Quincey, as
+ * test in an unexpected point. Bring this up with Quincey, as
* the oddness looks like it is not related to my code.
* -- JRM
*/
@@ -9664,39 +9713,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 */
@@ -9741,111 +9790,111 @@ 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 - - - - - - - - - -
+** test_shape_same_dr__smoke_check_3():
+**
+** 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");
@@ -9862,101 +9911,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");
@@ -9972,101 +10021,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");
@@ -10084,101 +10133,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");
@@ -10187,36 +10236,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 */
@@ -10252,87 +10301,86 @@ 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() */
/****************************************************************
**
-** test_shape_same_dr__smoke_check_4():
+** 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;
@@ -10340,7 +10388,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;
@@ -10348,7 +10396,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;
@@ -10356,7 +10404,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;
@@ -10364,7 +10412,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;
@@ -10372,7 +10420,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;
@@ -10380,7 +10428,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;
@@ -10388,7 +10436,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;
@@ -10399,39 +10447,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 */
@@ -10472,21 +10520,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
@@ -10498,38 +10545,38 @@ 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[128];
+ 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 );
HDassert( large_rank <= SS_DR_MAX_RANK );
HDassert( 0 <= offset );
HDassert( offset < large_rank );
- HDassert( edge_size > 0 );
- HDassert( edge_size <= 1000 );
+ HDassert( edge_size > 0 );
+ HDassert( edge_size <= 1000 );
- sprintf(test_desc_0,
- "\tn-cube slice through m-cube (n <= m) test %d.\n",
+ 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],
@@ -10587,15 +10634,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 */
@@ -10604,34 +10651,33 @@ 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() */
/****************************************************************
**
-** test_shape_same_dr__run_full_space_vs_slice_tests():
+** 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
@@ -10736,7 +10782,7 @@ test_shape_same_dr__run_full_space_vs_slice_tests(void)
dim_selected,
expected_result
);
-
+
z++;
} while((z < 2) && (large_rank >= 1));
@@ -10753,24 +10799,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().
+** test_shape_same_dr__checkerboard(): Tests selection of a
+** "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
@@ -10783,38 +10828,38 @@ 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[128];
+ 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
- * hyper cube
+ 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
- * checkerboard slice is selected
+ 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 );
HDassert( large_rank <= SS_DR_MAX_RANK );
HDassert( 0 < checker_size );
- HDassert( checker_size <= edge_size );
- HDassert( edge_size <= 1000 );
+ HDassert( checker_size <= edge_size );
+ HDassert( edge_size <= 1000 );
HDassert( 0 <= offset );
HDassert( offset < (int)edge_size );
@@ -10825,13 +10870,13 @@ test_shape_same_dr__checkerboard(int test_num,
HDassert( dims_selected >= 0 );
HDassert( dims_selected <= large_rank );
- sprintf(test_desc_0,
- "\tcheckerboard n-cube slice through m-cube (n <= m) test %d.\n",
+ 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,
@@ -10856,53 +10901,53 @@ 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,
+ * In both cases, asterisks indicate selected elements,
* and dashes indicate unselected elements.
*
* 3-D and 4-D ascii art is somewhat painful, so I'll
* leave those selections to your imagination. :-)
*
* Note, that since the edge_size and checker_size are
- * parameters that are passed in, the selection need
+ * parameters that are passed in, the selection need
* not look exactly like the selection shown above.
- * At present, the function allows checker sizes that
- * are not even divisors of the edge size -- thus
+ * At present, the function allows checker sizes that
+ * 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
+ * As the above pattern can't be selected in one
* call to H5Sselect_hyperslab(), and since the
* values in the start, stride, count, and block
- * arrays will be repeated over all entries in
+ * arrays will be repeated over all entries in
* the selected space case, and over all selected
* dimensions in the selected hyperslab case, we
- * compute these values first and store them in
- * in the base_start, base_stride, base_count,
+ * compute these values first and store them in
+ * in the base_start, base_stride, base_count,
* and base_block arrays.
*/
@@ -10912,9 +10957,9 @@ test_shape_same_dr__checkerboard(int test_num,
base_stride[0] = 2 * checker_size;
base_stride[1] = 2 * checker_size;
- /* Note that the following computation depends on the C99
- * requirement that integer division discard any fraction
- * (truncation towards zero) to function correctly. As we
+ /* Note that the following computation depends on the C99
+ * requirement that integer division discard any fraction
+ * (truncation towards zero) to function correctly. As we
* now require C99, this shouldn't be a problem, but noting
* it may save us some pain if we are ever obliged to support
* pre-C99 compilers again.
@@ -10922,7 +10967,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)
@@ -10931,7 +10976,7 @@ test_shape_same_dr__checkerboard(int test_num,
base_block[0] = checker_size;
base_block[1] = checker_size;
- /* now setup start, stride, count, and block arrays for
+ /* now setup start, stride, count, and block arrays for
* the first call to H5Sselect_hyperslab().
*/
for(i = 0; i < SS_DR_MAX_RANK; i++) {
@@ -10945,10 +10990,10 @@ test_shape_same_dr__checkerboard(int test_num,
start, stride, count, block);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* if small_rank == 1, or if edge_size == checker_size, we
+ /* if small_rank == 1, or if edge_size == checker_size, we
* are done, as either there is no added dimension in which
* to place offset selected "checkers".
- *
+ *
* Otherwise, set up start, stride, count and block, and
* make the additional selection.
*/
@@ -10968,9 +11013,9 @@ 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
+ * Some how, it seems that selections can extend beyond the
+ * 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++) {
@@ -10991,8 +11036,8 @@ test_shape_same_dr__checkerboard(int test_num,
/* Now select the checkerboard selection in the (possibly larger) n-cube.
- *
- * Since we have already calculated the base start, stride, count,
+ *
+ * Since we have already calculated the base start, stride, count,
* and block, re-use the values in setting up start, stride, count,
* and block.
*/
@@ -11031,15 +11076,15 @@ 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");
- /* As before, if the number of dimensions selected is less than or
- * equal to 1, or if edge_size == checker_size, we are done, as
- * either there is no added dimension in which to place offset selected
- * "checkers", or the hyperslab is completely occupied by one
+ /* As before, if the number of dimensions selected is less than or
+ * equal to 1, or if edge_size == checker_size, we are done, as
+ * either there is no added dimension in which to place offset selected
+ * "checkers", or the hyperslab is completely occupied by one
* "checker".
*
* Otherwise, set up start, stride, count and block, and
@@ -11069,9 +11114,9 @@ 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
+ * Again, it seems that selections can extend beyond the
+ * 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++) {
@@ -11086,8 +11131,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 */
@@ -11096,29 +11141,28 @@ test_shape_same_dr__checkerboard(int test_num,
ret = H5Sclose(n_cube_1_sid);
CHECK(ret, FAIL, "H5Sclose");
-
} /* test_shape_same_dr__checkerboard() */
/****************************************************************
**
-** test_shape_same_dr__run_checkerboard_tests():
+** test_shape_same_dr__run_checkerboard_tests():
**
-** In this set of tests, we test H5S_select_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).
+** 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:
+** All the n-cubes will have lengths of the same size, so
+** 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
+** 1) the rank of the n cube equals the number of dimensions
+** selected in the checker board slice through the m-cube
** (m >= n).
**
-** 2) The dimensions selected in the checkerboard slice
-** through the m-cube are the dimensions with the most
+** 2) The dimensions selected in the checkerboard slice
+** through the m-cube are the dimensions with the most
** quickly changing indices.
**
****************************************************************/
@@ -11169,7 +11213,7 @@ test_shape_same_dr__run_checkerboard_tests(void)
dim_selected[4] = FALSE;
else
dim_selected[4] = TRUE;
-
+
/* compute the expected result: */
i = 0;
@@ -11367,23 +11411,22 @@ 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() */
/****************************************************************
**
-** test_shape_same_dr__irregular():
+** 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
@@ -11395,77 +11438,77 @@ 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[128];
- 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 );
HDassert( large_rank <= SS_DR_MAX_RANK );
- HDassert( 9 <= edge_size );
- HDassert( edge_size <= 1000 );
+ HDassert( 9 <= edge_size );
+ HDassert( edge_size <= 1000 );
HDassert( 0 <= slice_offset );
HDassert( slice_offset < edge_size );
HDassert( -2 <= pattern_offset );
@@ -11478,16 +11521,16 @@ test_shape_same_dr__irregular(int test_num,
HDassert( dims_selected >= 0 );
HDassert( dims_selected <= large_rank );
- sprintf(test_desc_0,
- "\tirregular sub set of n-cube slice through m-cube (n <= m) test %d.\n",
+ 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,
+ edge_size,
slice_offset, pattern_offset,
(int)dim_selected[0],
(int)dim_selected[1],
@@ -11506,42 +11549,42 @@ test_shape_same_dr__irregular(int test_num,
CHECK(n_cube_0_sid, FAIL, "H5Screate_simple");
/* Select an "irregular" pattern in the small n-cube. This
- * pattern can be though of a set of four 3 x 2 x 2 X 2
- * four dimensional prisims, each parallel to one of the
- * axies and none of them intersecting with the other.
+ * pattern can be though of a set of four 3 x 2 x 2 X 2
+ * four dimensional prisims, each parallel to one of the
+ * axies and none of them intersecting with the other.
*
- * In the lesser dimensional cases, this 4D pattern is
+ * In the lesser dimensional cases, this 4D pattern is
* projected onto the lower dimensional space.
*
* 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,
+ * In both cases, asterisks indicate selected elements,
* and dashes indicate unselected elements.
*
* 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.
+ * the pattern does not change. However, we do use the
+ * displacement parameter to allow it to be moved around
+ * within the n-cube or hyperslab.
*/
/* first, ensure that the small n-cube has no selection */
@@ -11555,7 +11598,7 @@ test_shape_same_dr__irregular(int test_num,
CHECK(ret, FAIL, "H5Sselect_hyperslab");
} /* end for */
- /* finally, clip the selection to ensure that it lies fully
+ /* finally, clip the selection to ensure that it lies fully
* within the n-cube.
*/
ret = H5Sselect_hyperslab(n_cube_0_sid, H5S_SELECT_AND,
@@ -11594,8 +11637,8 @@ test_shape_same_dr__irregular(int test_num,
/* Now select the irregular selection in the (possibly larger) n-cube.
- *
- * Basic idea is to project the pattern used in the smaller n-cube
+ *
+ * Basic idea is to project the pattern used in the smaller n-cube
* onto the dimensions selected in the larger n-cube, with the displacement
* specified.
*/
@@ -11617,13 +11660,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,
@@ -11632,8 +11675,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 */
@@ -11642,31 +11685,30 @@ test_shape_same_dr__irregular(int test_num,
ret = H5Sclose(n_cube_1_sid);
CHECK(ret, FAIL, "H5Sclose");
-
} /* test_shape_same_dr__irregular() */
/****************************************************************
**
-** test_shape_same_dr__run_irregular_tests():
+** test_shape_same_dr__run_irregular_tests():
**
-** In this set of tests, we test H5S_select_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.
+** 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.
**
** 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
+** 1) the rank of the n cube equals the number of dimensions
+** selected in the irregular slice through the m-cube
** (m >= n).
**
-** 2) The dimensions selected in the irregular slice
-** through the m-cube are the dimensions with the most
+** 2) The dimensions selected in the irregular slice
+** through the m-cube are the dimensions with the most
** quickly changing indices.
**
****************************************************************/
@@ -11717,7 +11759,7 @@ test_shape_same_dr__run_irregular_tests(void)
dim_selected[4] = FALSE;
else
dim_selected[4] = TRUE;
-
+
/* compute the expected result: */
i = 0;
@@ -11857,15 +11899,14 @@ 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() */
/****************************************************************
**
-** test_shape_same_dr(): Tests selections on dataspace with
-** different ranks, to verify that "shape same" routine
-** is now handling this case correctly.
+** test_shape_same_dr(): Tests selections on dataspace with
+** different ranks, to verify that "shape same" routine
+** is now handling this case correctly.
**
****************************************************************/
static void
@@ -11874,19 +11915,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() */
@@ -11911,7 +11949,8 @@ test_space_rebuild(void)
hid_t sid_irreg1,sid_irreg2,sid_irreg3,sid_irreg4,sid_irreg5;
/* rebuild status state */
- htri_t rebuild_stat,rebuild_check;
+ H5S_diminfo_valid_t rebuild_stat1,rebuild_stat2;
+ htri_t rebuild_check;
herr_t ret;
/* dimensions of rank 1 to rank 5 */
@@ -11980,18 +12019,22 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_reg1,H5S_SELECT_OR,start1,stride1,count1,block1);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_reg1);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be TRUE. */
- if(!rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_reg1,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 and rebuild_stat2 should be
+ * H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
}
- else {
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ 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");
}
/* For irregular hyperslab */
@@ -12012,14 +12055,19 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_irreg1,H5S_SELECT_OR,start1,stride1,count1,block1);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = TRUE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_irreg1);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_irreg1,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ /* No need to do shape comparision */
MESSAGE(7, ("Testing functionality to rebuild 2-D hyperslab selection\n"));
@@ -12059,18 +12107,22 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_reg2,H5S_SELECT_OR,start2,stride2,count2,block2);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_reg2);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be TRUE. */
- if(!rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_reg2,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 and rebuild_stat2 should be
+ * H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
}
- else {
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ } /* 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");
}
/* 2-D irregular case */
@@ -12096,14 +12148,19 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_irreg2,H5S_SELECT_OR,start2,stride2,count2,block2);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = TRUE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_irreg2);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_irreg2,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ /* No need to do shape comparision */
MESSAGE(7, ("Testing functionality to rebuild 3-D hyperslab selection\n"));
@@ -12148,19 +12205,22 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_reg3,H5S_SELECT_OR,start3,stride3,count3,block3);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_reg3);
- assert(rebuild_stat!=FAIL);
-
- /* In this case, rebuild_stat should be TRUE. */
- if(!rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_reg3,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 and rebuild_stat2 should be
+ * H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
}
- else {
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ 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");
}
sid_irreg3 = H5Screate_simple(SPACERE3_RANK,dims3,NULL);
@@ -12191,14 +12251,19 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_irreg3,H5S_SELECT_OR,start3,stride3,count3,block3);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = TRUE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_irreg3);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_irreg3,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ /* No need to do shape comparision */
MESSAGE(7, ("Testing functionality to rebuild 4-D hyperslab selection\n"));
@@ -12251,18 +12316,22 @@ test_space_rebuild(void)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_reg4);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be TRUE. */
- if(!rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_reg4,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 and rebuild_stat2 should be
+ * H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
}
- else {
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ 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");
}
/* Testing irregular selection */
@@ -12304,14 +12373,19 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_irreg4,H5S_SELECT_OR,start4,stride4,count4,block4);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = TRUE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_irreg4);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_irreg4,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ /* No need to do shape comparision */
MESSAGE(7, ("Testing functionality to rebuild 5-D hyperslab selection\n"));
@@ -12348,7 +12422,7 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_reg_ori5,H5S_SELECT_SET,start5,stride5,count5,block5);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- /* Build up four dimensional regular selection with H5_SELECT_OR, inside HDF5,
+ /* Build up five dimensional regular selection with H5_SELECT_OR, inside HDF5,
it will be treated as an irregular selection. */
start5[4] = 1;
count5[4] = 1;
@@ -12368,18 +12442,22 @@ test_space_rebuild(void)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_reg5);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be TRUE. */
- if(!rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_reg5,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 and rebuild_stat2 should be
+ * H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
}
- else {
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ 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");
}
sid_irreg5 = H5Screate_simple(SPACERE5_RANK,dims5,NULL);
@@ -12426,14 +12504,19 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_irreg5,H5S_SELECT_OR,start5,stride5,count5,block5);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = TRUE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_irreg5);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_irreg5,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ /* No need to do shape comparision */
/* We use 5-D to test a special case with
rebuilding routine TRUE, FALSE and TRUE */
@@ -12467,13 +12550,20 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_spec,H5S_SELECT_SET,start5,stride5,count5,block5);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_spec);
- /* In this case, rebuild_stat should be TRUE. */
- if(!rebuild_stat){
+
+ ret = H5S__get_rebuild_status_test(sid_spec,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 and rebuild_stat2 should both be
+ * H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ /* No need to do shape comparision */
/* Adding some selections to make it real irregular */
start5[3] = 1;
@@ -12489,15 +12579,21 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_spec,H5S_SELECT_OR,start5,stride5,count5,block5);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = TRUE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_spec);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_spec,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_IMPOSSIBLE. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_IMPOSSIBLE) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ /* No need to do shape comparision */
+ /* Add more selections to make it regular again */
start5[3] = 5;
count5[3] = 1;
stride5[3] = 4;
@@ -12511,14 +12607,19 @@ test_space_rebuild(void)
ret = H5Sselect_hyperslab(sid_spec,H5S_SELECT_OR,start5,stride5,count5,block5);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
- rebuild_stat = FALSE;
- rebuild_stat = H5S_get_rebuild_status_test(sid_spec);
- assert(rebuild_stat!=FAIL);
- /* In this case, rebuild_stat should be FALSE. */
- if(!rebuild_stat){
+ ret = H5S__get_rebuild_status_test(sid_spec,&rebuild_stat1,&rebuild_stat2);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ /* In this case, rebuild_stat1 should be H5S_DIMINFO_VALID_NO and
+ * rebuild_stat2 should be H5S_DIMINFO_VALID_YES. */
+ if(rebuild_stat1 != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret,FAIL,"H5S_hyper_rebuild");
+ }
+ if(rebuild_stat2 != H5S_DIMINFO_VALID_YES) {
ret = FAIL;
CHECK(ret,FAIL,"H5S_hyper_rebuild");
- }/* No need to do shape comparision */
+ }
+ /* No need to do shape comparision */
H5Sclose(sid_reg1);
CHECK(ret, FAIL, "H5Sclose");
@@ -12549,7 +12650,792 @@ test_space_rebuild(void)
CHECK(ret, FAIL, "H5Sclose");
}
-
+
+/****************************************************************
+**
+** test_space_update_diminfo(): Tests selection diminfo update
+** routine. We will test whether regular selections can be
+** quickly updated when the selection is modified.
+**
+**
+****************************************************************/
+static void
+test_space_update_diminfo(void)
+{
+ hid_t space_id; /* Dataspace id */
+ H5S_diminfo_valid_t diminfo_valid; /* Diminfo status */
+ H5S_diminfo_valid_t rebuild_status; /* Diminfo status after rebuid */
+ H5S_sel_type sel_type; /* Selection type */
+ herr_t ret; /* Return value */
+
+ /* dimensions of rank 1 to rank 5 */
+ hsize_t dims1[] ={SPACEUD1_DIM0};
+ hsize_t dims3[] ={SPACEUD3_DIM0, SPACEUD3_DIM1, SPACEUD3_DIM2};
+
+ /* The start of the hyperslab */
+ hsize_t start1[1], start3[3];
+
+ /* The stride of the hyperslab */
+ hsize_t stride1[1], stride3[3];
+
+ /* The number of blocks for the hyperslab */
+ hsize_t count1[1], count3[3];
+
+ /* The size of each block for the hyperslab */
+ hsize_t block1[1], block3[3];
+
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing functionality to update hyperslab dimension info\n"));
+
+
+ MESSAGE(7, ("Testing functionality to update 1-D hyperslab dimension info\n"));
+
+ /*
+ * Test adding regularly spaced distinct blocks
+ */
+
+ /* Create 1-D dataspace */
+ space_id = H5Screate_simple(1, dims1, NULL);
+
+ /* Create single block */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block after first, with OR */
+ start1[0] = 6;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block before first, this time with XOR */
+ start1[0] = 0;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add two blocks after current block */
+ start1[0] = 9;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add two blocks overlapping current block, with OR */
+ start1[0] = 9;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add two blocks partially overlapping current block, with OR */
+ start1[0] = 12;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add two blocks partially overlapping current block, with XOR */
+ start1[0] = 15;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO, after rebuild it should be IMPOSSIBLE */
+ ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid,
+ &rebuild_status);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+ if(rebuild_status != H5S_DIMINFO_VALID_IMPOSSIBLE) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_rebuild");
+ } /* end if */
+
+ /* Fill in missing block */
+ start1[0] = 15;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO, after rebuild it should be YES */
+ ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid,
+ &rebuild_status);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+ if(rebuild_status != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_rebuild");
+ } /* end if */
+
+ /*
+ * Test adding contiguous blocks
+ */
+
+ /* Create single block */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block immediately after first, with OR */
+ start1[0] = 5;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block immediately before first, with XOR */
+ start1[0] = 1;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add differently size block immediately after current, with OR */
+ start1[0] = 7;
+ count1[0] = 1;
+ block1[0] = 7;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /*
+ * Test adding overlapping blocks
+ */
+
+ /* Create single block */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block completely overlapping first, with OR */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block parially overlapping first, with OR */
+ start1[0] = 4;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block completely enclosing current, with OR */
+ start1[0] = 2;
+ count1[0] = 1;
+ block1[0] = 5;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add block completely enclosed by current, with OR */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add equally sized block parially overlapping current, with XOR */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 5;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Fill in hole in block */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 4;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO, after rebuild it should be YES */
+ ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid,
+ &rebuild_status);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+ if(rebuild_status != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_rebuild");
+ } /* end if */
+
+ /* Add differently sized block parially overlapping current, with XOR */
+ start1[0] = 4;
+ count1[0] = 1;
+ block1[0] = 5;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Fill in hole in block */
+ start1[0] = 4;
+ count1[0] = 1;
+ block1[0] = 4;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO, after rebuild it should be YES */
+ ret = H5S__get_rebuild_status_test(space_id, &diminfo_valid,
+ &rebuild_status);
+ CHECK(ret, FAIL, "H5S__get_rebuild_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+ if(rebuild_status != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_rebuild");
+ } /* end if */
+
+ /* Add block completely overlapping current, with XOR */
+ start1[0] = 2;
+ count1[0] = 1;
+ block1[0] = 7;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_XOR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ sel_type = H5Sget_select_type(space_id);
+ VERIFY(sel_type, H5S_SEL_NONE, "H5Sget_select_type");
+
+ /*
+ * Test various conditions that break the fast algorithm
+ */
+
+ /* Create multiple blocks */
+ start1[0] = 3;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create single block with start out of phase */
+ start1[0] = 8;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks */
+ start1[0] = 3;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks with start out of phase */
+ start1[0] = 8;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks */
+ start1[0] = 3;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks with wrong stride */
+ start1[0] = 9;
+ stride1[0] = 4;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create single block */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create single block with wrong size */
+ start1[0] = 6;
+ count1[0] = 1;
+ block1[0] = 1;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create single block */
+ start1[0] = 3;
+ count1[0] = 1;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks with wrong size */
+ start1[0] = 6;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 1;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks */
+ start1[0] = 3;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create single block with wrong size */
+ start1[0] = 9;
+ count1[0] = 1;
+ block1[0] = 1;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, NULL, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks */
+ start1[0] = 3;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks with wrong size */
+ start1[0] = 9;
+ stride1[0] = 3;
+ count1[0] = 2;
+ block1[0] = 1;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start1, stride1, count1, block1);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ ret = H5Sclose(space_id);
+ CHECK(ret, FAIL, "H5Sclose");
+
+
+ MESSAGE(7, ("Testing functionality to update 3-D hyperslab dimension info\n"));
+
+ /* Create 3-D dataspace */
+ space_id = H5Screate_simple(3, dims3, NULL);
+
+ /* Create multiple blocks */
+ start3[0] = 0;
+ start3[1] = 1;
+ start3[2] = 2;
+ stride3[0] = 2;
+ stride3[1] = 3;
+ stride3[2] = 4;
+ count3[0] = 4;
+ count3[1] = 3;
+ count3[2] = 2;
+ block3[0] = 1;
+ block3[1] = 2;
+ block3[2] = 3;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add blocks with same values in all dimensions */
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add blocks with same values in two dimensions */
+ start3[0] = 8;
+ stride3[0] = 1;
+ count3[0] = 1;
+ block3[0] = 1;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks */
+ start3[0] = 0;
+ start3[1] = 1;
+ start3[2] = 2;
+ stride3[0] = 2;
+ stride3[1] = 3;
+ stride3[2] = 4;
+ count3[0] = 4;
+ count3[1] = 3;
+ count3[2] = 2;
+ block3[0] = 1;
+ block3[1] = 2;
+ block3[2] = 3;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add blocks with same values in one dimension */
+ start3[0] = 8;
+ start3[1] = 10;
+ stride3[0] = 1;
+ stride3[1] = 1;
+ count3[0] = 1;
+ count3[1] = 1;
+ block3[0] = 1;
+ block3[1] = 2;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Create multiple blocks */
+ start3[0] = 0;
+ start3[1] = 1;
+ start3[2] = 2;
+ stride3[0] = 2;
+ stride3[1] = 3;
+ stride3[2] = 4;
+ count3[0] = 4;
+ count3[1] = 3;
+ count3[2] = 2;
+ block3[0] = 1;
+ block3[1] = 2;
+ block3[2] = 3;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be YES */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_YES) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ /* Add blocks with same values in no dimensions */
+ start3[0] = 8;
+ start3[1] = 10;
+ start3[2] = 10;
+ stride3[0] = 1;
+ stride3[1] = 1;
+ stride3[2] = 1;
+ count3[0] = 1;
+ count3[1] = 1;
+ count3[2] = 1;
+ block3[0] = 1;
+ block3[1] = 2;
+ block3[2] = 3;
+ ret = H5Sselect_hyperslab(space_id, H5S_SELECT_OR, start3, stride3, count3, block3);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* diminfo_valid should be NO */
+ ret = H5S__get_diminfo_status_test(space_id, &diminfo_valid);
+ CHECK(ret, FAIL, "H5S__get_diminfo_status_test");
+ if(diminfo_valid != H5S_DIMINFO_VALID_NO) {
+ ret = FAIL;
+ CHECK(ret, FAIL, "H5S_hyper_update_diminfo");
+ } /* end if */
+
+ ret = H5Sclose(space_id);
+ CHECK(ret, FAIL, "H5Sclose");
+} /* end test_space_update_diminfo() */
+
+
/****************************************************************
**
** test_select_hyper_chunk_offset(): Tests selections on dataspace,
@@ -12581,9 +13467,9 @@ test_select_hyper_chunk_offset(void)
/* Allocate buffers */
wbuf = (int *)HDmalloc(sizeof(int) * SPACE10_DIM1);
- CHECK(wbuf, NULL, "HDmalloc");
+ CHECK_PTR(wbuf, "HDmalloc");
rbuf = (int *)HDcalloc(sizeof(int), SPACE10_DIM1);
- CHECK(rbuf, NULL, "HDcalloc");
+ CHECK_PTR(rbuf, "HDcalloc");
/* Initialize the write buffer */
for(i=0; i<SPACE10_DIM1; i++)
@@ -12928,9 +13814,9 @@ test_select_bounds(void)
/* Get bounds for 'none' selection */
H5E_BEGIN_TRY {
ret = H5Sget_select_bounds(sid, low_bounds, high_bounds);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Sget_select_bo unds");
-
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_select_bo unds");
+
/* Set point selection */
coord[0][0] = 3; coord[0][1] = 3;
coord[1][0] = 3; coord[1][1] = 96;
@@ -13071,6 +13957,7 @@ test_select_bounds(void)
CHECK(ret, FAIL, "H5Sclose");
} /* test_select_bounds() */
+
/****************************************************************
**
** test_hyper_regular(): Tests query operations on regular hyperslabs
@@ -13106,14 +13993,14 @@ test_hyper_regular(void)
/* Query if 'all' selection is regular hyperslab (should fail) */
H5E_BEGIN_TRY {
is_regular = H5Sis_regular_hyperslab(sid);
- } H5E_END_TRY;
- VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
H5E_BEGIN_TRY {
ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
/* Set 'none' selection */
ret = H5Sselect_none(sid);
@@ -13122,14 +14009,14 @@ test_hyper_regular(void)
/* Query if 'none' selection is regular hyperslab (should fail) */
H5E_BEGIN_TRY {
is_regular = H5Sis_regular_hyperslab(sid);
- } H5E_END_TRY;
- VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
H5E_BEGIN_TRY {
ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
/* Set point selection */
coord[0][0] = 3; coord[0][1] = 3; coord[0][2] = 3;
@@ -13142,14 +14029,14 @@ test_hyper_regular(void)
/* Query if 'point' selection is regular hyperslab (should fail) */
H5E_BEGIN_TRY {
is_regular = H5Sis_regular_hyperslab(sid);
- } H5E_END_TRY;
- VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
H5E_BEGIN_TRY {
ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
/* Set "regular" hyperslab selection */
start[0] = 2; start[1] = 2; start[2] = 2;
@@ -13161,7 +14048,7 @@ test_hyper_regular(void)
/* Query if 'hyperslab' selection is regular hyperslab (should be TRUE) */
is_regular = H5Sis_regular_hyperslab(sid);
- VERIFY(is_regular, TRUE, "H5Sis_regular_hyperslab");
+ VERIFY(is_regular, TRUE, "H5Sis_regular_hyperslab");
/* Retrieve the hyperslab parameters */
ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
@@ -13187,13 +14074,13 @@ test_hyper_regular(void)
/* Query if 'hyperslab' selection is regular hyperslab (should be FALSE) */
is_regular = H5Sis_regular_hyperslab(sid);
- VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab");
+ VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab");
/* Query regular hyperslab selection info (should fail) */
H5E_BEGIN_TRY {
ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
- } H5E_END_TRY;
- VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_regular_hyperslab");
/* 'XOR' in the point again, to remove it, which should make it regular again */
t_start[0] = 0; t_start[1] = 0; t_start[2] = 0;
@@ -13203,7 +14090,7 @@ test_hyper_regular(void)
/* Query if 'hyperslab' selection is regular hyperslab (should be TRUE) */
is_regular = H5Sis_regular_hyperslab(sid);
- VERIFY(is_regular, TRUE, "H5Sis_regular_hyperslab");
+ VERIFY(is_regular, TRUE, "H5Sis_regular_hyperslab");
/* Retrieve the hyperslab parameters */
ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block);
@@ -13661,6 +14548,934 @@ test_hyper_unlim(void)
/****************************************************************
**
+** test_internal_consistency(): Tests selections on dataspace, then
+** verify that internal states of data structures of selections are
+** consistent.
+**
+****************************************************************/
+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
+ * selection that is the entire dataspace
+ */
+ 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 */
+ 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 */
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing Consistency of Internal States\n"));
+ assert(SPACE9_DIM2>=POINT1_NPOINTS);
+
+ /* Create dataspace for "all" selection */
+ all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(all_sid, FAIL, "H5Screate_simple");
+
+ /* Select entire extent for dataspace */
+ ret = H5Sselect_all(all_sid);
+ CHECK(ret, FAIL, "H5Sselect_all");
+
+ /* Create dataspace for "none" selection */
+ none_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(none_sid, FAIL, "H5Screate_simple");
+
+ /* Un-Select entire extent for dataspace */
+ ret = H5Sselect_none(none_sid);
+ CHECK(ret, FAIL, "H5Sselect_none");
+
+ /* Create dataspace for single point selection */
+ single_pt_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(single_pt_sid, FAIL, "H5Screate_simple");
+
+ /* Select sequence of ten points for multiple point selection */
+ coord1[0][0] = 2; coord1[0][1] = 2;
+ ret = H5Sselect_elements(single_pt_sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Create dataspace for multiple point selection */
+ mult_pt_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(mult_pt_sid, FAIL, "H5Screate_simple");
+
+ /* Select sequence of ten points for multiple point selection */
+ coord2[0][0]=2; coord2[0][1]=2;
+ coord2[1][0]=7; coord2[1][1]=2;
+ coord2[2][0]=1; coord2[2][1]=4;
+ coord2[3][0]=2; coord2[3][1]=6;
+ coord2[4][0]=0; coord2[4][1]=8;
+ coord2[5][0]=3; coord2[5][1]=2;
+ coord2[6][0]=4; coord2[6][1]=4;
+ coord2[7][0]=1; coord2[7][1]=0;
+ coord2[8][0]=5; coord2[8][1]=1;
+ coord2[9][0]=9; coord2[9][1]=3;
+ ret = H5Sselect_elements(mult_pt_sid, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord2);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Create dataspace for single hyperslab selection */
+ single_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(single_hyper_sid, FAIL, "H5Screate_simple");
+
+ /* Select 10x10 hyperslab for single hyperslab selection */
+ start[0]=1; start[1]=1;
+ stride[0]=1; stride[1]=1;
+ count[0]=1; count[1]=1;
+ block[0]=(SPACE9_DIM1-2); block[1]=(SPACE9_DIM2-2);
+ ret = H5Sselect_hyperslab(single_hyper_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create dataspace for single hyperslab selection with entire extent selected */
+ single_hyper_all_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(single_hyper_all_sid, FAIL, "H5Screate_simple");
+
+ /* Select entire extent for hyperslab selection */
+ start[0]=0; start[1]=0;
+ stride[0]=1; stride[1]=1;
+ count[0]=1; count[1]=1;
+ block[0]=SPACE9_DIM1; block[1]=SPACE9_DIM2;
+ ret = H5Sselect_hyperslab(single_hyper_all_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create dataspace for single hyperslab selection with single point selected */
+ single_hyper_pt_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(single_hyper_pt_sid, FAIL, "H5Screate_simple");
+
+ /* Select entire extent for hyperslab selection */
+ 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(single_hyper_pt_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create dataspace for regular hyperslab selection */
+ regular_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(regular_hyper_sid, FAIL, "H5Screate_simple");
+
+ /* Select regular, strided hyperslab selection */
+ start[0]=2; start[1]=2;
+ stride[0]=2; stride[1]=2;
+ count[0]=5; count[1]=2;
+ block[0]=1; block[1]=1;
+ ret = H5Sselect_hyperslab(regular_hyper_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create dataspace for irregular hyperslab selection */
+ irreg_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(irreg_hyper_sid, FAIL, "H5Screate_simple");
+
+ /* Create irregular hyperslab selection by OR'ing two blocks together */
+ 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(irreg_hyper_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ start[0]=4; start[1]=4;
+ stride[0]=1; stride[1]=1;
+ count[0]=1; count[1]=1;
+ block[0]=3; block[1]=3;
+ ret = H5Sselect_hyperslab(irreg_hyper_sid,H5S_SELECT_OR,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create dataspace for "no" hyperslab selection */
+ none_hyper_sid = H5Screate_simple(SPACE9_RANK, dims, NULL);
+ CHECK(none_hyper_sid, FAIL, "H5Screate_simple");
+
+ /* Create "no" hyperslab selection by XOR'ing same blocks together */
+ 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(none_hyper_sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ ret = H5Sselect_hyperslab(none_hyper_sid,H5S_SELECT_XOR,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create scalar dataspace for "all" selection */
+ scalar_all_sid = H5Screate(H5S_SCALAR);
+ CHECK(scalar_all_sid, FAIL, "H5Screate");
+
+ /* Create scalar dataspace for "none" selection */
+ scalar_none_sid = H5Screate(H5S_SCALAR);
+ CHECK(scalar_none_sid, FAIL, "H5Screate");
+
+ /* Un-Select entire extent for dataspace */
+ ret = H5Sselect_none(scalar_none_sid);
+ CHECK(ret, FAIL, "H5Sselect_none");
+
+ /* Test all the selections created */
+
+ /* 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");
+
+ 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 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 "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 "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 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 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");
+
+ /* Close dataspaces */
+ ret = H5Sclose(all_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(none_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(single_pt_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(mult_pt_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(single_hyper_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(single_hyper_all_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(single_hyper_pt_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(regular_hyper_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(irreg_hyper_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(none_hyper_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(scalar_all_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(scalar_none_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+} /* test_internal_consistency() */
+
+/****************************************************************
+**
+** test_irreg_io(): Tests unusual selections on datasets, to stress the
+** new hyperslab code.
+**
+****************************************************************/
+static void
+test_irreg_io(void)
+{
+ hid_t fid; /* File ID */
+ hid_t did; /* Dataset ID */
+ 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 start[2]; /* Hyperslab start */
+ hsize_t stride[2]; /* Hyperslab stride */
+ hsize_t count[2]; /* Hyperslab block count */
+ hsize_t block[2]; /* Hyperslab block size */
+ unsigned char wbuf[72]; /* Write buffer */
+ unsigned char rbuf[32]; /* Read buffer */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing Irregular Hyperslab I/O\n"));
+
+ /* Create file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create dataspace for dataset */
+ sid = H5Screate_simple(2, dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Set chunk dimensions for dataset */
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl_id, FAIL, "H5Pcreate");
+ ret = H5Pset_chunk(dcpl_id, 2, chunk_dims);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Create a dataset */
+ did = H5Dcreate2(fid, SPACE1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
+
+ /* Initialize the write buffer */
+ for(u = 0; u < 72; u++)
+ wbuf[u] = (unsigned char)u;
+
+ /* Write entire dataset to disk */
+ ret = H5Dwrite(did, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Close the DCPL */
+ ret = H5Pclose(dcpl_id);
+ CHECK(ret, FAIL, "H5Pclose");
+
+ /* Create dataspace for memory selection */
+ mem_sid = H5Screate_simple(1, mem_dims, NULL);
+ CHECK(mem_sid, FAIL, "H5Screate_simple");
+
+ /* Select 'L'-shaped region within dataset */
+ start[0] = 0; start[1] = 10;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 4; count[1] = 2;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ start[0] = 4; start[1] = 0;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 2; count[1] = 12;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Reset the buffer */
+ HDmemset(rbuf, 0, sizeof(rbuf));
+
+ /* Read selection from disk */
+ ret = H5Dread(did, H5T_NATIVE_UCHAR, mem_sid, sid, H5P_DEFAULT, rbuf);
+ CHECK(ret, FAIL, "H5Dread");
+
+
+ /* Close everything */
+ ret = H5Sclose(mem_sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_irreg_io() */
+
+/****************************************************************
+**
+** test_sel_iter(): Test selection iterator API routines.
+**
+****************************************************************/
+static void
+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 start[2]; /* Hyperslab start */
+ hsize_t stride[2]; /* Hyperslab stride */
+ hsize_t count[2]; /* Hyperslab block count */
+ hsize_t block[2]; /* Hyperslab block size */
+ size_t nseq; /* # of sequences retrieved */
+ size_t nbytes; /* # of bytes retrieved */
+ hsize_t off[SEL_ITER_MAX_SEQ]; /* Offsets for retrieved sequences */
+ size_t len[SEL_ITER_MAX_SEQ]; /* Lengths for retrieved sequences */
+ 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 */
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing Dataspace Selection Iterators\n"));
+
+ /* Create dataspace */
+ sid = H5Screate_simple(2, dims1, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+
+ /* Try creating selection iterator object with bad parameters */
+ H5E_BEGIN_TRY { /* Bad dataspace ID */
+ iter_id = H5Ssel_iter_create(H5I_INVALID_HID, (size_t)1, (unsigned)0);
+ } H5E_END_TRY;
+ VERIFY(iter_id, FAIL, "H5Ssel_iter_create");
+ H5E_BEGIN_TRY { /* Bad element size */
+ iter_id = H5Ssel_iter_create(sid, (size_t)0, (unsigned)0);
+ } H5E_END_TRY;
+ VERIFY(iter_id, FAIL, "H5Ssel_iter_create");
+ H5E_BEGIN_TRY { /* Bad flag(s) */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)0xffff);
+ } H5E_END_TRY;
+ VERIFY(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Try closing selection iterator, with bad parameters */
+ H5E_BEGIN_TRY { /* Invalid ID */
+ ret = H5Ssel_iter_close(H5I_INVALID_HID);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_close");
+ H5E_BEGIN_TRY { /* Not a selection iterator ID */
+ ret = H5Ssel_iter_close(sid);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_close");
+
+
+ /* Try with no selection sharing, and with sharing */
+ for(sel_share = 0; sel_share < 2; sel_share++) {
+ /* Set selection iterator sharing flags */
+ if(sel_share)
+ sel_iter_flags = H5S_SEL_ITER_SHARE_WITH_DATASPACE;
+ else
+ sel_iter_flags = 0;
+
+ /* Create selection iterator object */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
+ CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Close selection iterator */
+ ret = H5Ssel_iter_close(iter_id);
+ CHECK(ret, FAIL, "H5Ssel_iter_close");
+
+ /* Try closing selection iterator twice */
+ H5E_BEGIN_TRY { /* Invalid ID */
+ ret = H5Ssel_iter_close(iter_id);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_close");
+
+
+ /* Create selection iterator object */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
+ CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Try retrieving sequences, with bad parameters */
+ H5E_BEGIN_TRY { /* Invalid ID */
+ ret = H5Ssel_iter_get_seq_list(H5I_INVALID_HID, (size_t)1, (size_t)1, &nseq, &nbytes, off, len);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ H5E_BEGIN_TRY { /* Invalid nseq pointer */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)1, NULL, &nbytes, off, len);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ H5E_BEGIN_TRY { /* Invalid nbytes pointer */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)1, &nseq, NULL, off, len);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ H5E_BEGIN_TRY { /* Invalid offset array */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)1, &nseq, &nbytes, NULL, len);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ H5E_BEGIN_TRY { /* Invalid length array */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)1, &nseq, &nbytes, off, NULL);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Ssel_iter_get_seq_list");
+
+ /* Close selection iterator */
+ ret = H5Ssel_iter_close(iter_id);
+ CHECK(ret, FAIL, "H5Ssel_iter_close");
+
+
+ /* Test iterators on various basic selection types */
+ for(sel_type = H5S_SEL_NONE; sel_type <= H5S_SEL_ALL; sel_type = (H5S_sel_type)(sel_type + 1)) {
+ switch(sel_type) {
+ case H5S_SEL_NONE: /* "None" selection */
+ ret = H5Sselect_none(sid);
+ CHECK(ret, FAIL, "H5Sselect_none");
+ break;
+
+ case H5S_SEL_POINTS: /* Point selection */
+ /* Select sequence of ten points */
+ coord1[0][0] = 0; coord1[0][1] = 9;
+ coord1[1][0] = 1; coord1[1][1] = 2;
+ coord1[2][0] = 2; coord1[2][1] = 4;
+ coord1[3][0] = 0; coord1[3][1] = 6;
+ coord1[4][0] = 1; coord1[4][1] = 8;
+ coord1[5][0] = 2; coord1[5][1] = 10;
+ coord1[6][0] = 0; coord1[6][1] = 11;
+ coord1[7][0] = 1; coord1[7][1] = 4;
+ coord1[8][0] = 2; coord1[8][1] = 1;
+ coord1[9][0] = 0; coord1[9][1] = 3;
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+ break;
+
+ case H5S_SEL_HYPERSLABS: /* Hyperslab selection */
+ /* Select regular hyperslab */
+ start[0] = 3; start[1] = 0;
+ stride[0] = 2; stride[1] = 2;
+ count[0] = 2; count[1] = 5;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+ break;
+
+ case H5S_SEL_ALL: /* "All" selection */
+ ret = H5Sselect_all(sid);
+ CHECK(ret, FAIL, "H5Sselect_all");
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert(0 && "Can't occur");
+ break;
+ } /* end switch */
+
+ /* Create selection iterator object */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
+ CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Try retrieving no sequences, with 0 for maxseq & maxbytes */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)0, (size_t)1, &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)1, (size_t)0, &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+
+ /* Try retrieving all sequences */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+
+ /* Check results from retrieving sequence list */
+ switch(sel_type) {
+ case H5S_SEL_NONE: /* "None" selection */
+ VERIFY(nseq, 0, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 0, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_POINTS: /* Point selection */
+ VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_HYPERSLABS: /* Hyperslab selection */
+ VERIFY(nseq, 10, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_ALL: /* "All" selection */
+ VERIFY(nseq, 1, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 72, "H5Ssel_iter_get_seq_list");
+ break;
+
+ case H5S_SEL_ERROR:
+ case H5S_SEL_N:
+ default:
+ HDassert(0 && "Can't occur");
+ break;
+ } /* end switch */
+
+ /* Close selection iterator */
+ ret = H5Ssel_iter_close(iter_id);
+ CHECK(ret, FAIL, "H5Ssel_iter_close");
+ } /* end for */
+
+ /* Point selection which will merge into smaller # of sequences */
+ coord1[0][0] = 0; coord1[0][1] = 9;
+ coord1[1][0] = 0; coord1[1][1] = 10;
+ coord1[2][0] = 0; coord1[2][1] = 11;
+ coord1[3][0] = 0; coord1[3][1] = 6;
+ coord1[4][0] = 1; coord1[4][1] = 8;
+ coord1[5][0] = 2; coord1[5][1] = 10;
+ coord1[6][0] = 0; coord1[6][1] = 11;
+ coord1[7][0] = 1; coord1[7][1] = 4;
+ coord1[8][0] = 1; coord1[8][1] = 5;
+ coord1[9][0] = 1; coord1[9][1] = 6;
+ ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Create selection iterator object */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
+ CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Try retrieving all sequences */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 10, "H5Ssel_iter_get_seq_list");
+
+ /* Close selection iterator */
+ ret = H5Ssel_iter_close(iter_id);
+ CHECK(ret, FAIL, "H5Ssel_iter_close");
+
+
+ /* Select irregular hyperslab, which will merge into smaller # of sequences */
+ start[0] = 3; start[1] = 0;
+ stride[0] = 2; stride[1] = 2;
+ count[0] = 2; count[1] = 5;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ start[0] = 3; start[1] = 3;
+ stride[0] = 2; stride[1] = 2;
+ count[0] = 2; count[1] = 5;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, start, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Create selection iterator object */
+ iter_id = H5Ssel_iter_create(sid, (size_t)1, (unsigned)sel_iter_flags);
+ CHECK(iter_id, FAIL, "H5Ssel_iter_create");
+
+ /* Try retrieving all sequences */
+ ret = H5Ssel_iter_get_seq_list(iter_id, (size_t)SEL_ITER_MAX_SEQ, (size_t)(1024 * 1024), &nseq, &nbytes, off, len);
+ CHECK(ret, FAIL, "H5Ssel_iter_get_seq_list");
+ VERIFY(nseq, 6, "H5Ssel_iter_get_seq_list");
+ VERIFY(nbytes, 20, "H5Ssel_iter_get_seq_list");
+
+ /* Close selection iterator */
+ ret = H5Ssel_iter_close(iter_id);
+ CHECK(ret, FAIL, "H5Ssel_iter_close");
+
+ } /* end for */
+
+ /* Close dataspace */
+ ret = H5Sclose(sid);
+ 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_hyper_io_1d():
+** Test to verify all the selected 10th element in the 1-d file
+** dataspace is read correctly into the 1-d contiguous memory space.
+** This is modeled after the test scenario described in HDFFV-10585
+** that demonstrated the hyperslab slowness. A fix to speed up
+** performance is in place to handle the special case for 1-d disjoint
+** file dataspace into 1-d single block contiguous memory space.
+**
+****************************************************************/
+static void
+test_hyper_io_1d(void)
+{
+ hid_t fid; /* File ID */
+ hid_t did; /* Dataset ID */
+ hid_t sid, mid; /* Dataspace IDs */
+ hid_t dcpl; /* Dataset creation property list ID */
+ hsize_t dims[1], maxdims[1], dimsm[1]; /* Dataset dimension sizes */
+ hsize_t chunk_dims[1]; /* Chunk dimension size */
+ hsize_t offset[1]; /* Starting offset for hyperslab */
+ hsize_t stride[1]; /* Distance between blocks in the hyperslab selection */
+ hsize_t count[1]; /* # of blocks in the the hyperslab selection */
+ hsize_t block[1]; /* Size of block in the hyperslab selection */
+ unsigned int wdata[CHUNKSZ]; /* Data to be written */
+ unsigned int rdata[NUM_ELEMENTS/10]; /* Data to be read */
+ herr_t ret; /* Generic return value */
+ unsigned i; /* Local index variable */
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing Hyperslab I/O for 1-d single block memory space\n"));
+
+ for (i = 0; i < CHUNKSZ; i++)
+ wdata[i] = i;
+
+ /* Create the file file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* Create file dataspace */
+ dims[0] = CHUNKSZ;
+ maxdims[0] = H5S_UNLIMITED;
+ sid = H5Screate_simple(RANK, dims, maxdims);
+ CHECK(sid, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Create memory dataspace */
+ dimsm[0] = CHUNKSZ;
+ mid = H5Screate_simple(RANK, dimsm, NULL);
+ CHECK(mid, H5I_INVALID_HID, "H5Pcreate");
+
+ /* Set up to create a chunked dataset */
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ CHECK(dcpl, H5I_INVALID_HID, "H5Pcreate");
+
+ chunk_dims[0] = CHUNKSZ;
+ ret = H5Pset_chunk(dcpl, RANK, chunk_dims);
+ CHECK(ret, FAIL, "H5Pset_chunk");
+
+ /* Create a chunked dataset */
+ did = H5Dcreate2(fid, DNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dcreate2");
+
+ /* Set up hyperslab selection for file dataspace */
+ offset[0] = 0;
+ stride[0] = 1;
+ count[0] = 1;
+ block[0] = CHUNKSZ;
+
+ /* Write to each chunk in the dataset */
+ for (i = 0; i < NUMCHUNKS; i++) {
+ /* Set the hyperslab selection */
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Write to the dataset */
+ ret = H5Dwrite(did, H5T_NATIVE_INT, mid, sid, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* Extend the dataset's dataspace */
+ if(i < (NUMCHUNKS - 1)) {
+ offset[0] = offset[0] + CHUNKSZ;
+ dims[0] = dims[0] + CHUNKSZ;
+ ret = H5Dset_extent(did, dims);
+ CHECK(ret, FAIL, "H5Dset_extent");
+
+ /* Get the dataset's current dataspace */
+ sid = H5Dget_space(did);
+ CHECK(sid, H5I_INVALID_HID, "H5Dget_space");
+ }
+ }
+
+ /* Closing */
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(mid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Pclose(dcpl);
+ CHECK(ret, FAIL, "H5Pclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Open the file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT);
+ CHECK(fid, H5I_INVALID_HID, "H5Fopen");
+
+ /* Open the dataset */
+ did = H5Dopen2(fid, DNAME, H5P_DEFAULT);
+ CHECK(did, H5I_INVALID_HID, "H5Dopen");
+
+ /* Set up to read every 10th element in file dataspace */
+ offset[0] = 1;
+ stride[0] = 10;
+ count[0] = NUM_ELEMENTS/10;
+ block[0] = 1;
+
+ /* Get the dataset's dataspace */
+ sid = H5Dget_space(did);
+ CHECK(sid, H5I_INVALID_HID, "H5Pcreate");
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, stride, count, block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Set up contiguous memory dataspace for the selected elements */
+ dimsm[0] = count[0];
+ mid = H5Screate_simple(RANK, dimsm, NULL);
+ CHECK(mid, H5I_INVALID_HID, "H5Screate");
+
+ /* Read all the selected 10th elements in the dataset into "rdata" */
+ ret = H5Dread(did, H5T_NATIVE_INT, mid, sid, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Dread");
+
+ /* Verify data read is correct */
+ for(i = 0; i < 6; i += 2) {
+ VERIFY(rdata[i], 1, "H5Dread\n");
+ VERIFY(rdata[i+1], 11, "H5Dread\n");
+ }
+
+ /* Closing */
+ ret = H5Sclose(mid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Dclose(did);
+ CHECK(ret, FAIL, "H5Dclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+} /* test_hyper_io_1d() */
+
+
+/****************************************************************
+**
** test_select(): Main H5S selection testing routine.
**
****************************************************************/
@@ -13674,7 +15489,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"));
@@ -13727,10 +15542,12 @@ test_select(void)
test_select_hyper_offset2();/* Test more selection offset code with hyperslabs */
test_select_point_offset(); /* Test selection offset code with elements */
test_select_hyper_union(); /* Test hyperslab union code */
-#ifdef NEW_HYPERSLAB_API
+
+ /* Fancy hyperslab API tests */
test_select_hyper_union_stagger(); /* Test hyperslab union code for staggered slabs */
test_select_hyper_union_3d(); /* Test hyperslab union code for 3-D dataset */
-#endif /* NEW_HYPERSLAB_API */
+ test_select_hyper_valid_combination(); /* Test different input combinations */
+
test_select_hyper_and_2d(); /* Test hyperslab intersection (AND) code for 2-D dataset */
test_select_hyper_xor_2d(); /* Test hyperslab XOR code for 2-D dataset */
test_select_hyper_notb_2d(); /* Test hyperslab NOTB code for 2-D dataset */
@@ -13806,6 +15623,8 @@ test_select(void)
/* Test "re-build" routine */
test_space_rebuild();
+ /* Test "update diminfo" routine */
+ test_space_update_diminfo();
/* Test point selections in chunked datasets */
test_select_point_chunk();
@@ -13826,26 +15645,39 @@ test_select(void)
/* Test unlimited hyperslab selections */
test_hyper_unlim();
+ /* Test the consistency of internal data structures of selection */
+ test_internal_consistency();
+
+ /* Test irregular selection I/O */
+ test_irreg_io();
+
+ /* Test selection iterators */
+ test_sel_iter();
+
+ /* Test selection intersection with block */
+ test_select_intersect_block();
+
+ /* Test reading of 1-d disjoint file space to 1-d single block memory space */
+ test_hyper_io_1d();
+
} /* 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
cleanup_select(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tskiplist.c b/test/tskiplist.c
index b9b00df..2806afe 100644
--- a/test/tskiplist.c
+++ b/test/tskiplist.c
@@ -66,11 +66,11 @@ test_skiplist_init(void)
/* Allocate arrays */
rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS);
- CHECK(rand_num, NULL, "HDmalloc");
+ CHECK_PTR(rand_num, "HDmalloc");
sort_rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS);
- CHECK(sort_rand_num, NULL, "HDmalloc");
+ CHECK_PTR(sort_rand_num, "HDmalloc");
rev_sort_rand_num = (int *)HDmalloc(sizeof(int) * NUM_ELEMS);
- CHECK(rev_sort_rand_num, NULL, "HDmalloc");
+ CHECK_PTR(rev_sort_rand_num, "HDmalloc");
/* Initialize random number seed */
curr_time = HDtime(NULL);
@@ -125,7 +125,7 @@ test_skiplist_create(void)
/* Try creating a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Try closing the skip list */
ret=H5SL_close(slist);
@@ -155,7 +155,7 @@ test_skiplist_insert(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -164,7 +164,7 @@ test_skiplist_insert(void)
/* Try searching for item in empty skip list */
key=37;
found_item=(int *)H5SL_search(slist,&key);
- VERIFY(found_item, NULL, "H5SL_search");
+ CHECK_PTR_NULL(found_item, "H5SL_search");
/* Insert an object into the skip list */
key=2; item=10;
@@ -177,13 +177,13 @@ test_skiplist_insert(void)
/* Search for the item just inserted */
found_item=(int *)H5SL_search(slist,&key);
- CHECK(found_item, NULL, "H5SL_search");
- VERIFY(*found_item,item,"H5SL_search");
+ CHECK_PTR(found_item, "H5SL_search");
+ VERIFY(*found_item, item, "H5SL_search");
/* Search for an item not in list */
search_key=37;
found_item=(int *)H5SL_search(slist,&search_key);
- VERIFY(found_item, NULL, "H5SL_search");
+ CHECK_PTR_NULL(found_item, "H5SL_search");
/* Attempt to insert duplicate key (should fail) */
search_key=2;
@@ -216,7 +216,7 @@ test_skiplist_insert_many(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -235,7 +235,7 @@ test_skiplist_insert_many(void)
/* Search for all objects in the skip list */
for(u=0; u<NUM_ELEMS; u++) {
found_item=(int *)H5SL_search(slist,&rand_num[u]);
- CHECK(found_item, NULL, "H5SL_search");
+ CHECK_PTR(found_item, "H5SL_search");
VERIFY(*found_item,rand_num[u],"H5SL_search");
} /* end for */
@@ -290,7 +290,7 @@ test_skiplist_remove(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -299,7 +299,7 @@ test_skiplist_remove(void)
/* Try removing an item in empty skip list */
search_key=37;
found_item=(int *)H5SL_remove(slist,&search_key);
- VERIFY(found_item, NULL, "H5SL_remove");
+ CHECK_PTR_NULL(found_item, "H5SL_remove");
/* Insert three objects into the skip list */
key1=15;
@@ -321,18 +321,18 @@ test_skiplist_remove(void)
/* Try removing items from skip list */
search_key=key1;
found_item=(int *)H5SL_remove(slist,&search_key);
- CHECK(found_item, NULL, "H5SL_remove");
- VERIFY(found_item, &key1, "H5SL_remove");
+ CHECK_PTR(found_item, "H5SL_remove");
+ CHECK_PTR_EQ(found_item, &key1, "H5SL_remove");
search_key=key2;
found_item=(int *)H5SL_remove(slist,&search_key);
- CHECK(found_item, NULL, "H5SL_remove");
- VERIFY(found_item, &key2, "H5SL_remove");
+ CHECK_PTR(found_item, "H5SL_remove");
+ CHECK_PTR_EQ(found_item, &key2, "H5SL_remove");
search_key=key3;
found_item=(int *)H5SL_remove(slist,&search_key);
- CHECK(found_item, NULL, "H5SL_remove");
- VERIFY(found_item, &key3, "H5SL_remove");
+ CHECK_PTR(found_item, "H5SL_remove");
+ CHECK_PTR_EQ(found_item, &key3, "H5SL_remove");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -341,7 +341,7 @@ test_skiplist_remove(void)
/* Try removing items from empty skip list (after its been worked on) */
search_key=key1;
found_item=(int *)H5SL_remove(slist,&search_key);
- VERIFY(found_item, NULL, "H5SL_remove");
+ CHECK_PTR_NULL(found_item, "H5SL_remove");
/* Close the skip list */
ret=H5SL_close(slist);
@@ -369,7 +369,7 @@ test_skiplist_remove_many(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -388,7 +388,7 @@ test_skiplist_remove_many(void)
/* Remove all objects from the skip list (in random order) */
for(u=0; u<NUM_ELEMS; u++) {
found_item=(int *)H5SL_remove(slist,&rand_num[u]);
- CHECK(found_item, NULL, "H5SL_remove");
+ CHECK_PTR(found_item, "H5SL_remove");
VERIFY(*found_item,rand_num[u],"H5SL_remove");
} /* end for */
@@ -411,7 +411,7 @@ test_skiplist_remove_many(void)
/* Remove all objects from the skip list */
for(u=0; u<NUM_ELEMS; u++) {
found_item=(int *)H5SL_remove(slist,&sort_rand_num[u]);
- CHECK(found_item, NULL, "H5SL_remove");
+ CHECK_PTR(found_item, "H5SL_remove");
VERIFY(*found_item,sort_rand_num[u],"H5SL_remove");
} /* end for */
@@ -434,7 +434,7 @@ test_skiplist_remove_many(void)
/* Remove all objects from the skip list */
for(u=0; u<NUM_ELEMS; u++) {
found_item=(int *)H5SL_remove(slist,&rev_sort_rand_num[u]);
- CHECK(found_item, NULL, "H5SL_remove");
+ CHECK_PTR(found_item, "H5SL_remove");
VERIFY(*found_item,rev_sort_rand_num[u],"H5SL_remove");
} /* end for */
@@ -469,7 +469,7 @@ test_skiplist_firstnext(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -477,7 +477,7 @@ test_skiplist_firstnext(void)
VERIFY(num, 0, "H5SL_count");
/* Check that the list appears empty */
node=H5SL_first(slist);
- VERIFY(node, NULL, "H5SL_first");
+ CHECK_PTR_NULL(node, "H5SL_first");
/* Insert many objects into the skip list */
for(u=0; u<NUM_ELEMS; u++) {
@@ -491,7 +491,7 @@ test_skiplist_firstnext(void)
/* Iterate over all the nodes in the skip list */
node=H5SL_first(slist);
- CHECK(node, NULL, "H5SL_first");
+ CHECK_PTR(node, "H5SL_first");
u=0;
while(node!=NULL) {
found_item=(int *)H5SL_item(node);
@@ -506,7 +506,7 @@ test_skiplist_firstnext(void)
/* Check that the list appears empty again */
node=H5SL_first(slist);
- VERIFY(node, NULL, "H5SL_first");
+ CHECK_PTR_NULL(node, "H5SL_first");
/* Close the skip list */
ret=H5SL_close(slist);
@@ -562,7 +562,7 @@ test_skiplist_string(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_STR, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -624,7 +624,7 @@ test_skiplist_iterate(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -674,7 +674,7 @@ test_skiplist_hsize(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_HSIZE, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -729,7 +729,7 @@ test_skiplist_unsigned(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -784,7 +784,7 @@ test_skiplist_obj(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_OBJ, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -862,7 +862,7 @@ test_skiplist_generic(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_GENERIC, test_skiplist_generic_cmp);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -916,7 +916,7 @@ test_skiplist_lastprev(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Check that the skip list has no elements */
num=H5SL_count(slist);
@@ -924,7 +924,7 @@ test_skiplist_lastprev(void)
/* Check that the list appears empty */
node=H5SL_last(slist);
- VERIFY(node, NULL, "H5SL_last");
+ CHECK_PTR_NULL(node, "H5SL_last");
/* Insert many objects into the skip list */
for(u=0; u<NUM_ELEMS; u++) {
@@ -938,7 +938,7 @@ test_skiplist_lastprev(void)
/* Iterate over all the nodes in the skip list */
node=H5SL_last(slist);
- CHECK(node, NULL, "H5SL_last");
+ CHECK_PTR(node, "H5SL_last");
u=NUM_ELEMS-1;
while(node!=NULL) {
found_item=(int *)H5SL_item(node);
@@ -953,7 +953,7 @@ test_skiplist_lastprev(void)
/* Check that the list appears empty again */
node=H5SL_last(slist);
- VERIFY(node, NULL, "H5SL_last");
+ CHECK_PTR_NULL(node, "H5SL_last");
/* Close the skip list */
ret=H5SL_close(slist);
@@ -984,7 +984,7 @@ test_skiplist_find(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u=0; u<10; u++) {
@@ -995,7 +995,7 @@ test_skiplist_find(void)
/* Find the element with key==30 in the skip list */
find_item=30;
node=H5SL_find(slist,&find_item);
- CHECK(node, NULL, "H5SL_find");
+ CHECK_PTR(node, "H5SL_find");
/* Iterate over the rest of the nodes in the skip list */
u=4;
@@ -1009,7 +1009,7 @@ test_skiplist_find(void)
/* Check for trying to locate non-existent item */
find_item=81;
node=H5SL_find(slist,&find_item);
- VERIFY(node, NULL, "H5SL_find");
+ CHECK_PTR_NULL(node, "H5SL_find");
/* Close the skip list */
ret=H5SL_close(slist);
@@ -1040,7 +1040,7 @@ test_skiplist_add(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u=0; u<10; u++) {
@@ -1051,11 +1051,11 @@ test_skiplist_add(void)
/* Add the element with key==12 in the skip list */
new_item=12;
node=H5SL_add(slist,&new_item,&new_item);
- CHECK(node, NULL, "H5SL_add");
+ CHECK_PTR(node, "H5SL_add");
/* Advance to next node in list */
node=H5SL_next(node);
- CHECK(node, NULL, "H5SL_next");
+ CHECK_PTR(node, "H5SL_next");
/* Iterate over the rest of the nodes in the skip list */
u=2;
@@ -1102,7 +1102,7 @@ test_skiplist_destroy(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u=0; u<NUM_ELEMS; u++) {
@@ -1138,7 +1138,7 @@ test_skiplist_free(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u=0; u<NUM_ELEMS; u++) {
@@ -1210,8 +1210,8 @@ static herr_t test_tfs_iter(void *_obj, void *key, void *_udata) {
test_tfs_it_ud_t *udata = (test_tfs_it_ud_t *)_udata;
/* Check consistency */
- VERIFY((void *)&obj->idx, key, "obj->idx");
- VERIFY(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]");
+ CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx");
+ CHECK_PTR_EQ(obj, &udata->obj_list->list[obj->idx], "obj_list->list[obj->idx]");
/* Increment number of calls */
udata->ncalls++;
@@ -1236,8 +1236,8 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) {
htri_t ret_value;
/* Check consistency */
- VERIFY((void *)&obj->idx, key, "obj->idx");
- VERIFY(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]");
+ CHECK_PTR_EQ((void *)&obj->idx, key, "obj->idx");
+ CHECK_PTR_EQ(obj, &obj_list->list[obj->idx], "obj_list->list[obj->idx]");
/* Mark this object as freed (to make sure it isn't recursively freed, that
* is not something we support, we will undo this if we decide later not to
@@ -1269,7 +1269,7 @@ static htri_t test_tfs_free(void *_obj, void *key, void *_obj_list) {
else {
/* Remove the object */
obj_ret = (test_tfs_obj_t *)H5SL_remove(obj_list->slist, &j);
- CHECK(obj_ret, NULL, "H5SL_remove");
+ CHECK_PTR(obj_ret, "H5SL_remove");
obj_ret->nfrees++;
obj_list->nobjs_rem--;
} /* end else */
@@ -1324,7 +1324,7 @@ test_skiplist_try_free_safe(void)
/* Create a skip list */
obj_list.slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(obj_list.slist, NULL, "H5SL_create");
+ CHECK_PTR(obj_list.slist, "H5SL_create");
/* Init obj_list.list */
obj_list.list = list;
@@ -1396,7 +1396,7 @@ test_skiplist_less(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u=0; u<10; u++) {
@@ -1430,7 +1430,7 @@ test_skiplist_less(void)
VERIFY(*found_item,5,"H5SL_less");
find_item=4;
found_item=(unsigned *)H5SL_less(slist,&find_item);
- VERIFY(found_item,NULL,"H5SL_less");
+ CHECK_PTR_NULL(found_item, "H5SL_less");
/* Close the skip list */
ret=H5SL_close(slist);
@@ -1460,7 +1460,7 @@ test_skiplist_greater(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u = 0; u < 10; u++) {
@@ -1488,7 +1488,7 @@ test_skiplist_greater(void)
VERIFY(*found_item, 90, "H5SL_greater");
find_item = 100;
found_item = (unsigned *)H5SL_greater(slist, &find_item);
- VERIFY(found_item, NULL, "H5SL_greater");
+ CHECK_PTR_NULL(found_item, "H5SL_greater");
find_item = 6;
found_item = (unsigned *)H5SL_greater(slist, &find_item);
VERIFY(*found_item, 10, "H5SL_greater");
@@ -1525,7 +1525,7 @@ test_skiplist_below(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u = 0; u < 10; u++) {
@@ -1536,44 +1536,44 @@ test_skiplist_below(void)
/* Check for exact match of items in various positions */
find_item = 20;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, find_item, "H5SL_below");
find_item = 90;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, find_item, "H5SL_below");
find_item = 5;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, find_item, "H5SL_below");
/* Find item less than a missing key, in various positions */
find_item = 19;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 15, "H5SL_below");
find_item = 89;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 80, "H5SL_below");
find_item = 100;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 90, "H5SL_below");
find_item = 9;
node = H5SL_below(slist, &find_item);
- CHECK(node, NULL, "H5SL_below");
+ CHECK_PTR(node, "H5SL_below");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 5, "H5SL_below");
find_item = 4;
node = (H5SL_node_t *)H5SL_less(slist, &find_item);
- VERIFY(node, NULL, "H5SL_below");
+ CHECK_PTR_NULL(node, "H5SL_below");
/* Close the skip list */
ret = H5SL_close(slist);
@@ -1604,7 +1604,7 @@ test_skiplist_above(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u = 0; u < 10; u++) {
@@ -1615,42 +1615,42 @@ test_skiplist_above(void)
/* Check for exact match of items in various positions */
find_item = 20;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, find_item, "H5SL_above");
find_item = 90;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, find_item, "H5SL_above");
find_item = 5;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, find_item, "H5SL_above");
/* Find item greater than a missing key, in various positions */
find_item = 19;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 20, "H5SL_above");
find_item = 89;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 90, "H5SL_above");
find_item = 100;
node = H5SL_above(slist, &find_item);
- VERIFY(node, NULL, "H5SL_above");
+ CHECK_PTR_NULL(node, "H5SL_above");
find_item = 6;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 10, "H5SL_above");
find_item = 4;
node = H5SL_above(slist, &find_item);
- CHECK(node, NULL, "H5SL_above");
+ CHECK_PTR(node, "H5SL_above");
found_item = (unsigned *)H5SL_item(node);
VERIFY(*found_item, 5, "H5SL_above");
@@ -1681,7 +1681,7 @@ test_skiplist_remove_first(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_UNSIGNED, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u = 0; u < 10; u++) {
@@ -1697,7 +1697,7 @@ test_skiplist_remove_first(void)
/* Check for removing object from empty list */
found_item = (unsigned *)H5SL_remove_first(slist);
- VERIFY(found_item, NULL, "H5SL_remove_first");
+ CHECK_PTR_NULL(found_item, "H5SL_remove_first");
/* Close the skip list */
ret = H5SL_close(slist);
@@ -1725,7 +1725,7 @@ test_skiplist_remove_first_many(void)
/* Create a skip list */
slist = H5SL_create(H5SL_TYPE_INT, NULL);
- CHECK(slist, NULL, "H5SL_create");
+ CHECK_PTR(slist, "H5SL_create");
/* Insert objects into the skip list */
for(u = 0; u < NUM_ELEMS; u++) {
@@ -1742,7 +1742,7 @@ test_skiplist_remove_first_many(void)
/* Check for removing object from empty list */
found_item = (int *)H5SL_remove_first(slist);
- VERIFY(found_item, NULL, "H5SL_remove_first");
+ CHECK_PTR_NULL(found_item, "H5SL_remove_first");
/* Close the skip list */
ret = H5SL_close(slist);
diff --git a/test/tsohm.c b/test/tsohm.c
index 133b196..f39b5e5 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -11,13 +11,9 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/***********************************************************
-*
-* Test program: tsohm
-*
-* Test Shared Object Header Messages
-*
-*************************************************************/
+/*
+ * Purpose: Test Shared Object Header Messages
+ */
#include "testhdf5.h"
@@ -25,9 +21,9 @@
* This file needs to access private information from the H5F package.
* This file also needs to access the file testing code.
*/
-#define H5F_FRIEND /*suppress error about including H5Fpkg */
+#define H5F_FRIEND /* suppress error about including H5Fpkg */
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
+#include "H5Fpkg.h" /* File access */
/* Default SOHM values */
#define DEF_NUM_INDEXES 0
@@ -178,40 +174,39 @@ static void test_sohm_extlink(void);
/****************************************************************
**
-** check_fcpl_values(): Helper function for test_sohm_fcpl.
-** Verifies that the *_in and *_out parameters are equal.
+** verify_fcpl_values(): Verifies that FCPL is set as expected.
**
****************************************************************/
-static void check_fcpl_values(hid_t fcpl_id, const unsigned nindexes_in,
- const unsigned *flags_in, const unsigned *minsizes_in,
- unsigned l2b, unsigned b2l)
+static void
+verify_fcpl_values(hid_t fcpl_id, const unsigned nindexes_expected, const unsigned *flags_expected, const unsigned *minsizes_expected, unsigned l2b, unsigned b2l)
{
- unsigned num_indexes;
- unsigned index_flags, min_mesg_size;
- unsigned list_size, btree_size;
- unsigned x;
- herr_t ret;
-
- /* Verify number of indexes is set to default */
- ret = H5Pget_shared_mesg_nindexes(fcpl_id, &num_indexes);
+ unsigned nindexes_actual;
+ unsigned list_size;
+ unsigned btree_size;
+ unsigned x;
+ herr_t ret;
+
+ /* Number of indexes */
+ ret = H5Pget_shared_mesg_nindexes(fcpl_id, &nindexes_actual);
CHECK_I(ret, "H5Pget_shared_mesg_nindexes");
- VERIFY(num_indexes, nindexes_in, "H5Pget_shared_mesg_nindexes");
+ VERIFY(nindexes_actual, nindexes_expected, "H5Pget_shared_mesg_nindexes");
- /* Verify index flags and minsizes are set */
- for(x=0; x<num_indexes; ++x)
- {
- ret = H5Pget_shared_mesg_index(fcpl_id, x, &index_flags, &min_mesg_size);
+ /* Index flags and minsizes */
+ for(x=0; x<nindexes_actual; ++x) {
+ unsigned flags_i;
+ unsigned min_mesg_size;
+ ret = H5Pget_shared_mesg_index(fcpl_id, x, &flags_i, &min_mesg_size);
CHECK_I(ret, "H5Pget_shared_mesg_index");
- VERIFY(index_flags, flags_in[x], "H5Pget_shared_mesg_index");
- VERIFY(min_mesg_size, minsizes_in[x], "H5Pget_shared_mesg_index");
+ VERIFY(flags_i, flags_expected[x], "H5Pget_shared_mesg_index");
+ VERIFY(min_mesg_size, minsizes_expected[x], "H5Pget_shared_mesg_index");
}
- /* Check list-to-btree and btree-to-list values */
+ /* List-to-btree and btree-to-list values */
ret = H5Pget_shared_mesg_phase_change(fcpl_id, &list_size, &btree_size);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
VERIFY(list_size, l2b, "H5Pset_shared_mesg_phase_change");
VERIFY(btree_size, b2l, "H5Pset_shared_mesg_phase_change");
-}
+} /* verify_fcpl_values */
/****************************************************************
@@ -219,22 +214,21 @@ static void check_fcpl_values(hid_t fcpl_id, const unsigned nindexes_in,
** test_sohm_fcpl(): Test File Creation Property Lists.
**
****************************************************************/
-static void test_sohm_fcpl(void)
+static void
+test_sohm_fcpl(void)
{
- hid_t fid = -1;
- hid_t fcpl_id = -1;
- hid_t fcpl2_id = -1;
- unsigned x;
- herr_t ret; /* Generic return value */
+ hid_t fid = -1;
+ hid_t fcpl_id = -1;
+ hid_t fcpl2_id = -1;
+ unsigned x;
+ herr_t ret;
- /* Output message about test being performed */
MESSAGE(5, ("Testing File Creation Properties for Shared Messages\n"));
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
- /* Verify fcpl values */
- check_fcpl_values(fcpl_id, DEF_NUM_INDEXES, def_type_flags, def_minsizes, DEF_L2B, DEF_B2L);
+ verify_fcpl_values(fcpl_id, DEF_NUM_INDEXES, def_type_flags, def_minsizes, DEF_L2B, DEF_B2L);
/* Create a file with this fcpl and make sure that all the values can be
* retrieved.
@@ -245,8 +239,7 @@ static void test_sohm_fcpl(void)
fcpl2_id = H5Fget_create_plist(fid);
CHECK_I(fcpl2_id, "H5Fcreate");
- /* Verify fcpl values */
- check_fcpl_values(fcpl2_id, DEF_NUM_INDEXES, def_type_flags, def_minsizes, DEF_L2B, DEF_B2L);
+ verify_fcpl_values(fcpl2_id, DEF_NUM_INDEXES, def_type_flags, def_minsizes, DEF_L2B, DEF_B2L);
ret = H5Pclose(fcpl2_id);
CHECK_I(ret, "H5Pclose");
@@ -262,8 +255,7 @@ static void test_sohm_fcpl(void)
fcpl2_id = H5Fget_create_plist(fid);
CHECK_I(ret, "H5Fcreate");
- /* Verify fcpl values */
- check_fcpl_values(fcpl2_id, DEF_NUM_INDEXES, def_type_flags, def_minsizes, DEF_L2B, DEF_B2L);
+ verify_fcpl_values(fcpl2_id, DEF_NUM_INDEXES, def_type_flags, def_minsizes, DEF_L2B, DEF_B2L);
/* Clean up */
ret = H5Pclose(fcpl2_id);
@@ -289,7 +281,7 @@ static void test_sohm_fcpl(void)
ret = H5Pset_shared_mesg_phase_change(fcpl_id, TEST_L2B, TEST_B2L);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- check_fcpl_values(fcpl_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
+ verify_fcpl_values(fcpl_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
/* Use the fcpl to create a file and get it back again */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
@@ -297,8 +289,7 @@ static void test_sohm_fcpl(void)
fcpl2_id = H5Fget_create_plist(fid);
CHECK_I(fcpl2_id, "H5Fcreate");
- /* Verify fcpl values */
- check_fcpl_values(fcpl2_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
+ verify_fcpl_values(fcpl2_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
ret = H5Pclose(fcpl2_id);
CHECK_I(ret, "H5Pclose");
@@ -314,8 +305,7 @@ static void test_sohm_fcpl(void)
fcpl2_id = H5Fget_create_plist(fid);
CHECK_I(ret, "H5Fcreate");
- /* Verify fcpl values */
- check_fcpl_values(fcpl2_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
+ verify_fcpl_values(fcpl2_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
/* Clean up */
ret = H5Pclose(fcpl2_id);
@@ -323,7 +313,70 @@ static void test_sohm_fcpl(void)
ret = H5Fclose(fid);
CHECK_I(ret, "H5Fclose");
- /* Test giving bogus values to H5P* functions */
+ /* Actually, the list max can be exactly 1 greater than the
+ * btree min, but no more.
+ * Reset the second index.
+ */
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, test_type_flags[1], 15);
+ CHECK_I(ret, "H5Pset_shared_mesg_index");
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, 11);
+ CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ CHECK_I(fid, "H5Fcreate");
+ ret = H5Fclose(fid);
+ CHECK_I(ret, "H5Fclose");
+
+ /* Test edge cases:
+ * H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be valid
+ * values.
+ * Creating a file with uninitialized indexes should work. (TODO: not implemented?)
+ */
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5O_SHMESG_MAX_LIST_SIZE, H5O_SHMESG_MAX_LIST_SIZE);
+ CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ CHECK_I(fid, "H5Fcreate");
+
+ /* Clean up */
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ ret = H5Fclose(fid);
+ CHECK_I(ret, "H5Fclose");
+} /* test_sohm_fcpl */
+
+
+/****************************************************************
+**
+** test_sohm_fcpl_errors(): Test bogus FCPL settings for SOHMs
+**
+****************************************************************/
+static void
+test_sohm_fcpl_errors(void)
+{
+ hid_t fcpl_id = -1;
+ hid_t fid = -1;
+ unsigned x;
+ herr_t ret;
+
+ MESSAGE(5, ("Testing bogus file creation properties for shared messages\n"));
+
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+
+ /* Set up index values */
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, TEST_NUM_INDEXES);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ for(x = 0; x < TEST_NUM_INDEXES; ++x) {
+ ret = H5Pset_shared_mesg_index(fcpl_id, x, test_type_flags[x], test_minsizes[x]);
+ CHECK_I(ret, "H5Pset_shared_mesg_index");
+ }
+
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, TEST_L2B, TEST_B2L);
+ CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
+
+ verify_fcpl_values(fcpl_id, TEST_NUM_INDEXES, test_type_flags, test_minsizes, TEST_L2B, TEST_B2L);
+
H5E_BEGIN_TRY {
/* Trying to create too many indexes should fail */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES + 1);
@@ -370,40 +423,7 @@ static void test_sohm_fcpl(void)
ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5O_SHMESG_MAX_LIST_SIZE, H5O_SHMESG_MAX_LIST_SIZE+1);
VERIFY(ret, -1, "H5Pset_shared_mesg_phase_change");
} H5E_END_TRY
-
-
- /* Actually, the list max can be exactly 1 greater than the
- * btree min, but no more. Also, the errors above shouldn't
- * have corrupted the fcpl, although we do need to reset the
- * second index that we changed above.
- */
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, test_type_flags[1], 15);
- CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, 11);
- CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
- CHECK_I(fid, "H5Fcreate");
- ret = H5Fclose(fid);
- CHECK_I(ret, "H5Fclose");
-
- /* Test edge cases; H5O_SHMESG_MAX_NINDEXES and H5O_SHMESG_MAX_LIST_SIZE should be
- * valid values. Also, creating a file with uninitialized indexes
- * (indexes 3-5) should work.
- */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, H5O_SHMESG_MAX_NINDEXES);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, H5O_SHMESG_MAX_LIST_SIZE, H5O_SHMESG_MAX_LIST_SIZE);
- CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
- CHECK_I(fid, "H5Fcreate");
-
-
- /* Clean up */
- ret = H5Pclose(fcpl_id);
- CHECK_I(ret, "H5Pclose");
- ret = H5Fclose(fid);
- CHECK_I(ret, "H5Fclose");
-}
+} /* test_sohm_fcpl_errors */
/*-------------------------------------------------------------------------
@@ -455,7 +475,8 @@ error:
H5Tclose(dtype1_id);
} H5E_END_TRY
return -1;
-}
+} /* make_dtype1 */
+
/*-------------------------------------------------------------------------
* Function: make_dtype_2
@@ -518,9 +539,9 @@ error:
H5Tclose(int_id);
} H5E_END_TRY
return -1;
-}
-
+} /* make_dtype2 */
+
/*-------------------------------------------------------------------------
* Function: close_reopen_file
*
@@ -540,16 +561,16 @@ error:
static hid_t
close_reopen_file(hid_t file, const char* filename, hid_t fapl_id)
{
- hid_t fid;
-
- if(H5Fclose(file) < 0) FAIL_STACK_ERROR
- if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) FAIL_STACK_ERROR
-
- return(fid);
+ if (H5Fclose(file) < 0)
+ FAIL_STACK_ERROR
+ file = H5Fopen(filename, H5F_ACC_RDWR, fapl_id);
+ if (file < 0)
+ FAIL_STACK_ERROR
+ return(file);
error:
return -1;
-}
+} /* close_reopen_file */
/*-------------------------------------------------------------------------
@@ -557,13 +578,12 @@ error:
*
* Purpose: Creates object headers that use a large datatype message.
*
- * Used in test_sohm_basic. Should close the file ID passed in.
- * Set test_file_closing to 1 to add file closing and reopening
+ * Set test_file_closing to TRUE to add file closing and reopening
* whenever possible (to test that SOHMs are written correctly
* on disk and not just in memory).
*
- * Return: Success: file ID (may not be the same one passed in)
- * Failure: Negative
+ * Return: Success: file ID (may not be the same one passed in)
+ * Failure: H5I_INVALID_HID
*
* Programmer: James Laird
* Monday, April 10, 2006
@@ -571,21 +591,47 @@ error:
*-------------------------------------------------------------------------
*/
static hid_t
-size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_closing)
+size1_helper(hid_t file, const char *filename, hid_t fapl_id, hbool_t test_file_closing)
{
dtype1_struct wdata;
dtype1_struct rdata;
- hid_t dtype1_id = -1;
- hid_t space_id = -1;
- hid_t dset_id = -1;
+ hid_t dtype1_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
hsize_t dim1[1];
int x;
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Macro: TSOHM_S1H_VERIFY_DATA
+ *
+ * Purpose: Encapsulate a common pattern:
+ * Reads the dataset and verifies that [a subset of] the data
+ * are as expected.
+ *
+ * Programmer: Jacob Smith
+ * 2018 November 1
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+#define TSOHM_S1H_VERIFY_DATA(dset_id, dtype_id) \
+{ \
+ HDmemset(&rdata, 0, sizeof(rdata)); \
+ if (0 > H5Dread((dset_id), (dtype_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata)) { \
+ H5_FAILED(); AT(); \
+ HDprintf("Can't read data\n"); \
+ goto error; \
+ } \
+ if ((rdata.i1 != wdata.i1) || (rdata.i2 != wdata.i2) || HDstrcmp(rdata.str, wdata.str)) { \
+ H5_FAILED(); AT(); \
+ HDprintf("incorrect read data\n"); \
+ goto error; \
+ } \
+} /* TSOHM_S1H_VERIFY_DATA() definition */
+
/* Closing and re-opening the file takes a long time on systems without
* local disks. Don't close and reopen if express testing is enabled.
*/
if(GetTestExpress() > 1)
- test_file_closing = 0;
+ test_file_closing = FALSE;
/* Intialize wdata */
HDmemset(&wdata, 0, sizeof(wdata));
@@ -603,110 +649,72 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
/* Intialize rdata */
HDmemset(&rdata, 0, sizeof(rdata));
- if((dtype1_id = make_dtype_1()) < 0) TEST_ERROR
+ dtype1_id = make_dtype_1();
+ if(dtype1_id < 0) TEST_ERROR
- /* Create the dataspace and dataset */
dim1[0] = 1;
- if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) TEST_ERROR
+ space_id = H5Screate_simple(1, dim1, NULL);
+ if(space_id < 0) TEST_ERROR
- if((dset_id = H5Dcreate2(file, DSETNAME[0], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ dset_id = H5Dcreate2(file, DSETNAME[0], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_id < 0) FAIL_STACK_ERROR
/* Test writing and reading */
if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) FAIL_STACK_ERROR
-
- if(H5Dread(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) FAIL_STACK_ERROR
-
- if(rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
- H5_FAILED(); AT();
- printf("incorrect read data\n");
- goto error;
- } /* end if */
+ TSOHM_S1H_VERIFY_DATA(dset_id, dtype1_id)
if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
- /* Close and re-open the file if requested*/
if(test_file_closing)
if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
- /* Create more datasets with the same datatype */
- if((dset_id = H5Dcreate2(file, DSETNAME[1], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
+ /* Create 3 more datasets with the same datatype/dataspace */
+ for (x = 1; x < 4; x++) {
+ dset_id = H5Dcreate2(file, DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (0 > dset_id) FAIL_STACK_ERROR
+ if (x == 3)
+ if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) TEST_ERROR
+ if (H5Dclose(dset_id) < 0) FAIL_STACK_ERROR
- /* Close and re-open the file if requested*/
- if(test_file_closing)
- if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
-
- if((dset_id = H5Dcreate2(file, DSETNAME[2], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
- if(H5Dclose(dset_id) < 0) TEST_ERROR
-
- /* Close and re-open the file if requested*/
- if(test_file_closing)
- if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
-
- if((dset_id = H5Dcreate2(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
-
- /* Write data to dataset 3 for later */
- if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) TEST_ERROR
+ if (test_file_closing)
+ if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
+ }
- if(H5Dclose(dset_id) < 0) TEST_ERROR
if(H5Tclose(dtype1_id) < 0) TEST_ERROR
- /* Close and re-open the file if requested*/
- if(test_file_closing)
- if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
-
/* Make sure the data has been written successfully */
- if((dset_id = H5Dopen2(file, DSETNAME[0], H5P_DEFAULT)) < 0) TEST_ERROR
- if((dtype1_id = H5Dget_type(dset_id)) < 0) TEST_ERROR
-
- /* Read data back again */
- HDmemset(&rdata, 0, sizeof(rdata));
- if(H5Dread(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
- H5_FAILED(); AT();
- printf("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");
- goto error;
- } /* end if */
+ dset_id = H5Dopen2(file, DSETNAME[0], H5P_DEFAULT);
+ if(dset_id < 0) TEST_ERROR
+ dtype1_id = H5Dget_type(dset_id);
+ if(dtype1_id < 0) TEST_ERROR
+ TSOHM_S1H_VERIFY_DATA(dset_id, dtype1_id)
if(H5Dclose(dset_id) < 0) TEST_ERROR
- /* Create several copies of the dataset (this increases the amount of space saved by sharing the datatype message) */
+ /* Create several copies of the dataset
+ * this increases the amount of space saved by sharing the datatype message
+ */
for(x = 0; x < SOHM_HELPER_NUM_EX_DSETS; x++) {
- if((dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset_id < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
- /* Close and re-open the file if requested*/
if(test_file_closing)
if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
- } /* end for */
+ }
if(H5Tclose(dtype1_id) < 0) TEST_ERROR
if(H5Sclose(space_id) < 0) TEST_ERROR
/* Ensure that we can still read data back from dataset 3 */
- if((dset_id = H5Dopen2(file, DSETNAME[3], H5P_DEFAULT)) < 0) TEST_ERROR
- if((dtype1_id = H5Dget_type(dset_id)) < 0) TEST_ERROR
-
- /* Read data back again */
- HDmemset(&rdata, 0, sizeof(rdata));
- if(H5Dread(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
- H5_FAILED(); AT();
- printf("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");
- goto error;
- } /* end if */
+ dset_id = H5Dopen2(file, DSETNAME[3], H5P_DEFAULT);
+ if(dset_id < 0) TEST_ERROR
+ dtype1_id = H5Dget_type(dset_id);
+ if(dtype1_id < 0) TEST_ERROR
+ TSOHM_S1H_VERIFY_DATA(dset_id, dtype1_id)
if(H5Dclose(dset_id) < 0) TEST_ERROR
if(H5Tclose(dtype1_id) < 0) TEST_ERROR
+
return file;
error:
@@ -716,8 +724,49 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
H5Dclose(dset_id);
H5Fclose(file);
} H5E_END_TRY
- return -1;
-}
+
+ return H5I_INVALID_HID;
+#undef TSOHM_S1H_VERIFY_DATA /* macro is exclusive to this function */
+} /* size1_helper */
+
+
+/*----------------------------------------------------------------------------
+ * Function: getsize_testsize1
+ *
+ * Purpose: Creates a test file, populates it, and returns its file size.
+ * Oject header information from the "first" dataset in the file
+ * is stored in pointer `oinfo`.
+ *
+ * Programmer: Jacob Smith
+ * 2018 November 1
+ *----------------------------------------------------------------------------
+ */
+static h5_stat_size_t
+getsize_testsize1(const char *filename, hid_t fcpl_id, hid_t fapl_id,
+ hbool_t test_file_closing, H5O_native_info_t *ninfo)
+{
+ hid_t fid = H5I_INVALID_HID;
+ herr_t ret;
+
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK(fid, H5I_INVALID_HID, "H5Fcreate");
+
+ /* If test_file_closing is TRUE, you will get back a different ID,
+ * which will need to be closed. The helper will close your passed-in
+ * ID.
+ */
+ fid = size1_helper(fid, filename, fapl_id, test_file_closing);
+ CHECK(fid, H5I_INVALID_HID, "size1_helper");
+
+ ret = H5Oget_native_info_by_name(fid, DSETNAME[0], ninfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Oget_native_info_by_name");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ return h5_get_file_size(filename, fapl_id);
+} /* getsize_testsize1() */
+
/*-------------------------------------------------------------------------
* Function: test_sohm_size1
@@ -727,17 +776,27 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
* Programmer: James Laird
* Monday, April 10, 2006
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-static void test_sohm_size1(void)
+static void
+test_sohm_size1(void)
{
hid_t file = -1;
hid_t fcpl_id = -1;
hid_t fapl_id = -1;
- hsize_t sohm_oh_size;
- hsize_t sohm_btree_oh_size;
+
+ unsigned use_shared = 0;
+ unsigned use_btree = 0;
+ h5_stat_size_t file_sizes[9];
+ unsigned size_index = 0;
+ hsize_t oh_sizes[3];
+ unsigned oh_size_index = 0;
+
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
+ hsize_t norm_oh_size;
+#endif /* Jira HDFFV-10646 */
+ hsize_t sohm_oh_size;
+ hsize_t sohm_btree_oh_size;
h5_stat_size_t norm_empty_filesize;
h5_stat_size_t sohm_empty_filesize;
h5_stat_size_t sohm_btree_empty_filesize;
@@ -747,7 +806,8 @@ static void test_sohm_size1(void)
h5_stat_size_t norm_final_filesize2;
h5_stat_size_t sohm_final_filesize2;
h5_stat_size_t sohm_btree_final_filesize2;
- H5O_info_t oinfo;
+
+ H5O_native_info_t ninfo;
unsigned num_indexes = 1;
unsigned index_flags = H5O_SHMESG_DTYPE_FLAG;
unsigned min_mesg_size = 50;
@@ -757,177 +817,108 @@ static void test_sohm_size1(void)
MESSAGE(5, ("Testing that shared datatypes save space\n"));
-
/* Create a FAPL with "semi" close degree, to detect dangling IDs */
fapl_id = H5Pcreate(H5P_FILE_ACCESS);
CHECK_I(fapl_id, "H5Pcreate");
-
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
CHECK_I(ret, "H5Pset_fclose_degree");
- /* Create a file with SOHMs disabled and get its size */
- fcpl_id = H5Pcreate(H5P_FILE_CREATE);
- CHECK_I(fcpl_id, "H5Pcreate");
-
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, 0);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
-
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
-
- /* Get the file size */
- norm_empty_filesize = h5_get_file_size(FILENAME, fapl_id);
-
- /* Add a bunch of large datatypes to the file */
- file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
- CHECK_I(file, "H5Fopen");
- file = size1_helper(file, FILENAME, fapl_id, 0);
- CHECK_I(file, "size1_helper");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
-
- /* Get the new file size */
- norm_final_filesize = h5_get_file_size(FILENAME, fapl_id);
-
- /* Use the same property list to create a new file. */
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
-
- ret = H5Pclose(fcpl_id);
- CHECK_I(ret, "H5Pclose");
-
- /* Add the same large datatypes, but keep closing and re-opening the file */
- file = size1_helper(file, FILENAME, fapl_id, 1);
- CHECK_I(file, "size1_helper");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
-
- /* Get the file size */
- norm_final_filesize2 = h5_get_file_size(FILENAME, fapl_id);
-
-
-
- /* Now do the same thing for a file with SOHMs enabled */
- /* Create FCPL with SOHMs enabled */
- fcpl_id = H5Pcreate(H5P_FILE_CREATE);
- CHECK_I(fcpl_id, "H5Pcreate");
-
- /* Tests one index holding only datatype messages */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, num_indexes);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, index_flags, min_mesg_size);
- CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, list_max, btree_min);
- CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
-
- /* Create a file */
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
-
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
-
- sohm_empty_filesize = h5_get_file_size(FILENAME, fapl_id);
-
- /* Add a bunch of datatypes to this file */
- file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
- CHECK_I(file, "H5Fopen");
- file = size1_helper(file, FILENAME, fapl_id, 0);
- CHECK_I(file, "size1_helper");
+ /* ----------------------------------------
+ * Run operations, accumulating file sizes to compare later.
+ */
+
+ for (use_shared = 0; use_shared < 2; use_shared++) {
+ for (use_btree = 0; use_btree < 2; use_btree++) {
+ hbool_t test_open_close;
+
+ /* cannot use btree indexing without shared messages; skip case */
+ if (use_btree && !use_shared)
+ continue;
+
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+
+ if (use_shared) {
+ /* Tests one index holding only datatype messages */
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, num_indexes);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, index_flags, min_mesg_size);
+ CHECK_I(ret, "H5Pset_shared_mesg_index");
+
+ if (use_btree) {
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
+ } else {
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, list_max, btree_min);
+ }
+ CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
+ } else {
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, 0);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ }
+
+ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK_I(file, "H5Fcreate");
+ ret = H5Fclose(file);
+ CHECK_I(ret, "H5Fclose");
- /* Get the size of a dataset object header */
- ret = H5Oget_info_by_name(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
- sohm_oh_size = oinfo.hdr.space.total;
+ /* size of empty file */
+ file_sizes[size_index++] = h5_get_file_size(FILENAME, fapl_id);
- /* Get the new file size */
- sohm_final_filesize = h5_get_file_size(FILENAME, fapl_id);
+ /* size of populated file, with different populating behaviors */
+ test_open_close = TRUE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &ninfo);
+ test_open_close = FALSE;
+ file_sizes[size_index++] = getsize_testsize1(FILENAME, fcpl_id, fapl_id, test_open_close, &ninfo);
+ oh_sizes[oh_size_index++] = ninfo.hdr.space.total;
- /* Use the same property list to create a new file. */
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ } /* for btree/listed messages */
+ } /* for normal/shared messages */
- ret = H5Pclose(fcpl_id);
+ ret = H5Pclose(fapl_id);
CHECK_I(ret, "H5Pclose");
- /* Add the same large datatypes, but keep closing and re-opening the file */
- file = size1_helper(file, FILENAME, fapl_id, 1);
- CHECK_I(file, "size1_helper");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
-
- /* Get the file size */
- sohm_final_filesize2 = h5_get_file_size(FILENAME, fapl_id);
-
-
-
- /* Create FCPL with SOHMs enabled that uses a B-tree index */
- fcpl_id = H5Pcreate(H5P_FILE_CREATE);
- CHECK_I(fcpl_id, "H5Pcreate");
-
- /* Tests one index holding only datatype messages */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, num_indexes);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, index_flags, min_mesg_size);
- CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
- CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
-
- /* Create a file */
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
+ /* sanity-check state of arrays */
+ VERIFY(9, size_index, "size_index");
+ VERIFY(3, oh_size_index, "oh_size_index");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
-
- sohm_btree_empty_filesize = h5_get_file_size(FILENAME, fapl_id);
-
- /* Add a bunch of datatypes to this file */
- file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
- CHECK_I(file, "H5Fopen");
- file = size1_helper(file, FILENAME, fapl_id, 0);
- CHECK_I(file, "size1_helper");
-
- /* Get the size of a dataset object header */
- ret = H5Oget_info_by_name(file, DSETNAME[0], &oinfo, H5P_DEFAULT);
- CHECK_I(ret, "H5Oget_info_by_name");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
- sohm_btree_oh_size = oinfo.hdr.space.total;
-
- /* Get the new file size */
- sohm_btree_final_filesize = h5_get_file_size(FILENAME, fapl_id);
-
- /* Use the same property list to create a new file. */
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
- CHECK_I(file, "H5Fcreate");
-
- ret = H5Pclose(fcpl_id);
- CHECK_I(ret, "H5Pclose");
+ /* ----------------------------------------
+ * Check that all sizes make sense.
+ */
- /* Add the same large datatypes, but keep closing and re-opening the file */
- file = size1_helper(file, FILENAME, fapl_id, 1);
- CHECK_I(file, "size1_helper");
- ret = H5Fclose(file);
- CHECK_I(ret, "H5Fclose");
+ /* Put result sizes into human-readable symbolic names.
+ * Order dependent on loop execution above.
+ */
+ norm_empty_filesize = file_sizes[0];
+ norm_final_filesize = file_sizes[1];
+ norm_final_filesize2 = file_sizes[2];
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
+ norm_oh_size = oh_sizes[0];
+#endif /* Jira HDFFV-10646 */
- /* Get the file size */
- sohm_btree_final_filesize2 = h5_get_file_size(FILENAME, fapl_id);
+ sohm_empty_filesize = file_sizes[3];
+ sohm_final_filesize = file_sizes[4];
+ sohm_final_filesize2 = file_sizes[5];
+ sohm_oh_size = oh_sizes[1];
+ sohm_btree_empty_filesize = file_sizes[6];
+ sohm_btree_final_filesize = file_sizes[7];
+ sohm_btree_final_filesize2 = file_sizes[8];
+ sohm_btree_oh_size = oh_sizes[2];
+ /* How the SOHM messages are stored shouldn't affect the
+ * size of the object header.
+ */
+ VERIFY(sohm_btree_oh_size, sohm_oh_size, "H5Oget_info_by_name");
- /* Check that all sizes make sense */
+#if 0 /* TBD: lying comment or bug. See Jira HDFFV-10646 */
/* Object headers in SOHM files should be smaller than normal object
- * headers. How the SOHM messages are stored shouldn't affect the
- * size of the object header.
+ * headers.
*/
- if(sohm_oh_size != sohm_btree_oh_size)
- VERIFY(sohm_btree_oh_size, 1, "H5Oget_info_by_name");
+ if (sohm_oh_size >= norm_oh_size)
+ VERIFY(norm_oh_size, 1, "H5Oget_info_by_name");
+#endif /* Jira HDFFV-10646 */
/* Both sohm files should be bigger than a normal file when empty.
* It's hard to say whether a B-tree with no nodes allocated should be
@@ -942,23 +933,129 @@ static void test_sohm_size1(void)
VERIFY(sohm_btree_empty_filesize, 1, "h5_get_file_size");
/* When full, the sohm btree file should be smaller than the normal file.
- * The sohm list file should be at least as small, since it doesn't need the
- * overhead of a B-tree.
+ * The sohm list file should be at least as small, since it doesn't need
+ * the overhead of a B-tree.
*/
if(sohm_btree_final_filesize >= norm_final_filesize)
VERIFY(sohm_btree_final_filesize, 1, "h5_get_file_size");
if(sohm_final_filesize > sohm_btree_final_filesize)
VERIFY(sohm_final_filesize, 1, "h5_get_file_size");
- /* This shouldn't change even if we open and close the file */
+ /* Comparative sizes shouldn't change even if we open and close the file
+ */
if(sohm_btree_final_filesize2 >= norm_final_filesize2)
VERIFY(sohm_btree_final_filesize2, 1, "h5_get_file_size");
if(sohm_final_filesize2 > sohm_btree_final_filesize2)
VERIFY(sohm_final_filesize2, 1, "h5_get_file_size");
+} /* test_sohm_size1 */
+
+
+/*---------------------------------------------------------------------------
+ * Function: test_sohm_size_consistency_open_create
+ *
+ * Purpose: Tests that header size is different depending on file open
+ * procedure?
+ * Uses "size1_helper" for file setup directed to a specific
+ * file handle.
+ *
+ * Programmer: Jacob Smith
+ * 2018 November 1
+ *
+ *---------------------------------------------------------------------------
+ */
+#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
+static void
+test_sohm_size_consistency_open_create(void)
+{
+ hid_t file = -1;
+ hid_t fcpl_id = -1;
+ hid_t fapl_id = -1;
+ unsigned use_btree;
+ hsize_t oh_size_open;
+ hsize_t oh_size_create;
+ H5O_native_info_t oinfo;
+ unsigned num_indexes = 1;
+ unsigned index_flags = H5O_SHMESG_DTYPE_FLAG;
+ unsigned min_mesg_size = 50;
+ unsigned list_max = 11;
+ unsigned btree_min = 10;
+ herr_t ret;
+
+ MESSAGE(5, \
+ ("Testing that header size is consistent between H5Fopen and H5Fcreate\n"));
+
+ /* Create a FAPL with "semi" close degree, to detect dangling IDs */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK_I(fapl_id, "H5Pcreate");
+ ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
+ CHECK_I(ret, "H5Pset_fclose_degree");
+
+ for (use_btree = 0; use_btree < 2; use_btree++) {
+ /* Create FCPL with SOHMs enabled
+ */
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, num_indexes);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, index_flags, min_mesg_size);
+ CHECK_I(ret, "H5Pset_shared_mesg_index");
+ if (use_btree) {
+ MESSAGE(5, ("----testing with btree index----\n"));
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
+ CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
+ } else {
+ MESSAGE(5, ("----testing with normal index----\n"));
+ ret = H5Pset_shared_mesg_phase_change(fcpl_id, list_max, btree_min);
+ CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
+ }
+
+ /* Create empty file */
+ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK_I(file, "H5Fcreate");
+ ret = H5Fclose(file);
+ CHECK_I(ret, "H5Fclose");
+
+ /* Test Open/Write
+ * Add messages to previously-created file */
+ file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
+ CHECK_I(file, "H5Fopen");
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
+ CHECK_I(file, "size1_helper");
+
+ /* Get the size of a dataset object header */
+ ret = H5Oget_native_info_by_name(file, DSETNAME[0], &oinfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK_I(ret, "H5Oget_native_info_by_name");
+ oh_size_open = oinfo.hdr.space.total;
+
+ ret = H5Fclose(file);
+ CHECK_I(ret, "H5Fclose");
+
+ /* Test Create/Write
+ * Add messages to a newly-created file */
+ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
+ CHECK_I(file, "H5Fcreate");
+ file = size1_helper(file, FILENAME, fapl_id, FALSE);
+ CHECK_I(file, "size1_helper");
+
+ /* Get the size of a dataset object header */
+ ret = H5Oget_native_info_by_name(file, DSETNAME[0], &oinfo, H5O_NATIVE_INFO_HDR, H5P_DEFAULT);
+ CHECK_I(ret, "H5Oget_native_info_by_name");
+ oh_size_create = oinfo.hdr.space.total;
+
+ ret = H5Fclose(file);
+ CHECK_I(ret, "H5Fclose");
+
+ VERIFY(oh_size_create, oh_size_open, "H5Oget_info_by_name2");
+
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ } /* for normal/btree indexing */
+
ret = H5Pclose(fapl_id);
CHECK_I(ret, "H5Pclose");
-}
+} /* test_sohm_size_consistency_open_create */
+#endif /* Jira HDFFV-10645 */
/*-------------------------------------------------------------------------
@@ -966,149 +1063,110 @@ static void test_sohm_size1(void)
*
* Purpose: Given an fcpl, tests creating attributes with and without
* committed datatypes.
+ * Verify that an attribute can be written and read back.
+ * Tests attribute on a Group.
+ * Tests committed and non-committed datatypes.
+ * Tests attribute access through `H5Aopen()`.
*
* Programmer: James Laird
* Thursday, November 30, 2006
*
*-------------------------------------------------------------------------
*/
-static void sohm_attr_helper(hid_t fcpl_id)
+static void
+sohm_attr_helper(hid_t fcpl_id)
{
hid_t file_id;
- hid_t type_id;
hid_t space_id;
- hid_t group_id;
- hid_t attr_id, attr_id2;
hsize_t dims = 2;
int wdata[2] = {7, 42};
int rdata[2];
herr_t ret;
size_t x;
+ unsigned op_index=0;
+#define TSOHM_SAH_OP_COUNT 3
+ const char *groupnames[TSOHM_SAH_OP_COUNT] = {
+ "group_for_nothing_special",
+ "group_for_commited_dtype",
+ "group_for_commited_dtype_and_other_ID_access",
+ };
- /*----------------------------------------------------------------------------
- * Test attribute with transient datatype
- */
- /* Create a file using the fcpl */
file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(file_id, "H5Fcreate");
- /* Create a normal datatype and dataset */
- type_id = H5Tcopy(H5T_NATIVE_INT);
- CHECK_I(type_id, "H5Tcopy");
space_id = H5Screate_simple(1, &dims, &dims);
CHECK_I(space_id, "H5Screate_simple");
- /* Create and verify an attribute on a group */
- group_id = H5Gcreate2(file_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(group_id, "H5Gcreate2");
- attr_id = H5Acreate2(group_id, "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate2");
- ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata);
- CHECK_I(ret, "H5Awrite");
-
- /* Close the datatype and group */
- ret = H5Tclose(type_id);
- CHECK_I(ret, "H5Tclose");
- ret = H5Gclose(group_id);
- CHECK_I(ret, "H5Gclose");
-
- /* Flush the file to force data to be written */
- ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
- CHECK_I(ret, "H5Fflush");
-
- /* Verify */
- HDmemset(rdata, 0, sizeof(rdata));
- ret = H5Aread(attr_id, H5T_NATIVE_INT, rdata);
- CHECK_I(ret, "H5Aread");
- for(x = 0; x < (size_t)dims; ++x)
- VERIFY(rdata[x], wdata[x], "H5Aread");
-
- /* Cleanup */
- ret = H5Aclose(attr_id);
- CHECK_I(ret, "H5Aclose");
-
- /*----------------------------------------------------------------------------
- * Test attribute with committed datatype
+ /* loop:
+ * 0 - nothing special
+ * 1 - committed datatype
+ * 2 - committed datatype, read through second ID
*/
- /* Repeat with a committed datatype */
- type_id = H5Tcopy(H5T_NATIVE_INT);
- CHECK_I(type_id, "H5Tcopy");
- ret = H5Tcommit2(file_id, "datatype", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(ret, "H5Tcommit2");
+ for (op_index = 0; op_index < TSOHM_SAH_OP_COUNT; op_index++) {
+ hid_t type_id = -1;
+ hid_t group_id = -1;
+ hid_t attr_id = -1;
+ hid_t attr_id2 = -1;
+ hid_t attr_read_id;
- /* Create and verify an attribute */
- group_id = H5Gcreate2(file_id, "another_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(group_id, "H5Gcreate2");
- attr_id = H5Acreate2(group_id, "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate2");
- ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata);
- CHECK_I(ret, "H5Awrite");
+ /* create group in file with name unique to op_index */
+ group_id = H5Gcreate2(file_id, groupnames[op_index], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(group_id, "H5Gcreate2");
- /* Close the datatype and group */
- ret = H5Tclose(type_id);
- CHECK_I(ret, "H5Tclose");
- ret = H5Gclose(group_id);
- CHECK_I(ret, "H5Gclose");
-
- /* Flush the file to force data to be written */
- ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
- CHECK_I(ret, "H5Fflush");
-
- /* Verify */
- HDmemset(rdata, 0, sizeof(rdata));
- ret = H5Aread(attr_id, H5T_NATIVE_INT, rdata);
- CHECK_I(ret, "H5Aread");
- for(x = 0; x < (size_t)dims; ++x)
- VERIFY(rdata[x], wdata[x], "H5Aread");
-
- /* Cleanup */
- ret = H5Aclose(attr_id);
- CHECK_I(ret, "H5Aclose");
-
- /*----------------------------------------------------------------------------
- * Test attribute operation with two ID handles
- */
- /* Create and verify an attribute */
- group_id = H5Gcreate2(file_id, "yet_another_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(group_id, "H5Gcreate2");
+ type_id = H5Tcopy(H5T_NATIVE_INT);
+ CHECK_I(type_id, "H5Tcopy");
- attr_id = H5Acreate2(group_id, "attribute", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT);
- CHECK_I(attr_id, "H5Acreate2");
+ /* Commit the datatype for the latter iterations.
+ * Only do this ONCE.
+ */
+ if (op_index == 1) {
+ ret = H5Tcommit2(file_id, "datatype", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(ret, "H5Tcommit2");
+ }
- /* Open the attribute to get another handle */
- attr_id2 = H5Aopen(group_id, "attribute", H5P_DEFAULT);
- CHECK_I(attr_id2, "H5Aopen");
+ attr_id = H5Acreate2(group_id, "attribute", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(attr_id, "H5Acreate2");
- ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata);
- CHECK_I(ret, "H5Awrite");
+ if (op_index == 2) {
+ /* Open the attribute to get another handle */
+ attr_id2 = H5Aopen(group_id, "attribute", H5P_DEFAULT);
+ CHECK_I(attr_id2, "H5Aopen");
+ }
- /* Close the group */
- ret = H5Gclose(group_id);
- CHECK_I(ret, "H5Gclose");
+ ret = H5Awrite(attr_id, H5T_NATIVE_INT, wdata);
+ CHECK_I(ret, "H5Awrite");
- /* Flush the file to force data to be written */
- ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
- CHECK_I(ret, "H5Fflush");
+ ret = H5Gclose(group_id);
+ CHECK_I(ret, "H5Gclose");
+ ret = H5Tclose(type_id);
+ CHECK_I(ret, "H5Tclose");
- /* Verify the data with another ID handle */
- HDmemset(rdata, 0, sizeof(rdata));
- ret = H5Aread(attr_id2, H5T_NATIVE_INT, rdata);
- CHECK_I(ret, "H5Aread");
+ /* Flush the file to force data to be written */
+ ret = H5Fflush(file_id, H5F_SCOPE_GLOBAL);
+ CHECK_I(ret, "H5Fflush");
- for(x = 0; x < (size_t)dims; ++x)
- VERIFY(rdata[x], wdata[x], "H5Aread");
+ /* Verify */
+ attr_read_id = (op_index == 2) ? attr_id2 : attr_id;
+ HDmemset(rdata, 0, sizeof(rdata));
+ ret = H5Aread(attr_read_id, H5T_NATIVE_INT, rdata);
+ CHECK_I(ret, "H5Aread");
+ for(x = 0; x < (size_t)dims; ++x)
+ VERIFY(rdata[x], wdata[x], "H5Aread");
- /* Cleanup */
- ret = H5Aclose(attr_id);
- CHECK_I(ret, "H5Aclose");
- ret = H5Aclose(attr_id2);
- CHECK_I(ret, "H5Aclose");
+ ret = H5Aclose(attr_id);
+ CHECK_I(ret, "H5Aclose");
+ if (attr_id2 > -1 ) {
+ ret = H5Aclose(attr_id2);
+ CHECK_I(ret, "H5Aclose");
+ }
+ } /* for each attribute operation */
ret = H5Sclose(space_id);
CHECK_I(ret, "H5Sclose");
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
-}
+#undef TSOHM_SAH_OP_COUNT
+} /* sohm_attr_helper */
/*-------------------------------------------------------------------------
@@ -1125,101 +1183,161 @@ static void sohm_attr_helper(hid_t fcpl_id)
*
*-------------------------------------------------------------------------
*/
-static void test_sohm_attrs(void)
+static void
+test_sohm_attrs(void)
{
- hid_t fcpl_id;
+ hid_t bad_fid = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID;
+ unsigned i = 0;
+#define TSOHM_TSA_NFLAGS_1 7
+ unsigned flags1[TSOHM_TSA_NFLAGS_1] = {
+ H5O_SHMESG_ATTR_FLAG,
+ H5O_SHMESG_SDSPACE_FLAG,
+ H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_SDSPACE_FLAG,
+ H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ };
+#define TSOHM_TSA_NFLAGS_2 6
+ unsigned flags2[TSOHM_TSA_NFLAGS_2][2] = {
+ { H5O_SHMESG_ATTR_FLAG,
+ H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ },
+ { H5O_SHMESG_SDSPACE_FLAG,
+ H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ },
+ { H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_SDSPACE_FLAG,
+ },
+ { H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG,
+ },
+ { H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_SDSPACE_FLAG,
+ },
+ { H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_SDSPACE_FLAG,
+ H5O_SHMESG_DTYPE_FLAG,
+ },
+ };
+#define TSOHM_TSA_NFLAGS_3 5
+ unsigned flags3[TSOHM_TSA_NFLAGS_3][3] = {
+ { H5O_SHMESG_ATTR_FLAG,
+ H5O_SHMESG_SDSPACE_FLAG,
+ H5O_SHMESG_DTYPE_FLAG,
+ },
+ { H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG,
+ H5O_SHMESG_SDSPACE_FLAG,
+ },
+ { H5O_SHMESG_SDSPACE_FLAG,
+ H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG,
+ },
+ { 0, /* first index does not hold a shared message type? */
+ H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG,
+ },
+ { 0, /* missing SDSPACE flag */
+ H5O_SHMESG_DTYPE_FLAG,
+ H5O_SHMESG_ATTR_FLAG,
+ },
+ };
herr_t ret;
MESSAGE(5, ("Testing that shared messages work with attributes\n"));
- /* Create an fcpl with no shared messages */
+ /* No shared messages
+ */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 0);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- /* Make sure attributes can be read with these settings (they'd better!) */
sohm_attr_helper(fcpl_id);
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
- /* Run tests with only one kind of message to be shared */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ATTR_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- /* Verify */
- sohm_attr_helper(fcpl_id);
-
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_SDSPACE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- sohm_attr_helper(fcpl_id);
-
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_DTYPE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- sohm_attr_helper(fcpl_id);
-
-
- /* Run with any two types shared */
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- sohm_attr_helper(fcpl_id);
-
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_DTYPE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- sohm_attr_helper(fcpl_id);
-
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_ATTR_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- sohm_attr_helper(fcpl_id);
-
-
- /* Run test with all three kinds of message shared */
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_ATTR_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- sohm_attr_helper(fcpl_id);
+ /* One shared message index
+ */
+ for (i=0; i < TSOHM_TSA_NFLAGS_1; i++) {
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, flags1[i], 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ sohm_attr_helper(fcpl_id);
- /* Try using two indexes */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ATTR_FLAG | H5O_SHMESG_DTYPE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_SHMESG_SDSPACE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ }
- sohm_attr_helper(fcpl_id);
+ /* two shared message indices
+ */
+ for (i=0; i < TSOHM_TSA_NFLAGS_2; i++) {
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, flags2[i][0], 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, flags2[i][1], 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_DTYPE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ sohm_attr_helper(fcpl_id);
- sohm_attr_helper(fcpl_id);
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ }
- ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_SHMESG_ATTR_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ /* duplicate flags in separate indices causes problems
+ */
+ H5E_BEGIN_TRY {
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ATTR_FLAG, 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, H5O_SHMESG_ATTR_FLAG, 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+
+ bad_fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
+ VERIFY(bad_fid, H5I_INVALID_HID, "H5Fcreate");
+
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ } H5E_END_TRY;
- sohm_attr_helper(fcpl_id);
+ /* three shared message indices
+ */
+ for (i=0; i < TSOHM_TSA_NFLAGS_3; i++) {
+ fcpl_id = H5Pcreate(H5P_FILE_CREATE);
+ CHECK_I(fcpl_id, "H5Pcreate");
+ ret = H5Pset_shared_mesg_nindexes(fcpl_id, 3);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 0, flags3[i][0], 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 1, flags3[i][1], 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pset_shared_mesg_index(fcpl_id, 2, flags3[i][2], 2);
+ CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ sohm_attr_helper(fcpl_id);
- /* One index for each kind of message */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, 3);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
- ret = H5Pset_shared_mesg_index(fcpl_id, 2, H5O_SHMESG_SDSPACE_FLAG, 2);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
+ ret = H5Pclose(fcpl_id);
+ CHECK_I(ret, "H5Pclose");
+ }
- sohm_attr_helper(fcpl_id);
+#undef TSOHM_TSA_NFLAGS_1
+#undef TSOHM_TSA_NFLAGS_2
+#undef TSOHM_TSA_NFLAGS_3
+} /* test_sohm_attrs */
- /* Close the FCPL */
- ret = H5Pclose(fcpl_id);
- CHECK_I(ret, "H5Pclose");
-}
/*-------------------------------------------------------------------------
* Function: size2_verify_plist1
@@ -1233,7 +1351,8 @@ static void test_sohm_attrs(void)
*
*-------------------------------------------------------------------------
*/
-static void size2_verify_plist1(hid_t plist)
+static void
+size2_verify_plist1(hid_t plist)
{
size_t cd_nelmts;
unsigned int cd_value;
@@ -1276,12 +1395,13 @@ static void size2_verify_plist1(hid_t plist)
ret = H5Pget_fill_value(plist, dtype1_id, &fill1);
CHECK_I(ret, "H5Pget_fill_value");
- ret = memcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
+ ret = HDmemcmp(&fill1, &fill1_correct, sizeof(fill1_correct));
VERIFY(ret, 0, "memcmp");
ret = H5Tclose(dtype1_id);
CHECK_I(ret, "H5Tclose");
-}
+} /* size2_verify_plist1 */
+
/*-------------------------------------------------------------------------
* Function: size2_verify_plist2
@@ -1295,7 +1415,8 @@ static void size2_verify_plist1(hid_t plist)
*
*-------------------------------------------------------------------------
*/
-static void size2_verify_plist2(hid_t plist)
+static void
+size2_verify_plist2(hid_t plist)
{
size_t cd_nelmts;
unsigned int cd_value;
@@ -1352,7 +1473,7 @@ static void size2_verify_plist2(hid_t plist)
ret = H5Tclose(dtype2_id);
CHECK_I(ret, "H5Tclose");
-}
+} /* size2_verify_plist2 */
#ifdef NOT_NOW
@@ -1373,16 +1494,16 @@ static void size2_verify_plist2(hid_t plist)
static void
size2_dump_struct(const char *name, size2_helper_struct *sizes)
{
- puts(name);
- printf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
- printf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
- printf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
- printf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
- printf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
- printf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
- printf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
- printf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
-}
+ HDputs(name);
+ HDprintf(" empty size: %llu\n", (unsigned long long)sizes->empty_size);
+ HDprintf(" first dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->first_dset, (unsigned long long)(sizes->first_dset - sizes->empty_size));
+ HDprintf("second dataset: %llu \tdelta: %llu\n", (unsigned long long)sizes->second_dset, (unsigned long long)(sizes->second_dset - sizes->first_dset));
+ HDprintf(" dsets 1: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets1, (unsigned long long)(sizes->dsets1 - sizes->second_dset));
+ HDprintf(" dsets 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->dsets2, (unsigned long long)(sizes->dsets2 - sizes->dsets1));
+ HDprintf(" interleaved: %llu \tdelta: %llu\n", (unsigned long long)sizes->interleaved, (unsigned long long)(sizes->interleaved - sizes->dsets2));
+ HDprintf(" attributes: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs1, (unsigned long long)(sizes->attrs1 - sizes->interleaved));
+ HDprintf(" attributes 2: %llu \tdelta: %llu\n", (unsigned long long)sizes->attrs2, (unsigned long long)(sizes->attrs2 - sizes->attrs1));
+} /* size2_dump_struct */
#endif /* NOT_NOW */
@@ -1573,15 +1694,14 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
ret_sizes->dsets1 = h5_get_file_size(FILENAME, H5P_DEFAULT);
- /* Now create a new group filled with datasets that use all different messages */
+ /* Create new group filled with datasets that use all different messages */
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK_I(file_id, "H5Fopen");
group_id = H5Gcreate2(file_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(group_id, "H5Gcreate2");
/* Create NUM_DATASETS datasets in the new group */
- for(x=0; x<NUM_DATASETS; ++x)
- {
+ for(x=0; x<NUM_DATASETS; ++x) {
dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT);
CHECK_I(dset_id, "H5Dcreate2");
@@ -1768,7 +1888,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(ret, "H5Pclose");
return 0;
-}
+} /* size2_helper */
/*-------------------------------------------------------------------------
@@ -1785,7 +1905,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
*
*-------------------------------------------------------------------------
*/
-static void size2_verify(void)
+static void
+size2_verify(void)
{
hid_t file_id = -1;
hid_t dset_id=-1;
@@ -1968,7 +2089,7 @@ static void size2_verify(void)
CHECK_I(ret, "H5Gclose");
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
-}
+} /* size2_verify */
/*-------------------------------------------------------------------------
@@ -1993,7 +2114,8 @@ static void size2_verify(void)
*
*-------------------------------------------------------------------------
*/
-static void test_sohm_size2(int close_reopen)
+static void
+test_sohm_size2(int close_reopen)
{
hid_t fcpl_id = -1;
/* Sizes for file with no shared messages at all */
@@ -2585,7 +2707,7 @@ static void test_sohm_size2(int close_reopen)
VERIFY(0, 1, "h5_get_file_size");
if((h5_stat_size_t)((float)share_tiny_index.attrs2 * OVERHEAD_ALLOWED) < type_space_index.attrs2)
VERIFY(0, 1, "h5_get_file_size");
-} /* end test_sohm_size2() */
+} /* test_sohm_size2 */
/*-------------------------------------------------------------------------
@@ -2601,27 +2723,22 @@ static void test_sohm_size2(int close_reopen)
*
*-------------------------------------------------------------------------
*/
-static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x)
+static void
+delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id, int x)
{
- hid_t dset_id = -1;
- hid_t attr_id = -1;
- char wdata;
+ hid_t dset_id = -1;
+ hid_t attr_id = -1;
+ char wdata;
herr_t ret;
- /* Create dataset */
dset_id = H5Dcreate2(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, dcpl_id[x], H5P_DEFAULT);
CHECK_I(dset_id, "H5Dcreate2");
-
- /* Write data to dataset */
wdata = (char)(x + 'a');
ret = H5Dwrite(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &wdata);
CHECK_I(ret, "H5Dwrite");
- /* Create an attribute on the dataset. */
attr_id = H5Acreate2(dset_id, "attr_name", H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
-
- /* Write to attribute */
ret = H5Awrite(attr_id, H5T_NATIVE_CHAR, &wdata);
CHECK_I(ret, "H5Awrite");
@@ -2629,7 +2746,7 @@ static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id,
CHECK_I(ret, "H5Aclose");
ret = H5Dclose(dset_id);
CHECK_I(ret, "H5Dclose");
-}
+} /* delete_helper_write */
/*-------------------------------------------------------------------------
@@ -2645,39 +2762,33 @@ static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id,
*
*-------------------------------------------------------------------------
*/
-static void delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
+static void
+delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
{
hid_t dset_id = -1;
hid_t attr_id = -1;
char rdata;
herr_t ret;
- /* Open dataset */
dset_id = H5Dopen2(file_id, DSETNAME[x], H5P_DEFAULT);
CHECK_I(dset_id, "H5Dopen2");
-
- /* Read */
rdata = '\0';
ret = H5Dread(dset_id, H5T_NATIVE_CHAR, dspace_id[x], dspace_id[x], H5P_DEFAULT, &rdata);
CHECK_I(ret, "H5Dread");
VERIFY(rdata, (x + 'a'), "H5Dread");
- /* Open attribute */
attr_id = H5Aopen(dset_id, "attr_name", H5P_DEFAULT);
CHECK_I(attr_id, "H5Aopen");
-
- /* Read */
rdata = '\0';
ret = H5Aread(attr_id, H5T_NATIVE_CHAR, &rdata);
CHECK_I(ret, "H5Dread");
VERIFY(rdata, (x + 'a'), "H5Dread");
- /* Cleanup */
ret = H5Aclose(attr_id);
CHECK_I(ret, "H5Aclose");
ret = H5Dclose(dset_id);
CHECK_I(ret, "H5Dclose");
-}
+} /* delete_helper_read */
/*-------------------------------------------------------------------------
@@ -2701,7 +2812,8 @@ static void delete_helper_read(hid_t file_id, hid_t *dspace_id, int x)
*
*-------------------------------------------------------------------------
*/
-static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id)
+static void
+delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id)
{
hid_t file_id=-1;
int x;
@@ -2765,7 +2877,7 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id)
VERIFY(norm_filesize, deleted_filesize, "h5_get_file_size");
if(deleted_filesize > (h5_stat_size_t)((float)norm_filesize * OVERHEAD_ALLOWED))
VERIFY(deleted_filesize, norm_filesize, "h5_get_file_size");
-}
+} /* delete_helper */
/*-------------------------------------------------------------------------
@@ -2799,6 +2911,8 @@ test_sohm_delete(void)
hsize_t dims[] = DELETE_DIMS;
herr_t ret;
+ MESSAGE(5, ("Testing deletion of SOHMs\n"));
+
/* Create a number of different dataspaces.
* For simplicity, each dataspace has only one element.
*/
@@ -2910,17 +3024,18 @@ test_sohm_delete(void)
ret = H5Pclose(dcpl_id[x]);
CHECK_I(ret, "H5Pclose");
} /* end for */
-} /* end test_sohm_delete() */
+} /* test_sohm_delete */
/*-------------------------------------------------------------------------
- * Function: test_sohm_delete_revert_helper
+ * Function: verify_dset_create_and_delete_does_not_grow_file
*
* Purpose: Tests that shared object header message deletion returns
* the file to its previous state using the supplied FCPL.
*
- * Creates shared messages and then deletes them. Ensures
- * that the file has not grown in size.
+ * Creates a file according to the supplied FCPL,
+ * then creates datasets and deletes them.
+ * Done in two passes: once with one dataset, once with two.
*
* Programmer: James Laird
* Wednesday, January 3, 2007
@@ -2930,7 +3045,7 @@ test_sohm_delete(void)
*-------------------------------------------------------------------------
*/
static int
-test_sohm_delete_revert_helper(hid_t fcpl_id)
+verify_dset_create_and_delete_does_not_grow_file(hid_t fcpl_id)
{
hid_t file_id;
hid_t dspace_id;
@@ -3017,13 +3132,14 @@ test_sohm_delete_revert_helper(hid_t fcpl_id)
return(0);
else
return(-1);
-} /* test_sohm_delete_revert_helper() */
+} /* verify_dset_create_and_delete_does_not_grow_file */
/*-------------------------------------------------------------------------
* Function: test_sohm_delete_revert
*
- * Purpose: Calls test_sohm_delete_revert_helper with different FCPLs.
+ * Purpose: Verifies that creation and deletion of datasets with shared
+ * message headers will not increase file size.
*
* Programmer: James Laird
* Wednesday, January 3, 2007
@@ -3038,6 +3154,8 @@ test_sohm_delete_revert(void)
hid_t fcpl_id;
herr_t ret;
+ MESSAGE(5, ("Testing that file reverts to original size on SOHM deletion\n"));
+
/* Create an fcpl with messages in two indexes */
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
@@ -3049,14 +3167,14 @@ test_sohm_delete_revert(void)
CHECK_I(ret, "H5Pset_shared_mesg_index");
/* Call the helper function to test this FCPL. */
- ret = test_sohm_delete_revert_helper(fcpl_id);
- CHECK_I(ret, "test_sohm_delete_revert_helper");
+ ret = verify_dset_create_and_delete_does_not_grow_file(fcpl_id);
+ CHECK_I(ret, "verify_dset_create_and_delete_does_not_grow_file");
/* Try using B-trees */
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_delete_revert_helper(fcpl_id);
- CHECK_I(ret, "test_sohm_delete_revert_helper");
+ ret = verify_dset_create_and_delete_does_not_grow_file(fcpl_id);
+ CHECK_I(ret, "verify_dset_create_and_delete_does_not_grow_file");
/* Try sharing all messages */
@@ -3067,14 +3185,14 @@ test_sohm_delete_revert(void)
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 10, 5);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_delete_revert_helper(fcpl_id);
- CHECK_I(ret, "test_sohm_delete_revert_helper");
+ ret = verify_dset_create_and_delete_does_not_grow_file(fcpl_id);
+ CHECK_I(ret, "verify_dset_create_and_delete_does_not_grow_file");
/* Try using B-trees */
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_delete_revert_helper(fcpl_id);
- CHECK_I(ret, "test_sohm_delete_revert_helper");
+ ret = verify_dset_create_and_delete_does_not_grow_file(fcpl_id);
+ CHECK_I(ret, "verify_dset_create_and_delete_does_not_grow_file");
/* There should be at least two messages in the test (datatype and
* dataspace). Use an index that will transition from a list to
@@ -3082,8 +3200,8 @@ test_sohm_delete_revert(void)
*/
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 1, 2);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_delete_revert_helper(fcpl_id);
- CHECK_I(ret, "test_sohm_delete_revert_helper");
+ ret = verify_dset_create_and_delete_does_not_grow_file(fcpl_id);
+ CHECK_I(ret, "verify_dset_create_and_delete_does_not_grow_file");
/* Try with shared messages enabled, but when messages are too big
@@ -3091,16 +3209,16 @@ test_sohm_delete_revert(void)
*/
ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ALL_FLAG, 35);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_delete_revert_helper(fcpl_id);
- CHECK_I(ret, "test_sohm_delete_revert_helper");
+ ret = verify_dset_create_and_delete_does_not_grow_file(fcpl_id);
+ CHECK_I(ret, "verify_dset_create_and_delete_does_not_grow_file");
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
-}
+} /* test_sohm_delete_revert */
/*-------------------------------------------------------------------------
- * Function: test_sohm_extlink_helper
+ * Function: verify_dset_create_and_open_through_extlink_with_sohm
*
* Purpose: Tests that a dataset created through an external link can
* be opened (that shared messages were created or not and
@@ -3113,7 +3231,8 @@ test_sohm_delete_revert(void)
*
*-------------------------------------------------------------------------
*/
-static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id)
+static void
+verify_dset_create_and_open_through_extlink_with_sohm(hid_t src_fcpl_id, hid_t dst_fcpl_id)
{
hid_t src_file_id = -1;
hid_t dst_file_id = -1;
@@ -3164,7 +3283,7 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id)
CHECK_I(ret, "H5Dclose");
ret = H5Fclose(dst_file_id);
CHECK_I(ret, "H5Fclose");
-}
+} /* verify_dset_create_and_open_through_extlink_with_sohm */
/*-------------------------------------------------------------------------
@@ -3186,7 +3305,8 @@ test_sohm_extlink(void)
hid_t fcpl_id = -1;
herr_t ret;
- /* Create fcpl */
+ MESSAGE(5, ("Testing SOHM creation through external links\n"));
+
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
@@ -3194,20 +3314,17 @@ test_sohm_extlink(void)
ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ALL_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- /* Test using external links when the source or destination file uses
- * shared messages
- */
- test_sohm_extlink_helper(fcpl_id, H5P_DEFAULT);
- test_sohm_extlink_helper(H5P_DEFAULT, fcpl_id);
- test_sohm_extlink_helper(fcpl_id, fcpl_id);
+ verify_dset_create_and_open_through_extlink_with_sohm(fcpl_id, H5P_DEFAULT);
+ verify_dset_create_and_open_through_extlink_with_sohm(H5P_DEFAULT, fcpl_id);
+ verify_dset_create_and_open_through_extlink_with_sohm(fcpl_id, fcpl_id);
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
-}
+} /* test_sohm_extlink */
/*-------------------------------------------------------------------------
- * Function: test_sohm_extend_dset_helper
+ * Function: verify_dataset_extension
*
* Purpose: Tests extending a dataset's dataspace when sharing is
* enabled.
@@ -3223,26 +3340,111 @@ test_sohm_extlink(void)
*-------------------------------------------------------------------------
*/
static int
-test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
+verify_dataset_extension(hid_t fcpl_id, hbool_t close_reopen)
{
- hid_t file_id = -1;
- hid_t orig_space_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t orig_space_id = H5I_INVALID_HID;
hid_t space1_id, space2_id, space3_id;
- hid_t dcpl_id = -1;
- hid_t dset1_id, dset2_id, dset3_id;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t dset1_id, dset2_id = H5I_INVALID_HID, dset3_id = H5I_INVALID_HID;
hsize_t dims1[] = {1, 2};
hsize_t max_dims[] = {H5S_UNLIMITED, 2};
hsize_t dims2[] = {5, 2};
hsize_t out_dims[2];
hsize_t out_maxdims[2];
int x;
- int old_nerrs; /* Number of errors when entering this routine */
+ int old_nerrs; /* Number of errors when entering this routine */
herr_t ret;
- /* Retrieve the current # of reported errors */
+ hsize_t *space_dims[3];
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Macro: TSOHM_VDE_VERIFY_SPACES
+ *
+ * Purpose: Encapsulate a common pattern
+ * Open, read-verify, and close the dataspaces for datasets 1-3
+ *
+ * Programmer: Jacob Smith
+ * 2018 November 5
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+#define TSOHM_VDE_VERIFY_SPACES(dims) \
+{ \
+ /* Open dataspaces \
+ */ \
+ space1_id = H5Dget_space(dset1_id); \
+ CHECK_I(space1_id, "H5Dget_space"); \
+ space2_id = H5Dget_space(dset2_id); \
+ CHECK_I(space2_id, "H5Dget_space"); \
+ space3_id = H5Dget_space(dset3_id); \
+ CHECK_I(space3_id, "H5Dget_space"); \
+ /* Verify dataspaces \
+ */ \
+ ret = H5Sget_simple_extent_dims(space1_id, out_dims, out_maxdims); \
+ CHECK_I(ret, "H5Sget_simple_extent_dims"); \
+ for(x=0; x<EXTEND_NDIMS; ++x) { \
+ VERIFY(out_dims[x], (dims)[0][x], "H5Sget_simple_extent_dims"); \
+ VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims"); \
+ } \
+ ret = H5Sget_simple_extent_dims(space2_id, out_dims, out_maxdims); \
+ CHECK_I(ret, "H5Sget_simple_extent_dims"); \
+ for(x=0; x<EXTEND_NDIMS; ++x) { \
+ VERIFY(out_dims[x], (dims)[1][x], "H5Sget_simple_extent_dims"); \
+ VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims"); \
+ } \
+ ret = H5Sget_simple_extent_dims(space3_id, out_dims, out_maxdims); \
+ CHECK_I(ret, "H5Sget_simple_extent_dims"); \
+ for(x=0; x<EXTEND_NDIMS; ++x) { \
+ VERIFY(out_dims[x], (dims)[2][x], "H5Sget_simple_extent_dims"); \
+ VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims"); \
+ } \
+ /* Close dataspaces \
+ */ \
+ CHECK_I(H5Sclose(space1_id), "H5Sclose"); \
+ CHECK_I(H5Sclose(space2_id), "H5Sclose"); \
+ CHECK_I(H5Sclose(space3_id), "H5Sclose"); \
+} /* define TSOHM_VDE_VERIFY_SPACES */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Macro: TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS()
+ *
+ * Purpose: Encapsulate a common pattern
+ * Wrapper to close and reopen file and datasets:
+ * + "dataset" (dset_id)
+ * + if n > 1 then include "dataset2" (dset_id2)
+ * + if n > 2 then include "dataset3" (dset_id3)
+ * + file (file_id)
+ *
+ * Programmer: Jacob Smith
+ * 2018 November 5
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+#define TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(n) \
+{ \
+ CHECK_I(H5Dclose(dset1_id), "H5Dclose"); \
+ if ((n) > 1) \
+ CHECK_I(H5Dclose(dset2_id), "H5Dclose"); \
+ if ((n) > 2) \
+ CHECK_I(H5Dclose(dset3_id), "H5Dclose"); \
+ CHECK_I(H5Fclose(file_id), "H5Fclose"); \
+ \
+ file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT); \
+ CHECK_I(file_id, "H5Fopen"); \
+ dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT); \
+ CHECK_I(dset1_id, "H5Dopen2"); \
+ if ((n) > 1) { \
+ dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT); \
+ CHECK_I(dset2_id, "H5Dopen2"); \
+ } \
+ if ((n) > 2) { \
+ dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT); \
+ CHECK_I(dset3_id, "H5Dopen2"); \
+ } \
+} /* define TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS */
+
+ /* Remember the current # of reported errors */
old_nerrs = GetTestNumErrs();
- /* Create file */
file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(file_id, "H5Fcreate");
@@ -3257,251 +3459,49 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
CHECK_I(orig_space_id, "H5Screate_simple");
dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset1_id, "H5Dcreate2");
-
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- }
+ if(close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(1);
/* Create another dataset starting with the same dataspace */
dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset2_id, "H5Dcreate2");
-
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(2);
/* Create a third dataset with the same dataspace */
dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset3_id, "H5Dcreate2");
-
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset3_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT);
- CHECK_I(dset3_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
/* Extend the first dataset */
ret = H5Dset_extent(dset1_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset3_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT);
- CHECK_I(dset3_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
- /* Get the dataspaces from the datasets */
- space1_id = H5Dget_space(dset1_id);
- CHECK_I(space1_id, "H5Dget_space");
- space2_id = H5Dget_space(dset2_id);
- CHECK_I(space2_id, "H5Dget_space");
- space3_id = H5Dget_space(dset3_id);
- CHECK_I(space3_id, "H5Dget_space");
-
- /* Verify the dataspaces */
- ret = H5Sget_simple_extent_dims(space1_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space2_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims1[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space3_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims1[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- /* Close all three dataspaces */
- ret = H5Sclose(space1_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space2_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space3_id);
- CHECK_I(ret, "H5Sclose");
+ space_dims[0] = dims2;
+ space_dims[1] = dims1;
+ space_dims[2] = dims1;
+ TSOHM_VDE_VERIFY_SPACES(space_dims);
/* Extend the second dataset */
ret = H5Dset_extent(dset2_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset3_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT);
- CHECK_I(dset3_id, "H5Dopen2");
- }
-
- /* Get the dataspaces from the datasets */
- space1_id = H5Dget_space(dset1_id);
- CHECK_I(space1_id, "H5Dget_space");
- space2_id = H5Dget_space(dset2_id);
- CHECK_I(space2_id, "H5Dget_space");
- space3_id = H5Dget_space(dset3_id);
- CHECK_I(space3_id, "H5Dget_space");
-
- /* Verify the dataspaces */
- ret = H5Sget_simple_extent_dims(space1_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space2_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space3_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims1[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
+ if(close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
- /* Close all three dataspaces */
- ret = H5Sclose(space1_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space2_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space3_id);
- CHECK_I(ret, "H5Sclose");
+ space_dims[1] = dims2;
+ TSOHM_VDE_VERIFY_SPACES(space_dims);
/* Extend the third dataset */
ret = H5Dset_extent(dset3_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset3_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT);
- CHECK_I(dset3_id, "H5Dopen2");
- }
-
- /* Get the dataspaces from the datasets */
- space1_id = H5Dget_space(dset1_id);
- CHECK_I(space1_id, "H5Dget_space");
- space2_id = H5Dget_space(dset2_id);
- CHECK_I(space2_id, "H5Dget_space");
- space3_id = H5Dget_space(dset3_id);
- CHECK_I(space3_id, "H5Dget_space");
-
- /* Verify the dataspaces */
- ret = H5Sget_simple_extent_dims(space1_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space2_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space3_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
+ if(close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
- /* Close all three dataspaces */
- ret = H5Sclose(space1_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space2_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space3_id);
- CHECK_I(ret, "H5Sclose");
+ space_dims[2] = dims2;
+ TSOHM_VDE_VERIFY_SPACES(space_dims);
/* Close the datasets and file */
ret = H5Dclose(dset1_id);
@@ -3523,164 +3523,44 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
CHECK_I(file_id, "H5Fcreate");
dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset1_id, "H5Dcreate2");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(1);
/* Extend the first dataset */
ret = H5Dset_extent(dset1_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(1);
/* Create the second dataset. Its dataspace will be unshared and then
* become shared when extended.
*/
dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset2_id, "H5Dcreate2");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(2);
/* Extend the second dataset */
ret = H5Dset_extent(dset2_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- }
+ if (close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(2);
/* Create the third dataset. Its dataspace will be unshared and then
* become shared when extended.
*/
dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
CHECK_I(dset3_id, "H5Dcreate2");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset3_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
-
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT);
- CHECK_I(dset3_id, "H5Dopen2");
- }
+ if(close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
/* Extend the third dataset */
ret = H5Dset_extent(dset3_id, dims2);
CHECK_I(ret, "H5Dset_extent");
- if(close_reopen) {
- /* If requested, close all open IDs and reopen them */
- ret = H5Dclose(dset1_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset2_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Dclose(dset3_id);
- CHECK_I(ret, "H5Dclose");
- ret = H5Fclose(file_id);
- CHECK_I(ret, "H5Fclose");
+ if(close_reopen)
+ TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS(3);
- file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
- CHECK_I(file_id, "H5Fopen");
- dset1_id = H5Dopen2(file_id, "dataset", H5P_DEFAULT);
- CHECK_I(dset1_id, "H5Dopen2");
- dset2_id = H5Dopen2(file_id, "dataset2", H5P_DEFAULT);
- CHECK_I(dset2_id, "H5Dopen2");
- dset3_id = H5Dopen2(file_id, "dataset3", H5P_DEFAULT);
- CHECK_I(dset3_id, "H5Dopen2");
- }
-
- /* Get the dataspaces from the datasets */
- space1_id = H5Dget_space(dset1_id);
- CHECK_I(space1_id, "H5Dget_space");
- space2_id = H5Dget_space(dset2_id);
- CHECK_I(space2_id, "H5Dget_space");
- space3_id = H5Dget_space(dset3_id);
- CHECK_I(space3_id, "H5Dget_space");
-
- /* Verify the dataspaces */
- ret = H5Sget_simple_extent_dims(space1_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space2_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- ret = H5Sget_simple_extent_dims(space3_id, out_dims, out_maxdims);
- CHECK_I(ret, "H5Sget_simple_extent_dims");
- for(x=0; x<EXTEND_NDIMS; ++x) {
- VERIFY(out_dims[x], dims2[x], "H5Sget_simple_extent_dims");
- VERIFY(out_maxdims[x], max_dims[x], "H5Sget_simple_extent_dims");
- }
-
- /* Close all three dataspaces */
- ret = H5Sclose(space1_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space2_id);
- CHECK_I(ret, "H5Sclose");
- ret = H5Sclose(space3_id);
- CHECK_I(ret, "H5Sclose");
+ TSOHM_VDE_VERIFY_SPACES(space_dims);
/* Close the datasets and file */
ret = H5Dclose(dset1_id);
@@ -3698,12 +3578,15 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
ret = H5Pclose(dcpl_id);
CHECK_I(ret, "H5Pclose");
- /* Retrieve current # of errors */
+ /* Complain if this test generated errors */
if(old_nerrs == GetTestNumErrs())
return(0);
else
return(-1);
-} /* end test_sohm_extend_dset_helper() */
+/* macros are exclusive to this function */
+#undef TSOHM_VDE_CLOSE_REOPEN_FILE_AND_DSETS
+#undef TSOHM_VDE_VERIFY_SPACES
+} /* verify_dataset_extension */
/*-------------------------------------------------------------------------
@@ -3726,74 +3609,71 @@ test_sohm_extend_dset(void)
hid_t fcpl_id = -1;
herr_t ret;
- /* Create fcpl */
+ MESSAGE(5, ("Testing extending shared dataspaces\n"));
+
fcpl_id = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl_id, "H5Pcreate");
-
- /* Test extending datasets with different FCPLs */
ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
/* No shared messages */
- ret = test_sohm_extend_dset_helper(fcpl_id, FALSE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
- ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
+ ret = verify_dataset_extension(fcpl_id, FALSE);
+ CHECK_I(ret, "verify_dataset_extension");
+ ret = verify_dataset_extension(fcpl_id, TRUE);
+ CHECK_I(ret, "verify_dataset_extension");
/* Only dataspaces */
ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_SDSPACE_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = test_sohm_extend_dset_helper(fcpl_id, FALSE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
- ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
+ ret = verify_dataset_extension(fcpl_id, FALSE);
+ CHECK_I(ret, "verify_dataset_extension");
+ ret = verify_dataset_extension(fcpl_id, TRUE);
+ CHECK_I(ret, "verify_dataset_extension");
/* All messages */
- ret = H5Pset_shared_mesg_nindexes(fcpl_id, 1);
- CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
ret = H5Pset_shared_mesg_index(fcpl_id, 0, H5O_SHMESG_ALL_FLAG, 16);
CHECK_I(ret, "H5Pset_shared_mesg_index");
- ret = test_sohm_extend_dset_helper(fcpl_id, FALSE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
- ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
+ ret = verify_dataset_extension(fcpl_id, FALSE);
+ CHECK_I(ret, "verify_dataset_extension");
+ ret = verify_dataset_extension(fcpl_id, TRUE);
+ CHECK_I(ret, "verify_dataset_extension");
/* All messages in lists */
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 100, 50);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_extend_dset_helper(fcpl_id, FALSE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
- ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
+ ret = verify_dataset_extension(fcpl_id, FALSE);
+ CHECK_I(ret, "verify_dataset_extension");
+ ret = verify_dataset_extension(fcpl_id, TRUE);
+ CHECK_I(ret, "verify_dataset_extension");
/* All messages in lists converted to B-trees */
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 1, 0);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_extend_dset_helper(fcpl_id, FALSE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
- ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
+ ret = verify_dataset_extension(fcpl_id, FALSE);
+ CHECK_I(ret, "verify_dataset_extension");
+ ret = verify_dataset_extension(fcpl_id, TRUE);
+ CHECK_I(ret, "verify_dataset_extension");
/* All messages in B-trees */
ret = H5Pset_shared_mesg_phase_change(fcpl_id, 0, 0);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- ret = test_sohm_extend_dset_helper(fcpl_id, FALSE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
- ret = test_sohm_extend_dset_helper(fcpl_id, TRUE);
- CHECK_I(ret, "test_sohm_extend_dset_helper");
+ ret = verify_dataset_extension(fcpl_id, FALSE);
+ CHECK_I(ret, "verify_dataset_extension");
+ ret = verify_dataset_extension(fcpl_id, TRUE);
+ CHECK_I(ret, "verify_dataset_extension");
ret = H5Pclose(fcpl_id);
CHECK_I(ret, "H5Pclose");
-}
+} /* test_sohm_extend_dset */
/*-------------------------------------------------------------------------
@@ -3827,141 +3707,119 @@ test_sohm_external_dtype(void)
unsigned x, i;
herr_t ret;
+ MESSAGE(5, ("Testing shared external datatype\n"));
+
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK_I(fcpl, "H5Pcreate");
-
- /* Set up index values for sohm */
ret = H5Pset_shared_mesg_nindexes(fcpl, TEST_NUM_INDEXES);
CHECK_I(ret, "H5Pset_shared_mesg_nindexes");
-
- for(x=0; x<TEST_NUM_INDEXES; ++x)
- {
+ for(x=0; x<TEST_NUM_INDEXES; ++x) {
ret = H5Pset_shared_mesg_index(fcpl, x, test_type_flags[x], test_minsizes[x]);
CHECK_I(ret, "H5Pset_shared_mesg_index");
}
-
ret = H5Pset_shared_mesg_phase_change(fcpl, TEST_L2B, TEST_B2L);
CHECK_I(ret, "H5Pset_shared_mesg_phase_change");
- /* Create the data space */
space = H5Screate_simple(2, dims, NULL);
CHECK_I(space, "H5Screate_simple");
- /* Create a data type for s1_t */
s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t));
CHECK_I(s1_tid, "H5Tcreate");
-
ret = H5Tinsert(s1_tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
CHECK_I(ret, "H5Tinsert");
-
ret = H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT);
CHECK_I(ret, "H5Tinsert");
- /* Create the first file for this test */
+ /* Set up dataset in first file */
file1 = H5Fcreate(FILENAME_SRC, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT);
CHECK_I(file1, "H5Fcreate");
/* Check on datatype storage status. It should be zero now. */
- ret = H5F_get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 0, "H5F__get_sohm_mesg_count_test");
- /* Create data set */
dataset1 = H5Dcreate2(file1, "dataset_1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
CHECK_I(dataset1, "H5Dcreate2");
/* Check on datatype storage status. It should be 1 now. */
- ret = H5F_get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(file1, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 1, "H5F__get_sohm_mesg_count_test");
- /* Retieve the dataset's datatype */
dset1_tid = H5Dget_type(dataset1);
CHECK_I(dset1_tid, "H5Dget_type");
/* Allocate space and initialize data */
orig = (s1_t*)HDmalloc(NX * NY * sizeof(s1_t));
+ if (orig == NULL)
+ CHECK_I(-1, "HDmalloc");
for(i=0; i<NX*NY; i++) {
s_ptr = (s1_t*)orig + i;
s_ptr->a = (int)(i * 3 + 1);
s_ptr->b = (int)(i * 3 + 2);
}
- /* Write the data to the dataset1 */
ret = H5Dwrite(dataset1, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig);
CHECK_I(ret, "H5Dwrite");
-
ret = H5Dclose(dataset1);
CHECK_I(ret, "H5Dclose");
- /* Create the second file for this test */
+ /* 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");
/* Check on datatype storage status. It should be zero now. */
- ret = H5F_get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 0, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 0, "H5F__get_sohm_mesg_count_test");
- /* Create a data set using the datatype of the dataset in the first file. */
dataset2 = H5Dcreate2(file2, "dataset_2", dset1_tid, space, H5P_DEFAULT, H5P_DEFAULT,
H5P_DEFAULT);
CHECK_I(dataset2, "H5Dcreate2");
/* Check on datatype storage status. It should be 1 now. */
- ret = H5F_get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
- CHECK(ret, FAIL, "H5F_get_sohm_mesg_count_test");
- VERIFY(dmsg_count, 1, "H5F_get_sohm_mesg_count_test");
+ ret = H5F__get_sohm_mesg_count_test(file2, H5O_DTYPE_ID, &dmsg_count);
+ CHECK(ret, FAIL, "H5F__get_sohm_mesg_count_test");
+ VERIFY(dmsg_count, 1, "H5F__get_sohm_mesg_count_test");
- /* Write the data to the dataset2 */
ret = H5Dwrite(dataset2, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig);
CHECK_I(ret, "H5Dwrite");
+ /* Close references to the first file */
ret = H5Dclose(dataset2);
CHECK_I(ret, "H5Dclose");
-
- /* Close file 1 and the dataset's datatype in file 1. Verify that the datatype in
- * file 2 is still accessible. */
ret = H5Tclose(dset1_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Fclose(file1);
CHECK_I(ret, "H5Fclose");
- /* Open the dataset in file 2 */
+ /* Verify that datatype details are still accessible by second file */
dataset2 = H5Dopen2(file2, "dataset_2", H5P_DEFAULT);
CHECK_I(dataset2, "H5Dopen2");
- /* Retieve the dataset's datatype */
dset2_tid = H5Dget_type(dataset2);
CHECK_I(dset2_tid, "H5Dget_type");
- /* Verify the datatype is compound */
dtype_class = H5Tget_class(dset2_tid);
VERIFY(dtype_class, H5T_COMPOUND, "H5Tget_class");
+ /* Cleanup */
ret = H5Tclose(dset2_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Dclose(dataset2);
CHECK_I(ret, "H5Dclose");
-
- /* Finishing test and release resources */
ret = H5Sclose(space);
CHECK_I(ret, "H5Sclose");
-
ret = H5Tclose(s1_tid);
CHECK_I(ret, "H5Tclose");
-
ret = H5Pclose(fcpl);
CHECK_I(ret, "H5Pclose");
-
ret = H5Fclose(file2);
CHECK_I(ret, "H5Fclose");
-
HDfree(orig);
-}
+} /* test_sohm_external_dtype */
/****************************************************************
@@ -3972,11 +3830,14 @@ test_sohm_external_dtype(void)
void
test_sohm(void)
{
- /* Output message about test being performed */
MESSAGE(5, ("Testing Shared Object Header Messages\n"));
- test_sohm_fcpl(); /* Test SOHMs and file creation plists */
+ test_sohm_fcpl(); /* Test SOHMs and file creation plists */
+ test_sohm_fcpl_errors(); /* Bogus H5P* calls for SOHMs */
test_sohm_size1(); /* Tests the sizes of files with one SOHM */
+#if 0 /* TODO: REVEALS BUG TO BE FIXED - SEE JIRA HDFFV-10645 */
+ test_sohm_size_consistency_open_create();
+#endif /* Jira HDFFV-10645 */
test_sohm_attrs(); /* Tests shared messages in attributes */
test_sohm_size2(0); /* Tests the sizes of files with multiple SOHMs */
test_sohm_size2(1); /* Tests the sizes of files with multiple
@@ -3989,17 +3850,17 @@ test_sohm(void)
test_sohm_extend_dset(); /* Test extending shared datasets */
test_sohm_external_dtype(); /* Test using datatype in another file */
-} /* test_sohm() */
+} /* test_sohm */
/*-------------------------------------------------------------------------
- * Function: cleanup_sohm
+ * Function: cleanup_sohm
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: James Laird
+ * Programmer: James Laird
* October 9, 2006
*
* Modifications:
@@ -4009,8 +3870,8 @@ test_sohm(void)
void
cleanup_sohm(void)
{
- remove(FILENAME);
- remove(FILENAME_SRC);
- remove(FILENAME_DST);
-}
+ HDremove(FILENAME);
+ HDremove(FILENAME_SRC);
+ HDremove(FILENAME_DST);
+} /* cleanup_sohm */
diff --git a/test/ttime.c b/test/ttime.c
index 2eb2117..5b3436d 100644
--- a/test/ttime.c
+++ b/test/ttime.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: ttime
+* Test program: ttime
*
* Test the Time Datatype functionality
*
@@ -21,8 +21,6 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
#define DATAFILE "ttime.h5"
#ifdef NOT_YET
#define DATASETNAME "Dataset"
@@ -180,13 +178,13 @@ test_time_io(void)
tid = H5Dget_type(dsid);
CHECK(tid, FAIL, "H5Dget_type");
if( H5Tget_class (tid) == H5T_TIME)
- fprintf(stderr,"datatype class is H5T_TIME\n");
+ HDfprintf(stderr,"datatype class is H5T_TIME\n");
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
status = H5Dread (dsid, H5T_UNIX_D32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &timethen);
CHECK(status, FAIL, "H5Dread");
-fprintf(stderr,"time written was: %s\n", HDctime(&timethen));
+HDfprintf(stderr,"time written was: %s\n", HDctime(&timethen));
status = H5Dclose(dsid);
CHECK(status, FAIL, "H5Dclose");
@@ -215,15 +213,15 @@ test_time(void)
} /* test_time() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_time
+ * Function: cleanup_time
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* October 19, 2000
*
* Modifications:
@@ -233,6 +231,6 @@ test_time(void)
void
cleanup_time(void)
{
- remove(DATAFILE);
+ HDremove(DATAFILE);
}
diff --git a/test/ttsafe.c b/test/ttsafe.c
index ae4d7c5..e6edd9a 100644
--- a/test/ttsafe.c
+++ b/test/ttsafe.c
@@ -27,14 +27,8 @@
* Each test module should include ttsafe.h and define a unique set of
* names for test files they create.
*
- * BUGS/LIMITATIONS
- *
- * EXPORTED ROUTINES/VARIABLES:
- *
*/
-#include "h5test.h"
-
/* ANY new test needs to have a prototype in ttsafe.h */
#include "ttsafe.h"
@@ -112,7 +106,7 @@ int main(int argc, char *argv[])
#ifdef H5_HAVE_THREADSAFE
AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL);
AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL);
-#ifdef H5_HAVE_PTHREAD_H
+#ifdef H5_HAVE_PTHREAD_H
/* Thread cancellability only supported with pthreads ... */
AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL);
#endif /* H5_HAVE_PTHREAD_H */
@@ -120,7 +114,7 @@ int main(int argc, char *argv[])
#else /* H5_HAVE_THREADSAFE */
- printf("Most thread-safety tests skipped because THREADSAFE not enabled\n");
+ HDprintf("Most thread-safety tests skipped because THREADSAFE not enabled\n");
#endif /* H5_HAVE_THREADSAFE */
diff --git a/test/ttsafe.h b/test/ttsafe.h
index 6cf449f..c29fadc 100644
--- a/test/ttsafe.h
+++ b/test/ttsafe.h
@@ -22,9 +22,6 @@
* Include required headers. This file tests internal library functions,
* so we include the private headers here.
*/
-#include "hdf5.h"
-#include "H5private.h"
-#include "H5Eprivate.h"
#include "testhdf5.h"
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index 42d0851..5c08d09 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -26,31 +26,15 @@
* dataset), there is a small chance that consecutive reads occur
* before a write to that shared variable.
*
- * HDF5 APIs exercised in thread:
- * H5Acreate2, H5Awrite, H5Aclose.
- *
* Created: Oct 5 1999
* Programmer: Chee Wai LEE
*
- * Modification History
- * --------------------
- *
- * 15 May 2000, Chee Wai LEE
- * Incorporated into library tests.
- *
- * 19 May 2000, Bill Wendling
- * Changed so that it creates its own HDF5 file and removes it at cleanup
- * time.
- *
********************************************************************/
#include "ttsafe.h"
#ifdef H5_HAVE_THREADSAFE
-#include <stdio.h>
-#include <stdlib.h>
-
#define FILENAME "ttsafe_acreate.h5"
#define DATASETNAME "IntData"
#define NUM_THREADS 16
@@ -64,20 +48,24 @@ typedef struct acreate_data_struct {
int current_index;
} ttsafe_name_data_t;
-void tts_acreate(void)
+void
+tts_acreate(void)
{
/* Thread declarations */
H5TS_thread_t threads[NUM_THREADS];
/* HDF5 data declarations */
- hid_t file, dataset;
- hid_t dataspace, datatype;
- hid_t attribute;
+ hid_t file = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t dataspace = H5I_INVALID_HID;
+ hid_t datatype = H5I_INVALID_HID;
+ hid_t attribute = H5I_INVALID_HID;
hsize_t dimsf[1]; /* dataset dimensions */
/* data declarations */
int data; /* data to write */
- int buffer, ret, i;
+ int buffer, i;
+ herr_t status;
ttsafe_name_data_t *attrib_data;
@@ -86,25 +74,27 @@ void tts_acreate(void)
* creation plist and default file access plist
*/
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(file>=0);
+ CHECK(file, H5I_INVALID_HID, "H5Fcreate");
/* create a simple dataspace for the dataset */
dimsf[0] = 1;
dataspace = H5Screate_simple(1, dimsf, NULL);
- assert(dataspace>=0);
+ CHECK(dataspace, H5I_INVALID_HID, "H5Screate_simple");
/* define datatype for the data using native little endian integers */
datatype = H5Tcopy(H5T_NATIVE_INT);
- H5Tset_order(datatype, H5T_ORDER_LE);
+ CHECK(datatype, H5I_INVALID_HID, "H5Tcopy");
+ status = H5Tset_order(datatype, H5T_ORDER_LE);
+ CHECK(status, FAIL, "H5Tset_order");
/* create a new dataset within the file */
dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(dataset >= 0);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* initialize data for dataset and write value to dataset */
data = NUM_THREADS;
- ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data);
- assert(ret >= 0);
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data);
+ CHECK(status, FAIL, "H5Dwrite");
/*
* Simultaneously create a large number of attributes to be associated
@@ -117,45 +107,46 @@ void tts_acreate(void)
attrib_data->dataspace = dataspace;
attrib_data->current_index = i;
threads[i] = H5TS_create_thread(tts_acreate_thread, NULL, attrib_data);
- } /* end for */
+ }
- for(i = 0; i < NUM_THREADS; i++) {
+ for(i = 0; i < NUM_THREADS; i++)
H5TS_wait_for_thread(threads[i]);
- } /* end for */
-
/* verify the correctness of the test */
for(i = 0; i < NUM_THREADS; i++) {
attribute = H5Aopen(dataset, gen_name(i), H5P_DEFAULT);
+ CHECK(attribute, H5I_INVALID_HID, "H5Aopen");
if(attribute < 0)
TestErrPrintf("unable to open appropriate attribute. Test failed!\n");
else {
- ret = H5Aread(attribute, H5T_NATIVE_INT, &buffer);
-
- if(ret < 0 || buffer != i)
- TestErrPrintf("wrong data values. Test failed!\n");
+ status = H5Aread(attribute, H5T_NATIVE_INT, &buffer);
+ CHECK(status, FAIL, "H5Aread");
+ VERIFY(buffer, i, "data values don't match");
- H5Aclose(attribute);
- } /* end else */
- } /* end for */
+ status = H5Aclose(attribute);
+ CHECK(status, FAIL, "H5Aclose");
+ }
+ }
/* close remaining resources */
- ret = H5Sclose(dataspace);
- assert(ret >= 0);
- ret = H5Tclose(datatype);
- assert(ret >= 0);
- ret = H5Dclose(dataset);
- assert(ret >= 0);
- ret = H5Fclose(file);
- assert(ret >= 0);
-}
-
-void *tts_acreate_thread(void *client_data)
+ status = H5Sclose(dataspace);
+ CHECK(status, FAIL, "H5Sclose");
+ status = H5Tclose(datatype);
+ CHECK(status, FAIL, "H5Sclose");
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Fclose(file);
+ CHECK(status, FAIL, "H5Fclose");
+} /* end tts_acreate() */
+
+void *
+tts_acreate_thread(void *client_data)
{
- hid_t attribute;
+ hid_t attribute = H5I_INVALID_HID;
char *attribute_name;
int *attribute_data; /* data for attributes */
+ herr_t status;
ttsafe_name_data_t *attrib_data;
@@ -166,18 +157,23 @@ void *tts_acreate_thread(void *client_data)
attribute = H5Acreate2(attrib_data->dataset, attribute_name,
attrib_data->datatype, attrib_data->dataspace,
H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(attribute, H5I_INVALID_HID, "H5Acreate2");
/* Write data to the attribute */
attribute_data = (int *)HDmalloc(sizeof(int));
*attribute_data = attrib_data->current_index;
- H5Awrite(attribute, H5T_NATIVE_INT, attribute_data);
- H5Aclose(attribute);
+ status = H5Awrite(attribute, H5T_NATIVE_INT, attribute_data);
+ CHECK(status, FAIL, "H5Awrite");
+ status = H5Aclose(attribute);
+ CHECK(status, FAIL, "H5Aclose");
return NULL;
-}
+} /* end tts_acreate_thread() */
-void cleanup_acreate(void)
+void
+cleanup_acreate(void)
{
HDunlink(FILENAME);
}
#endif /*H5_HAVE_THREADSAFE*/
+
diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c
index 4bbb326..f6bcd0d 100644
--- a/test/ttsafe_cancel.c
+++ b/test/ttsafe_cancel.c
@@ -27,20 +27,9 @@
* Temporary files generated:
* ttsafe_cancel.h5
*
- * HDF5 APIs exercised in thread:
- * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose,
- * H5Dwrite, H5Dread, H5Diterate, H5Tclose, H5Sclose.
- *
* Created: May 15 2000
* Programmer: Chee Wai LEE
*
- * Modification History
- * --------------------
- *
- * 19 May 2000, Bill Wendling
- * Changed so that it creates its own HDF5 file and removes it at cleanup
- * time.
- *
********************************************************************/
#include "ttsafe.h"
@@ -66,12 +55,13 @@ pthread_t childthread;
pthread_mutex_t mutex;
pthread_cond_t cond;
-void tts_cancel(void)
+void
+tts_cancel(void)
{
pthread_attr_t attribute;
hid_t dataset;
int buffer;
- int ret;
+ int H5_ATTR_NDEBUG_UNUSED ret;
/* make thread scheduling global */
ret=pthread_attr_init(&attribute);
@@ -116,31 +106,34 @@ void tts_cancel(void)
/* Destroy the thread attribute */
ret=pthread_attr_destroy(&attribute);
assert(ret==0);
-}
+} /* end tts_cancel() */
-void *tts_cancel_thread(void H5_ATTR_UNUSED *arg)
+void *
+tts_cancel_thread(void H5_ATTR_UNUSED *arg)
{
+ hid_t dataspace = H5I_INVALID_HID;
+ hid_t datatype = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
int datavalue;
int buffer;
- hid_t dataspace, datatype, dataset;
hsize_t dimsf[1]; /* dataset dimensions */
cancel_cleanup_t *cleanup_structure;
- int ret;
+ herr_t status;
/* define dataspace for dataset */
dimsf[0] = 1;
dataspace = H5Screate_simple(1, dimsf, NULL);
- assert(dataspace >= 0);
+ CHECK(dataspace, H5I_INVALID_HID, "H5Screate_simple");
/* define datatype for the data using native little endian integers */
datatype = H5Tcopy(H5T_NATIVE_INT);
- assert(datatype >= 0);
- ret = H5Tset_order(datatype, H5T_ORDER_LE);
- assert(ret >= 0);
+ CHECK(datatype, H5I_INVALID_HID, "H5Tcopy");
+ status = H5Tset_order(datatype, H5T_ORDER_LE);
+ CHECK(status, FAIL, "H5Tset_order");
/* create a new dataset within the file */
dataset = H5Dcreate2(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(dataset >= 0);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* If thread is cancelled, make cleanup call */
cleanup_structure = (cancel_cleanup_t*)HDmalloc(sizeof(cancel_cleanup_t));
@@ -151,25 +144,26 @@ void *tts_cancel_thread(void H5_ATTR_UNUSED *arg)
datavalue = 1;
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
- assert(ret>=0);
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
+ CHECK(status, FAIL, "H5Dwrite");
- ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer);
- assert(ret>=0);
- ret=H5Diterate(&buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset);
- assert(ret>=0);
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer);
+ CHECK(status, FAIL, "H5Dread");
+ status = H5Diterate(&buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset);
+ CHECK(status, FAIL, "H5Diterate");
HDsleep(3);
datavalue = 100;
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
- assert(ret>=0);
- ret=H5Dclose(dataset);
- assert(ret>=0);
- ret=H5Tclose(datatype);
- assert(ret>=0);
- ret=H5Sclose(dataspace);
- assert(ret>=0);
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
+ CHECK(status, FAIL, "H5Dwrite");
+
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Tclose(datatype);
+ CHECK(status, FAIL, "H5Tclose");
+ status = H5Sclose(dataspace);
+ CHECK(status, FAIL, "H5Sclose");
/*
* Required by pthreads. The argument 0 pops the stack but does not
@@ -178,73 +172,78 @@ void *tts_cancel_thread(void H5_ATTR_UNUSED *arg)
pthread_cleanup_pop(0);
return NULL;
-}
+} /* end tts_cancel_thread() */
-herr_t tts_cancel_callback(void *elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim,
+herr_t
+tts_cancel_callback(void *elem, hid_t H5_ATTR_UNUSED type_id, unsigned H5_ATTR_UNUSED ndim,
const hsize_t H5_ATTR_UNUSED *point, void *operator_data)
{
- int value = *(int *)elem;
hid_t dataset = *(hid_t *)operator_data;
- int ret;
+ int value = *(int *)elem;
+ herr_t status;
tts_cancel_barrier();
HDsleep(3);
if (value != 1) {
TestErrPrintf("Error! Element value should be 1 and not %d\n", value);
- return -1;
+ return FAIL;
}
value += 10;
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
- assert(ret>=0);
- return 0;
-}
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ CHECK(status, FAIL, "H5Dwrite");
+
+ return SUCCEED;
+} /* end tts_cancel_callback() */
/*
* Need to perform the dataset, datatype and dataspace close that was never
* performed because of thread cancellation
*/
-void cancellation_cleanup(void *arg)
+void
+cancellation_cleanup(void *arg)
{
cancel_cleanup_t *cleanup_structure = (cancel_cleanup_t *)arg;
- int ret;
+ herr_t status;
- ret=H5Dclose(cleanup_structure->dataset);
- assert(ret>=0);
- ret=H5Tclose(cleanup_structure->datatype);
- assert(ret>=0);
- ret=H5Sclose(cleanup_structure->dataspace);
- assert(ret>=0);
+ status = H5Dclose(cleanup_structure->dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Tclose(cleanup_structure->datatype);
+ CHECK(status, FAIL, "H5Tclose");
+ status = H5Sclose(cleanup_structure->dataspace);
+ CHECK(status, FAIL, "H5Sclose");
/* retained for debugging */
/* print_func("cancellation noted, cleaning up ... \n"); */
-}
+} /* end cancellation_cleanup() */
/*
* Artificial (and specific to this test) barrier to keep track of whether
* both the main and child threads have reached a point in the program.
*/
-void tts_cancel_barrier(void)
+void
+tts_cancel_barrier(void)
{
static int count = 2;
- int ret;
+ int status;
- ret=pthread_mutex_lock(&mutex);
- assert(ret==0);
+ status = pthread_mutex_lock(&mutex);
+ VERIFY(status, 0, "pthread_mutex_lock");
if (count != 1) {
count--;
- ret=pthread_cond_wait(&cond, &mutex);
- assert(ret==0);
- } else {
- ret=pthread_cond_signal(&cond);
- assert(ret==0);
+ status = pthread_cond_wait(&cond, &mutex);
+ VERIFY(status, 0, "pthread_cond_wait");
+ }
+ else {
+ status = pthread_cond_signal(&cond);
+ VERIFY(status, 0, "pthread_cond_signal");
}
- ret=pthread_mutex_unlock(&mutex);
- assert(ret==0);
-}
+ status = pthread_mutex_unlock(&mutex);
+ VERIFY(status, 0, "pthread_mutex_unlock");
+} /* end tts_cancel_barrier() */
void cleanup_cancel(void)
{
@@ -253,3 +252,4 @@ void cleanup_cancel(void)
#endif /*H5_HAVE_WIN_THREADS*/
#endif /*H5_HAVE_THREADSAFE*/
+
diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c
index 65051c7..36b5f1f 100644
--- a/test/ttsafe_dcreate.c
+++ b/test/ttsafe_dcreate.c
@@ -23,20 +23,9 @@
* Temporary files generated:
* ttsafe_dcreate.h5
*
- * HDF5 APIs exercised in thread:
- * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dwrite, H5Dclose,
- * H5Tclose, H5Sclose.
- *
* Created: Apr 28 2000
* Programmer: Chee Wai LEE
*
- * Modification History
- * --------------------
- *
- * 19 May 2000, Bill Wendling
- * Changed so that it creates its own HDF5 file and removes it at cleanup
- * time.
- *
********************************************************************/
#include "ttsafe.h"
@@ -83,16 +72,18 @@ thread_info thread_out[NUM_THREAD];
* Thread safe test - multiple dataset creation
**********************************************************************
*/
-void tts_dcreate(void)
+void
+tts_dcreate(void)
{
/* thread definitions */
H5TS_thread_t threads[NUM_THREAD];
/* HDF5 data definitions */
- hid_t file, dataset;
+ hid_t file = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
int datavalue, i;
H5TS_attr_t attribute;
- int ret;
+ herr_t status;
/* set pthread attribute to perform global scheduling */
H5TS_attr_init(&attribute);
@@ -107,7 +98,7 @@ void tts_dcreate(void)
* creation plist and default file access plist
*/
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(file >= 0);
+ CHECK(file, H5I_INVALID_HID, "H5Fcreate");
/* simultaneously create a large number of datasets within the file */
for(i = 0; i < NUM_THREAD; i++) {
@@ -115,11 +106,10 @@ void tts_dcreate(void)
thread_out[i].file = file;
thread_out[i].dsetname = dsetname[i];
threads[i] = H5TS_create_thread(tts_dcreate_creator, NULL, &thread_out[i]);
- } /* end for */
+ }
- for(i = 0;i < NUM_THREAD; i++) {
+ for(i = 0;i < NUM_THREAD; i++)
H5TS_wait_for_thread(threads[i]);
- } /* end for */
/* compare data to see if it is written correctly */
@@ -129,36 +119,38 @@ void tts_dcreate(void)
H5Fclose(file);
return;
} else {
- ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
- assert(ret >= 0);
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
+ CHECK(status, FAIL, "H5Dread");
if(datavalue != i) {
TestErrPrintf("Wrong value read %d for dataset name %s - test failed\n",
datavalue, dsetname[i]);
- ret = H5Dclose(dataset);
- assert(ret >= 0);
- ret = H5Fclose(file);
- assert(ret >= 0);
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Fclose(file);
+ CHECK(status, FAIL, "H5Fclose");
return;
}
- ret = H5Dclose(dataset);
- assert(ret >= 0);
+ status= H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
}
}
/* close remaining resources */
- ret = H5Fclose(file);
- assert(ret >= 0);
+ status = H5Fclose(file);
+ CHECK(status, FAIL, "H5Fclose");
/* Destroy the thread attribute */
H5TS_attr_destroy(&attribute);
-}
+} /* end tts_dcreate() */
-void *tts_dcreate_creator(void *_thread_data)
+void *
+tts_dcreate_creator(void *_thread_data)
{
- hid_t dataspace, dataset;
- herr_t ret;
+ hid_t dataspace = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ herr_t status;
hsize_t dimsf[1]; /* dataset dimensions */
struct thread_info thread_data;
@@ -167,28 +159,29 @@ void *tts_dcreate_creator(void *_thread_data)
/* define dataspace for dataset */
dimsf[0] = 1;
dataspace = H5Screate_simple(1, dimsf, NULL);
- assert(dataspace >= 0);
+ CHECK(dataspace, H5I_INVALID_HID, "H5Screate_simple");
/* create a new dataset within the file */
dataset = H5Dcreate2(thread_data.file, thread_data.dsetname,
H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- assert(dataset >= 0);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dcreate2");
/* initialize data for dataset and write value to dataset */
- ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, &thread_data.id);
- assert(ret >= 0);
+ CHECK(status, FAIL, "H5Dwrite");
/* close dataset and dataspace resources */
- ret = H5Dclose(dataset);
- assert(ret >= 0);
- ret = H5Sclose(dataspace);
- assert(ret >= 0);
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Sclose(dataspace);
+ CHECK(status, FAIL, "H5Sclose");
return NULL;
-}
+} /* end tts_dcreate_creator() */
-void cleanup_dcreate(void)
+void
+cleanup_dcreate(void)
{
HDunlink(FILENAME);
}
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 889d64b..9eeaa24 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -25,21 +25,9 @@
*
* ttsafe_error.h5
*
- * HDF5 APIs exercised in thread:
- *
- * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose,
- * H5Tclose, H5Sclose.
- *
* Created: Apr 28 2000
* Programmer: Chee Wai LEE
*
- * Modification History
- * --------------------
- *
- * 19 May 2000, Bill Wendling
- * Modified so that it creates a unique HDF5 file and removes it on
- * cleanup.
- *
********************************************************************/
#include "ttsafe.h"
@@ -49,181 +37,215 @@
#define FILENAME "ttsafe_error.h5"
/* Having a common dataset name is an error */
-#define DATASETNAME "commonname"
-#define EXPECTED_ERROR_DEPTH 8
-#define WRITE_NUMBER 37
-
-static herr_t error_callback(hid_t , void *);
-static herr_t walk_error_callback(unsigned, const H5E_error2_t *, void *);
-static void *tts_error_thread(void *);
-
-/* Global variables */
-hid_t error_file;
+#define DATASETNAME "commonname"
+#define EXPECTED_ERROR_DEPTH 10
+#define WRITE_NUMBER 37
+/* Typedefs */
typedef struct err_num_struct {
hid_t maj_num;
hid_t min_num;
} err_num_t;
-err_num_t expected[8];
+/* Global variables */
+hid_t error_file_g = H5I_INVALID_HID;
+int error_flag_g = 0;
+int error_count_g = 0;
+err_num_t expected_g[EXPECTED_ERROR_DEPTH];
+H5TS_mutex_simple_t error_mutex_g;
+
+/* Prototypes */
+static herr_t error_callback(hid_t , void *);
+static herr_t walk_error_callback(unsigned, const H5E_error2_t *, void *);
+static void *tts_error_thread(void *);
-int error_flag = 0;
-int error_count = 0;
-H5TS_mutex_simple_t error_mutex;
-void tts_error(void)
+void
+tts_error(void)
{
- H5TS_thread_t threads[NUM_THREAD];
- H5TS_attr_t attribute;
- hid_t dataset;
- int value, i;
- int ret;
+ hid_t def_fapl = H5I_INVALID_HID;
+ hid_t vol_id = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
+ H5TS_thread_t threads[NUM_THREAD];
+ H5TS_attr_t attribute;
+ int value, i;
+ herr_t status;
/* Must initialize these at runtime */
- expected[0].maj_num = H5E_DATASET;
- expected[0].min_num = H5E_CANTINIT;
+ expected_g[0].maj_num = H5E_DATASET;
+ expected_g[0].min_num = H5E_CANTINIT;
+
+ expected_g[1].maj_num = H5E_VOL;
+ expected_g[1].min_num = H5E_CANTCREATE;
- expected[1].maj_num = H5E_DATASET;
- expected[1].min_num = H5E_CANTINIT;
+ expected_g[2].maj_num = H5E_VOL;
+ expected_g[2].min_num = H5E_CANTCREATE;
- expected[2].maj_num = H5E_LINK;
- expected[2].min_num = H5E_CANTINIT;
+ expected_g[3].maj_num = H5E_DATASET;
+ expected_g[3].min_num = H5E_CANTINIT;
- expected[3].maj_num = H5E_SYM;
- expected[3].min_num = H5E_CANTINSERT;
+ expected_g[4].maj_num = H5E_DATASET;
+ expected_g[4].min_num = H5E_CANTINIT;
- expected[4].maj_num = H5E_SYM;
- expected[4].min_num = H5E_NOTFOUND;
+ expected_g[5].maj_num = H5E_LINK;
+ expected_g[5].min_num = H5E_CANTINIT;
- expected[5].maj_num = H5E_SYM;
- expected[5].min_num = H5E_CALLBACK;
+ expected_g[6].maj_num = H5E_LINK;
+ expected_g[6].min_num = H5E_CANTINSERT;
- expected[6].maj_num = H5E_SYM;
- expected[6].min_num = H5E_EXISTS;
+ expected_g[7].maj_num = H5E_SYM;
+ expected_g[7].min_num = H5E_NOTFOUND;
+
+ expected_g[8].maj_num = H5E_SYM;
+ expected_g[8].min_num = H5E_CALLBACK;
+
+ expected_g[9].maj_num = H5E_LINK;
+ expected_g[9].min_num = H5E_EXISTS;
/* set up mutex for global count of errors */
- H5TS_mutex_init(&error_mutex);
+ H5TS_mutex_init(&error_mutex_g);
/* make thread scheduling global */
H5TS_attr_init(&attribute);
- /* set thread scope to system */
-
#ifdef H5_HAVE_SYSTEM_SCOPE_THREADS
+ /* set thread scope to system */
H5TS_attr_setscope(&attribute, H5TS_SCOPE_SYSTEM);
#endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */
- /*
- * Create a hdf5 file using H5F_ACC_TRUNC access, default file
- * creation plist and default file access plist
- */
- error_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(error_file>=0);
+ def_fapl = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(def_fapl, H5I_INVALID_HID, "H5Pcreate");
- for (i = 0; i < NUM_THREAD; i++){
- threads[i] = H5TS_create_thread(tts_error_thread, &attribute, NULL);
- }
+ status = H5Pget_vol_id(def_fapl, &vol_id);
+ CHECK(status, FAIL, "H5Pget_vol_id");
- for (i = 0; i < NUM_THREAD; i++){
- H5TS_wait_for_thread(threads[i]);
- }
+ if(vol_id == H5VL_NATIVE) {
+ /* Create a hdf5 file using H5F_ACC_TRUNC access, default file
+ * creation plist and default file access plist
+ */
+ error_file_g = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, def_fapl);
+ CHECK(error_file_g, H5I_INVALID_HID, "H5Fcreate");
+
+ for (i = 0; i < NUM_THREAD; i++)
+ threads[i] = H5TS_create_thread(tts_error_thread, &attribute, NULL);
- if (error_flag)
- TestErrPrintf("Threads reporting different error values!\n");
+ for (i = 0; i < NUM_THREAD; i++)
+ H5TS_wait_for_thread(threads[i]);
- if (error_count != NUM_THREAD - 1)
- TestErrPrintf("Error: %d threads failed instead of %d\n", error_count, NUM_THREAD-1);
+ if (error_flag_g) {
+ TestErrPrintf("At least one thread reported a value that was different from the expected value\n");
+ HDprintf("(Update this test if the error stack changed!)\n");
+ }
- dataset = H5Dopen2(error_file, DATASETNAME, H5P_DEFAULT);
- assert(dataset >= 0);
+ if (error_count_g != NUM_THREAD - 1)
+ TestErrPrintf("Error: %d threads failed instead of %d\n", error_count_g, NUM_THREAD-1);
- ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
- assert(ret>=0);
+ dataset = H5Dopen2(error_file_g, DATASETNAME, H5P_DEFAULT);
+ CHECK(dataset, H5I_INVALID_HID, "H5Dopen2");
- if (value != WRITE_NUMBER)
- TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER);
+ status = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ CHECK(status, FAIL, "H5Dread");
- ret=H5Dclose(dataset);
- assert(ret>=0);
- ret=H5Fclose(error_file);
- assert(ret>=0);
+ if (value != WRITE_NUMBER)
+ TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER);
+
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ status = H5Fclose(error_file_g);
+ CHECK(status, FAIL, "H5Fclose");
+ } /* end if */
+ else
+ HDprintf("Non-native VOL connector used, skipping test\n");
+
+ status = H5Idec_ref(vol_id);
+ CHECK(status, FAIL, "H5Idec_ref");
H5TS_attr_destroy(&attribute);
-}
+} /* end tts_error() */
-static
-void *tts_error_thread(void H5_ATTR_UNUSED *arg)
+static void *
+tts_error_thread(void H5_ATTR_UNUSED *arg)
{
- hid_t dataspace, datatype, dataset;
+ hid_t dataspace = H5I_INVALID_HID;
+ hid_t datatype = H5I_INVALID_HID;
+ hid_t dataset = H5I_INVALID_HID;
hsize_t dimsf[1]; /* dataset dimensions */
H5E_auto2_t old_error_cb;
void *old_error_client_data;
int value;
- int ret;
+ herr_t status;
/* preserve previous error stack handler */
- H5Eget_auto2(H5E_DEFAULT, &old_error_cb, &old_error_client_data);
+ status = H5Eget_auto2(H5E_DEFAULT, &old_error_cb, &old_error_client_data);
+ CHECK(status, FAIL, "H5Eget_auto2");
/* set each thread's error stack handler */
- H5Eset_auto2(H5E_DEFAULT, error_callback, NULL);
+ status = H5Eset_auto2(H5E_DEFAULT, error_callback, NULL);
+ CHECK(status, FAIL, "H5Eset_auto2");
/* define dataspace for dataset */
dimsf[0] = 1;
dataspace = H5Screate_simple(1, dimsf, NULL);
- assert(dataspace >= 0);
+ CHECK(dataspace, H5I_INVALID_HID, "H5Screate_simple");
/* define datatype for the data using native little endian integers */
datatype = H5Tcopy(H5T_NATIVE_INT);
- assert(datatype >= 0);
- H5Tset_order(datatype, H5T_ORDER_LE);
+ CHECK(datatype, H5I_INVALID_HID, "H5Tcopy");
+ status = H5Tset_order(datatype, H5T_ORDER_LE);
+ CHECK(status, FAIL, "H5Tset_order");
/* create a new dataset within the file */
- dataset = H5Dcreate2(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if(dataset >= 0) { /* not an error */
+ dataset = H5Dcreate2(error_file_g, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ /* Most of these will fail, so don't check the error here */
+ if (dataset >= 0) {
value = WRITE_NUMBER;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
- H5Dclose(dataset);
- } /* end if */
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ CHECK(status, FAIL, "H5Dwrite");
+ status = H5Dclose(dataset);
+ CHECK(status, FAIL, "H5Dclose");
+ }
- ret = H5Tclose(datatype);
- assert(ret >= 0);
- ret = H5Sclose(dataspace);
- assert(ret >= 0);
+ status = H5Tclose(datatype);
+ CHECK(status, FAIL, "H5Tclose");
+ status = H5Sclose(dataspace);
+ CHECK(status, FAIL, "H5Sclose");
/* turn our error stack handler off */
- H5Eset_auto2(H5E_DEFAULT, old_error_cb, old_error_client_data);
+ status = H5Eset_auto2(H5E_DEFAULT, old_error_cb, old_error_client_data);
+ CHECK(status, FAIL, "H5Eset_auto2");
return NULL;
-}
+} /* end tts_error_thread() */
-static
-herr_t error_callback(hid_t H5_ATTR_UNUSED estack_id, void *client_data)
+static herr_t
+error_callback(hid_t H5_ATTR_UNUSED estack_id, void *client_data)
{
- H5TS_mutex_lock_simple(&error_mutex);
- error_count++;
- H5TS_mutex_unlock_simple(&error_mutex);
+ H5TS_mutex_lock_simple(&error_mutex_g);
+ error_count_g++;
+ H5TS_mutex_unlock_simple(&error_mutex_g);
return H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, client_data);
}
-static
-herr_t walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void H5_ATTR_UNUSED *client_data)
+static herr_t
+walk_error_callback(unsigned n, const H5E_error2_t *err_desc, void H5_ATTR_UNUSED *client_data)
{
- hid_t maj_num, min_num;
+ hid_t maj_num = H5I_INVALID_HID;
+ hid_t min_num = H5I_INVALID_HID;
if (err_desc) {
maj_num = err_desc->maj_num;
min_num = err_desc->min_num;
- if (n < EXPECTED_ERROR_DEPTH && maj_num == expected[n].maj_num &&
- min_num == expected[n].min_num)
+ if (n <= EXPECTED_ERROR_DEPTH && maj_num == expected_g[n].maj_num && min_num == expected_g[n].min_num)
return SUCCEED;
}
- error_flag = -1;
+ error_flag_g = -1;
return SUCCEED;
}
-void cleanup_error(void)
+void
+cleanup_error(void)
{
HDunlink(FILENAME);
}
diff --git a/test/ttst.c b/test/ttst.c
index b26d582..c5912c5 100644
--- a/test/ttst.c
+++ b/test/ttst.c
@@ -157,7 +157,7 @@ test_tst_create(void)
/* Try creating a TST */
tree=H5ST_create();
- CHECK(tree, NULL, "H5ST_create");
+ CHECK_PTR(tree, "H5ST_create");
/* Try closing a real tree */
ret=H5ST_close(tree);
@@ -186,7 +186,7 @@ test_tst_insert(void)
/* Create the TST */
tree=H5ST_create();
- CHECK(tree, NULL, "H5ST_create");
+ CHECK_PTR(tree, "H5ST_create");
/* Insert unique words into TST, in random order */
for(u=0; u<num_uniq_words; u++) {
@@ -202,13 +202,13 @@ test_tst_insert(void)
/* Check that the value "payloads" are correct */
found=H5ST_find(tree,uniq_words[u]);
- CHECK(found, NULL, "H5ST_find");
+ CHECK_PTR(found, "H5ST_find");
if(HDstrcmp((const char *)found->eqkid,uniq_words[u]))
TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]);
obj=H5ST_locate(tree,uniq_words[u]);
- CHECK(obj, NULL, "H5ST_locate");
+ CHECK_PTR(obj, "H5ST_locate");
if(HDstrcmp((const char *)obj,uniq_words[u]))
TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]);
@@ -246,7 +246,7 @@ test_tst_iterate(void)
/* Create the TST */
tree=H5ST_create();
- CHECK(tree, NULL, "H5ST_create");
+ CHECK_PTR(tree, "H5ST_create");
/* Insert unique words into TST, in random order */
for(u=0; u<num_uniq_words; u++) {
@@ -256,7 +256,7 @@ test_tst_iterate(void)
/* Use findfirst/findnext calls to iterate through TST */
found=H5ST_findfirst(tree);
- CHECK(found, NULL, "H5ST_findfirst");
+ CHECK_PTR(found, "H5ST_findfirst");
u=0;
do {
/* Check that the strings in the TST are in the correct order */
@@ -294,7 +294,7 @@ test_tst_remove(void)
/* Create the TST */
tree=H5ST_create();
- CHECK(tree, NULL, "H5ST_create");
+ CHECK_PTR(tree, "H5ST_create");
/* Insert unique words into TST, in random order */
for(u=0; u<num_uniq_words; u++) {
@@ -305,7 +305,7 @@ test_tst_remove(void)
/* Remove strings from TST in random order */
for(u=0; u<num_uniq_words; u++) {
obj=H5ST_remove(tree,rand_uniq_words[u]);
- CHECK(obj, NULL, "H5ST_remove");
+ CHECK_PTR(obj, "H5ST_remove");
/* Check that the correct string was removed from TST */
if(HDstrcmp((const char *)obj,rand_uniq_words[u]))
@@ -326,7 +326,7 @@ test_tst_remove(void)
for(u=0; u<num_uniq_words; u++) {
/* Get the pointer to the node to delete */
found=H5ST_find(tree,rand_uniq_words[u]);
- CHECK(found, NULL, "H5ST_find");
+ CHECK_PTR(found, "H5ST_find");
/* Check that the correct object will be removed from TST */
if(HDstrcmp((const char *)found->eqkid,rand_uniq_words[u]))
diff --git a/test/tunicode.c b/test/tunicode.c
index 85f5af0..6f7431b 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -163,8 +163,8 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string, each with a
* terminating NULL. It will look like "abcdefg\0abcdefg\0". */
- strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
@@ -226,8 +226,8 @@ void test_strpad(hid_t H5_ATTR_UNUSED fid, const char *string)
/* Fill the buffer with two copies of the UTF-8 string.
* It will look like "abcdefghabcdefgh". */
- strncpy(buf, new_string, big_len);
- strncpy(&buf[big_len], new_string, big_len);
+ HDstrncpy(buf, new_string, big_len);
+ HDstrncpy(&buf[big_len], new_string, big_len);
ret = H5Tconvert(src_type, dst_type, (size_t)2, buf, NULL, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tconvert");
@@ -352,8 +352,8 @@ void test_vl_string(hid_t fid, const char *string)
VERIFY(HDstrcmp(string, read_buf[0]), 0, "strcmp");
/* Reclaim the read VL data */
- ret = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(type_id, space_id, H5P_DEFAULT, read_buf);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close all */
ret = H5Dclose(dset_id);
@@ -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.
@@ -854,7 +854,7 @@ void test_unicode(void)
*/
void cleanup_unicode(void)
{
- remove(FILENAME);
+ HDremove(FILENAME);
}
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 7b520f2..b93d646 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: tvlstr
+* Test program: tvlstr
*
* Test the Variable-Length String functionality
*
@@ -21,16 +21,18 @@
#include "testhdf5.h"
-#include "hdf5.h"
-
#define DATAFILE "tvlstr.h5"
#define DATAFILE2 "tvlstr2.h5"
+#define DATAFILE3 "sel2el.h5"
+
+#define DATASET "1Darray"
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 4
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 4
+#define NUMP 4
-#define VLSTR_TYPE "vl_string_type"
+#define VLSTR_TYPE "vl_string_type"
/* Definitions for the VL re-writing test */
#define REWRITE_NDATASETS 32
@@ -92,7 +94,7 @@ void test_vlstr_free_custom(void *_mem, void *info)
if(_mem!=NULL) {
mem=((unsigned char *)_mem)-extra;
- *mem_used-=*(size_t *)mem;
+ *mem_used-=*(size_t *)((void *)mem);
HDfree(mem);
} /* end if */
}
@@ -115,17 +117,17 @@ test_vlstrings_basic(void)
char *rdata[SPACE1_DIM1]; /* Information read in */
char *wdata2;
hid_t dataspace, dataset2;
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i; /* counting variable */
size_t str_used; /* String data in memory */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic VL String Functionality\n"));
@@ -181,7 +183,7 @@ test_vlstrings_basic(void)
/* Count the actual number of bytes used by the strings */
for(i=0,str_used=0; i<SPACE1_DIM1; i++)
- str_used+=HDstrlen(wdata[i])+1;
+ str_used += HDstrlen(wdata[i])+1;
/* Compare against the strings actually written */
VERIFY(size,(hsize_t)str_used,"H5Dvlen_get_buf_size");
@@ -196,7 +198,7 @@ test_vlstrings_basic(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
@@ -206,11 +208,11 @@ test_vlstrings_basic(void)
} /* end for */
/* Reclaim the read VL data */
- ret = H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -247,14 +249,14 @@ test_vlstrings_special(void)
const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL};
char *rdata[SPACE1_DIM1]; /* Information read in */
char *fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hid_t dcpl; /* Dataset creation property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hid_t dcpl; /* Dataset creation property list ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Special VL Strings\n"));
@@ -298,7 +300,7 @@ test_vlstrings_special(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
@@ -312,8 +314,8 @@ test_vlstrings_special(void)
} /* end for */
/* Reclaim the read VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -477,14 +479,14 @@ test_compact_vlstring(void)
{
const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"};
char *rdata[SPACE1_DIM1]; /* Information read in */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hid_t plist; /* Dataset creation property list */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hid_t plist; /* Dataset creation property list */
+ hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL Strings in compact dataset\n"));
@@ -525,7 +527,7 @@ test_compact_vlstring(void)
/* Compare data read in */
for(i = 0; i < SPACE1_DIM1; i++) {
if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
- TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
+ TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)HDstrlen(rdata[i]));
continue;
} /* end if */
if(HDstrcmp(wdata[i], rdata[i]) != 0) {
@@ -535,8 +537,8 @@ test_compact_vlstring(void)
} /* end for */
/* Reclaim the read VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -760,8 +762,8 @@ static void read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, ch
if(HDstrcmp(data, data_read))
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &data_read);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read);
+ CHECK(ret, FAIL, "H5Treclaim");
}
/****************************************************************
@@ -800,33 +802,33 @@ static void test_vl_rewrite(void)
/* Create in file 1 */
for(i=0; i<REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
write_scalar_dset(file1, type, space, name, name);
}
/* Effectively copy data from file 1 to 2 */
for(i=0; i<REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
}
/* Read back from file 2 */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file2, type, space, name, name);
} /* end for */
/* Remove from file 2. */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
ret = H5Ldelete(file2, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
} /* end for */
/* Effectively copy from file 1 to file 2 */
for(i = 0; i < REWRITE_NDATASETS; i++) {
- sprintf(name, "/set_%d", i);
+ HDsprintf(name, "/set_%d", i);
read_scalar_dset(file1, type, space, name, name);
write_scalar_dset(file2, type, space, name, name);
} /* end for */
@@ -848,6 +850,100 @@ static void test_vl_rewrite(void)
} /* end test_vl_rewrite() */
/****************************************************************
+ **
+ ** test_write_same_element():
+ ** Tests writing to the same element of VL string using
+ ** H5Sselect_element.
+ **
+ ****************************************************************/
+static void test_write_same_element(void)
+{
+ hid_t file1, dataset1;
+ hid_t mspace, fspace, dtype;
+ hsize_t fdim[] = {SPACE1_DIM1};
+ const char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
+ const char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
+ hsize_t marray[] = {NUMP};
+ hsize_t coord[SPACE1_RANK][NUMP];
+ herr_t ret;
+
+ file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(file1, FAIL, "H5Fcreate");
+
+ dtype = H5Tcopy(H5T_C_S1);
+ CHECK(dtype, FAIL, "H5Tcopy");
+
+ ret = H5Tset_size(dtype, H5T_VARIABLE);
+ CHECK(ret, FAIL, "H5Tset_size");
+
+ fspace = H5Screate_simple(SPACE1_RANK, fdim, NULL);
+ CHECK(fspace, FAIL, "H5Screate_simple");
+
+ dataset1 = H5Dcreate2(file1, DATASET, dtype, fspace, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset1, FAIL, "H5Dcreate");
+
+ ret = H5Dwrite(dataset1, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Dclose(dataset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Sclose(fspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Fclose(file1);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /*
+ * Open the file. Select the same points, write values to those point locations.
+ */
+ file1 = H5Fopen(DATAFILE3, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(file1, FAIL, "H5Fopen");
+
+ dataset1 = H5Dopen2(file1, DATASET, H5P_DEFAULT);
+ CHECK(dataset1, FAIL, "H5Dopen");
+
+ fspace = H5Dget_space(dataset1);
+ CHECK(fspace, FAIL, "H5Dget_space");
+
+ dtype = H5Dget_type(dataset1);
+ CHECK(dtype, FAIL, "H5Dget_type");
+
+ mspace = H5Screate_simple(1, marray, NULL);
+ CHECK(mspace, FAIL, "H5Screate_simple");
+
+ coord[0][0] = 0;
+ coord[0][1] = 2;
+ coord[0][2] = 2;
+ coord[0][3] = 0;
+
+ ret = H5Sselect_elements(fspace, H5S_SELECT_SET, NUMP, (const hsize_t *)&coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ ret = H5Dwrite(dataset1, dtype, mspace, fspace, H5P_DEFAULT, val);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ ret = H5Tclose(dtype);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Dclose(dataset1);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Sclose(fspace);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Sclose(mspace);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Fclose(file1);
+ CHECK(ret, FAIL, "H5Fclose");
+} /* test_write_same_element */
+
+/****************************************************************
**
** test_vlstrings(): Main VL string testing routine.
**
@@ -871,17 +967,18 @@ test_vlstrings(void)
/* Test writing VL datasets in files with lots of unlinking */
test_vl_rewrite();
+ /* Test writing to the same element more than once using H5Sselect_elements */
+ test_write_same_element();
} /* test_vlstrings() */
-
/*-------------------------------------------------------------------------
- * Function: cleanup_vlstrings
+ * Function: cleanup_vlstrings
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* September 10, 1999
*
* Modifications:
@@ -893,5 +990,6 @@ cleanup_vlstrings(void)
{
HDremove(DATAFILE);
HDremove(DATAFILE2);
+ HDremove(DATAFILE3);
}
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 5121a66..e8c69b4 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -13,7 +13,7 @@
/***********************************************************
*
-* Test program: tvltypes
+* Test program: tvltypes
*
* Test the Variable-Length Datatype functionality
*
@@ -21,24 +21,23 @@
#include "testhdf5.h"
-#include "hdf5.h"
#include "H5Dprivate.h"
#define FILENAME "tvltypes.h5"
/* 1-D dataset with fixed dimensions */
-#define SPACE1_RANK 1
+#define SPACE1_RANK 1
#define SPACE1_DIM1 4
/* 1-D dataset with fixed dimensions */
-#define SPACE3_RANK 1
+#define SPACE3_RANK 1
#define SPACE3_DIM1 128
#define L1_INCM 16
#define L2_INCM 8
#define L3_INCM 3
/* 1-D dataset with fixed dimensions */
-#define SPACE4_RANK 1
+#define SPACE4_RANK 1
#define SPACE4_DIM_SMALL 128
#define SPACE4_DIM_LARGE (H5D_TEMP_BUF_SIZE / 64)
@@ -89,7 +88,7 @@ void test_vltypes_free_custom(void *_mem, void *mem_used)
*/
unsigned char *mem = ((unsigned char *)_mem) - extra; /* Pointer to actual block allocated */
- *(size_t *)mem_used -= *(size_t *)mem;
+ *(size_t *)mem_used -= *(size_t *)((void *)mem);
HDfree(mem);
} /* end if */
}
@@ -104,7 +103,7 @@ static void
test_vltypes_dataset_create(void)
{
hid_t fid1; /* HDF5 File IDs */
- hid_t dcpl; /* Dataset Property list */
+ hid_t dcpl; /* Dataset Property list */
hid_t dataset; /* Dataset ID */
hsize_t dims1[] = {SPACE1_DIM1};
hid_t sid1; /* Dataspace ID */
@@ -136,7 +135,7 @@ test_vltypes_dataset_create(void)
/* Create a dataset, supposed to fail */
H5E_BEGIN_TRY {
- dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
VERIFY(dataset, FAIL, "H5Dcreate2");
@@ -230,18 +229,18 @@ test_vltypes_vlen_atomic(void)
hvl_t wdata2[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
hvl_t fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
hid_t sid2; /* ID of bad dataspace (no extent set) */
- hid_t tid1; /* Datatype ID */
+ hid_t tid1; /* Datatype ID */
hid_t dcpl_pid; /* Dataset creation property list ID */
hid_t xfer_pid; /* Dataset transfer property list ID */
hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Atomic VL Datatype Functionality\n"));
@@ -416,11 +415,11 @@ test_vltypes_vlen_atomic(void)
} /* end for */
/* Reclaim the read VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, xfer_pid, rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid1, sid1, xfer_pid, rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used, 0, "H5Dvlen_reclaim");
+ VERIFY(mem_used, 0, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -466,15 +465,15 @@ test_vltypes_vlen_atomic(void)
ret = H5Dvlen_get_buf_size(dataset, tid1, sid1, &size);
CHECK(ret, FAIL, "H5Dvlen_get_buf_size");
+ /* 10 elements allocated = 1 + 2 + 3 + 4 elements for each array position */
+ VERIFY(size,((SPACE1_DIM1*(SPACE1_DIM1+1))/2)*sizeof(unsigned int),"H5Dvlen_get_buf_size");
+
/* Try to call H5Dvlen_get_buf with bad dataspace */
H5E_BEGIN_TRY {
- ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
+ ret = H5Dvlen_get_buf_size(dataset, tid1, sid2, &size);
} H5E_END_TRY
VERIFY(ret, FAIL, "H5Dvlen_get_buf_size");
- /* 10 elements allocated = 1 + 2 + 3 + 4 elements for each array position */
- VERIFY(size,((SPACE1_DIM1*(SPACE1_DIM1+1))/2)*sizeof(unsigned int),"H5Dvlen_get_buf_size");
-
/* Read dataset from disk */
ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,xfer_pid,rdata);
CHECK(ret, FAIL, "H5Dread");
@@ -500,24 +499,24 @@ test_vltypes_vlen_atomic(void)
/* Try to reclaim read data using "bad" dataspace with no extent
* Should fail */
H5E_BEGIN_TRY {
- ret=H5Dvlen_reclaim(tid1,sid2,xfer_pid,rdata);
+ ret=H5Treclaim(tid1,sid2,xfer_pid,rdata);
} H5E_END_TRY
- VERIFY(ret, FAIL, "H5Dvlen_reclaim");
+ VERIFY(ret, FAIL, "H5Treclaim");
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close datatype */
ret = H5Tclose(tid1);
@@ -556,7 +555,7 @@ rewrite_vltypes_vlen_atomic(void)
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=4;
+ unsigned increment=4;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -660,15 +659,15 @@ rewrite_vltypes_vlen_atomic(void)
} /* end for */
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -709,16 +708,16 @@ test_vltypes_vlen_compound(void)
} s1;
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2; /* Datatype IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Compound VL Datatype Functionality\n"));
@@ -804,15 +803,15 @@ test_vltypes_vlen_compound(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -863,7 +862,7 @@ rewrite_vltypes_vlen_compound(void)
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=4;
+ unsigned increment=4;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -949,15 +948,15 @@ rewrite_vltypes_vlen_compound(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid1,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1001,23 +1000,23 @@ test_vltypes_compound_vlen_vlen(void)
} s1;
s1 *wdata; /* data to write */
s1 *rdata; /* data to read */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2, tid3; /* Datatype IDs */
- hsize_t dims1[] = {SPACE3_DIM1};
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2, tid3; /* Datatype IDs */
+ hsize_t dims1[] = {SPACE3_DIM1};
unsigned i,j,k; /* counting variables */
hvl_t *t1, *t2; /* Temporary pointer to VL information */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n"));
/* Allocate and initialize VL data to write */
wdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1);
- CHECK(wdata, NULL, "HDmalloc");
+ CHECK_PTR(wdata, "HDmalloc");
rdata = (s1 *)HDmalloc(sizeof(s1) * SPACE3_DIM1);
- CHECK(rdata, NULL, "HDmalloc");
+ CHECK_PTR(rdata, "HDmalloc");
for(i = 0; i < SPACE3_DIM1; i++) {
wdata[i].i = (int)(i * 10);
wdata[i].f = (float)(i * 20) / 3.0F;
@@ -1119,12 +1118,12 @@ test_vltypes_compound_vlen_vlen(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1182,21 +1181,21 @@ test_vltypes_compound_vlstr(void)
s1 wdata2[SPACE1_DIM1]; /* data to write */
s1 rdata[SPACE1_DIM1]; /* data to read */
s1 rdata2[SPACE1_DIM1]; /* data to read */
- char str[64] = "a\0";
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset, dset2; /* Dataset ID */
- hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */
- hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */
- hid_t cparms;
- hsize_t dims1[] = {SPACE1_DIM1};
- hsize_t chunk_dims[] = {SPACE1_DIM1/2};
- hsize_t maxdims[] = {H5S_UNLIMITED};
- hsize_t size[] = {SPACE1_DIM1};
- hsize_t offset[] = {0};
+ char str[64] = "a\0";
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset, dset2; /* Dataset ID */
+ hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */
+ hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */
+ hid_t cparms;
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t chunk_dims[] = {SPACE1_DIM1/2};
+ hsize_t maxdims[] = {H5S_UNLIMITED};
+ hsize_t size[] = {SPACE1_DIM1};
+ hsize_t offset[] = {0};
unsigned i,j; /* counting variables */
s2 *t1, *t2; /* Temporary pointer to VL information */
- int val;
- herr_t ret; /* Generic return value */
+ int val;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL Datatype of Compound Datatype with VL String Functionality\n"));
@@ -1206,9 +1205,9 @@ test_vltypes_compound_vlstr(void)
wdata[i].v.p=(s2*)HDmalloc((i+L3_INCM)*sizeof(s2));
wdata[i].v.len=i+L3_INCM;
for(t1=(s2 *)((wdata[i].v).p), j=0; j<(i+L3_INCM); j++, t1++) {
- strcat(str, "m");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
+ HDstrcat(str, "m");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
/*t1->color = red;*/
t1->color = blue;
}
@@ -1349,7 +1348,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata[i].v.p), t2=(s2 *)(rdata[i].v.p), j=0; j<rdata[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if(HDstrcmp(t1->string, t2->string)) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
@@ -1361,23 +1360,23 @@ test_vltypes_compound_vlstr(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Use this part for new data */
- strcpy(str, "bbbbbbbb\0");
+ HDstrcpy(str, "bbbbbbbb\0");
for(i=0; i<SPACE1_DIM1; i++) {
wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2));
wdata2[i].v.len=i+1;
for(t1=(s2*)(wdata2[i].v).p, j=0; j<i+1; j++, t1++) {
- strcat(str, "pp");
- t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1);
- strcpy(t1->string, str);
- t1->color = green;
+ HDstrcat(str, "pp");
+ t1->string = (char*)HDmalloc(HDstrlen(str)*sizeof(char)+1);
+ HDstrcpy(t1->string, str);
+ t1->color = green;
}
} /* end for */
@@ -1407,7 +1406,7 @@ test_vltypes_compound_vlstr(void)
} /* end if */
for(t1=(s2 *)(wdata2[i].v.p), t2=(s2 *)(rdata2[i].v.p), j=0; j<rdata2[i].v.len; j++, t1++, t2++) {
- if( strcmp(t1->string, t2->string) ) {
+ if(HDstrcmp(t1->string, t2->string)) {
TestErrPrintf("VL data values don't match!, t1->string=%s, t2->string=%s\n",t1->string, t2->string);
continue;
} /* end if */
@@ -1419,12 +1418,12 @@ test_vltypes_compound_vlstr(void)
} /* end for */
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata2);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata2);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,rdata2);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,rdata2);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Dclose(dset2);
CHECK(ret, FAIL, "H5Dclose");
@@ -1467,17 +1466,17 @@ test_vltypes_compound_vlen_atomic(void)
s1 wdata[SPACE1_DIM1]; /* Information to write */
s1 rdata[SPACE1_DIM1]; /* Information read in */
s1 fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2; /* Datatype IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
hid_t dcpl_pid; /* Dataset creation property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n"));
@@ -1569,11 +1568,11 @@ test_vltypes_compound_vlen_atomic(void)
} /* end for */
/* Reclaim the VL data */
- ret = H5Dvlen_reclaim(tid2, sid1, xfer_pid, rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(tid2, sid1, xfer_pid, rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used, 0, "H5Dvlen_reclaim");
+ VERIFY(mem_used, 0, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1635,16 +1634,16 @@ test_vltypes_compound_vlen_atomic(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close datatype */
ret = H5Tclose(tid2);
@@ -1671,9 +1670,9 @@ test_vltypes_compound_vlen_atomic(void)
/****************************************************************
**
** rewrite_vltypes_compound_vlen_atomic(): Check memory leak for
-** basic VL datatype code.
+** basic VL datatype code.
** Check memory leak for compound datatypes with VL datatypes
-** of atomic datatypes.
+** of atomic datatypes.
**
****************************************************************/
static void
@@ -1694,7 +1693,7 @@ rewrite_vltypes_compound_vlen_atomic(void)
hsize_t size; /* Number of bytes which will be used */
unsigned i,j; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=4;
+ unsigned increment=4;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1787,15 +1786,15 @@ rewrite_vltypes_compound_vlen_atomic(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1855,16 +1854,16 @@ test_vltypes_vlen_vlen_atomic(void)
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
hvl_t *t1, *t2; /* Temporary pointer to VL information */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, tid2; /* Datatype IDs */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t dims1[] = {SPACE1_DIM1};
hsize_t size; /* Number of bytes which will be used */
unsigned i,j,k; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing VL Datatypes with VL Atomic Datatype Component Functionality\n"));
@@ -1998,15 +1997,15 @@ test_vltypes_vlen_vlen_atomic(void)
} /* end for */
/* Reclaim all the (nested) VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -2049,12 +2048,12 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void)
hid_t fid1; /* HDF5 File IDs */
hid_t dataset; /* Dataset ID */
hid_t sid1; /* Dataspace ID */
- hid_t tid2; /* Datatype IDs */
+ hid_t tid2; /* Datatype IDs */
hid_t xfer_pid; /* Dataset transfer property list ID */
hsize_t size; /* Number of bytes which will be used */
unsigned i,j,k; /* counting variables */
size_t mem_used=0; /* Memory used during allocation */
- unsigned increment=1;
+ unsigned increment=1;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -2178,15 +2177,15 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void)
} /* end for */
/* Reclaim all the (nested) VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -2354,15 +2353,15 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void)
} /* end for */
/* Reclaim all the (nested) VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,xfer_pid,rdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,xfer_pid,rdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used,0,"H5Treclaim");
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret=H5Treclaim(tid2,sid1,H5P_DEFAULT,wdata);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -2399,17 +2398,17 @@ test_vltypes_fill_value(void)
typedef struct dtype1_struct {
unsigned int gui;
unsigned int pgui;
- char *str_id;
- char *str_name;
- char *str_desc;
- char *str_orig;
- char *str_stat;
+ const char *str_id;
+ const char *str_name;
+ const char *str_desc;
+ const char *str_orig;
+ const char *str_stat;
unsigned int ver;
double val;
double ma;
double mi;
- char *str_form;
- char *str_unit;
+ const char *str_form;
+ const char *str_unit;
} dtype1_struct;
herr_t ret;
@@ -2503,7 +2502,7 @@ test_vltypes_fill_value(void)
/* Allocate space for the buffer to read data */
rbuf = (dtype1_struct *)HDmalloc(SPACE4_DIM_LARGE * sizeof(dtype1_struct));
- CHECK(rbuf, NULL, "HDmalloc");
+ CHECK_PTR(rbuf, "HDmalloc");
/* Create the small & large dataspaces to use */
@@ -2544,7 +2543,7 @@ test_vltypes_fill_value(void)
CHECK(file_id, FAIL, "H5Fcreate");
/* Create datasets with different storage layouts */
- for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) {
+ for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) {
unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */
unsigned test_loop; /* Loop over datasets */
@@ -2660,7 +2659,7 @@ test_vltypes_fill_value(void)
CHECK(file_id, FAIL, "H5Fopen");
/* Read empty datasets with different storage layouts */
- for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) {
+ for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) {
unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */
unsigned test_loop; /* Loop over datasets */
@@ -2744,8 +2743,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
@@ -2779,8 +2778,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
@@ -2809,8 +2808,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
@@ -2844,8 +2843,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_select_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_select_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
@@ -2861,7 +2860,7 @@ test_vltypes_fill_value(void)
CHECK(file_id, FAIL, "H5Fopen");
/* Write one element & fill values to datasets with different storage layouts */
- for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; H5_INC_ENUM(H5D_layout_t, layout)) {
+ for(layout = H5D_COMPACT; layout <= H5D_CHUNKED; layout++) {
unsigned compress_loop; /* # of times to run loop, for testing compressed chunked dataset */
unsigned test_loop; /* Loop over datasets */
@@ -2971,8 +2970,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
@@ -3020,8 +3019,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_select_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_select_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
@@ -3067,8 +3066,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
/* Clear the read buffer */
HDmemset(rbuf, 0, dset_elmts * sizeof(dtype1_struct));
@@ -3116,8 +3115,8 @@ test_vltypes_fill_value(void)
} /* end for */
/* Release the space */
- ret = H5Dvlen_reclaim(dtype1_id, dset_select_dspace_id, xfer_pid, rbuf);
- CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ ret = H5Treclaim(dtype1_id, dset_select_dspace_id, xfer_pid, rbuf);
+ CHECK(ret, FAIL, "H5Treclaim");
ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
@@ -3171,15 +3170,15 @@ test_vltypes(void)
/* These next tests use the same file */
test_vltypes_dataset_create(); /* Check dataset of VL when fill value
- * won't be rewritten to it.*/
+ * won't be rewritten to it.*/
test_vltypes_funcs(); /* Test functions with VL types */
test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */
- rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */
+ rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */
test_vltypes_vlen_compound(); /* Test VL compound datatypes */
- rewrite_vltypes_vlen_compound(); /* Check VL memory leak */
+ rewrite_vltypes_vlen_compound(); /* Check VL memory leak */
test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */
- rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */
- test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */
+ rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */
+ test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */
rewrite_longer_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of longer sequence*/
rewrite_shorter_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of shorted sequence*/
test_vltypes_compound_vlen_vlen();/* Test compound datatypes with VL atomic components */
@@ -3187,15 +3186,15 @@ test_vltypes(void)
test_vltypes_fill_value(); /* Test fill value for VL data */
} /* test_vltypes() */
-
+
/*-------------------------------------------------------------------------
- * Function: cleanup_vltypes
+ * Function: cleanup_vltypes
*
- * Purpose: Cleanup temporary test files
+ * Purpose: Cleanup temporary test files
*
- * Return: none
+ * Return: none
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* June 8, 1999
*
* Modifications:
diff --git a/test/twriteorder.c b/test/twriteorder.c
index 4c86636..04f3bc5 100644
--- a/test/twriteorder.c
+++ b/test/twriteorder.c
@@ -25,7 +25,6 @@
* get the same data the write has written.
*
* Created: Albert Cheng, 2013/8/28.
-* Modified:
*************************************************************/
/***********************************************************
@@ -69,18 +68,18 @@
#ifdef H5_HAVE_FORK
#define DATAFILE "twriteorder.dat"
-/* #define READERS_MAX 10 */ /* max number of readers */
-#define BLOCKSIZE_DFT 1024 /* 1KB */
-#define PARTITION_DFT 2048 /* 2KB */
-#define NLINKEDBLOCKS_DFT 512 /* default 512 */
-#define SIZE_BLKADDR 4 /* expected sizeof blkaddr */
-#define Hgoto_error(val) {ret_value=val; goto done;}
+/* #define READERS_MAX 10 */ /* max number of readers */
+#define BLOCKSIZE_DFT 1024 /* 1KB */
+#define PARTITION_DFT 2048 /* 2KB */
+#define NLINKEDBLOCKS_DFT 512 /* default 512 */
+#define SIZE_BLKADDR 4 /* expected sizeof blkaddr */
+#define Hgoto_error(val) {ret_value=val; goto done;}
/* type declarations */
typedef enum part_t {
- UC_READWRITE =0, /* both writer and reader */
- UC_WRITER, /* writer only */
- UC_READER /* reader only */
+ UC_READWRITE = 0, /* both writer and reader */
+ UC_WRITER, /* writer only */
+ UC_READER /* reader only */
} part_t;
/* prototypes */
@@ -92,9 +91,9 @@ int setup_parameters(int argc, char * const argv[]);
int parse_option(int argc, char * const argv[]);
/* Global Variable definitions */
-const char *progname_g="twriteorder"; /* program name */
-int write_fd_g;
-int blocksize_g, part_size_g, nlinkedblock_g;
+const char *progname_g="twriteorder"; /* program name */
+int write_fd_g;
+int blocksize_g, part_size_g, nlinkedblock_g;
part_t launch_g;
/* Function definitions */
@@ -103,15 +102,15 @@ part_t launch_g;
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, " -l w|r launch writer or reader only. [default: launch both]\n");
- fprintf(stderr, " -b N Block size [default: %d]\n", BLOCKSIZE_DFT);
- fprintf(stderr, " -p N Partition size [default: %d]\n", PARTITION_DFT);
- fprintf(stderr, " -n N Number of linked blocks [default: %d]\n", NLINKEDBLOCKS_DFT);
- fprintf(stderr, " where N is an integer value\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, " -l w|r launch writer or reader only. [default: launch both]\n");
+ HDfprintf(stderr, " -b N Block size [default: %d]\n", BLOCKSIZE_DFT);
+ HDfprintf(stderr, " -p N Partition size [default: %d]\n", PARTITION_DFT);
+ HDfprintf(stderr, " -n N Number of linked blocks [default: %d]\n", NLINKEDBLOCKS_DFT);
+ HDfprintf(stderr, " where N is an integer value\n");
+ HDfprintf(stderr, "\n");
}
/* Setup test parameters by parsing command line options.
@@ -127,73 +126,73 @@ parse_option(int argc, char * const argv[])
/* suppress getopt from printing error */
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 'b': /* number of planes to write/read */
- if ((blocksize_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'n': /* number of planes to write/read */
- if ((nlinkedblock_g = atoi(optarg)) < 2){
- fprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg);
- usage(progname_g);
- Hgoto_error(-1);
- };
- break;
- case 'p': /* number of planes to write/read */
- if ((part_size_g = atoi(optarg)) <= 0){
- fprintf(stderr, "bad partition size %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 */
- launch_g = UC_READER;
- break;
- case 'w': /* writer only */
- launch_g = UC_WRITER;
- break;
- default:
- fprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
- usage(progname_g);
- Hgoto_error(-1);
- break;
- }
- printf("launch = %d\n", launch_g);
- break;
- case '?':
- fprintf(stderr, "getopt returned '%c'.\n", c);
- usage(progname_g);
- Hgoto_error(-1);
- default:
- fprintf(stderr, "getopt returned unexpected value.\n");
- fprintf(stderr, "Unexpected value is %d\n", c);
- Hgoto_error(-1);
- }
- }
+ while (1) {
+ c = getopt (argc, argv, cmd_options);
+ if (-1 == c)
+ break;
+
+ switch (c) {
+ case 'h':
+ usage(progname_g);
+ HDexit(EXIT_SUCCESS);
+ break;
+ case 'b': /* number of planes to write/read */
+ if ((blocksize_g = atoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad blocksize %s, must be a positive integer\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'n': /* number of planes to write/read */
+ if ((nlinkedblock_g = atoi(optarg)) < 2) {
+ HDfprintf(stderr, "bad number of linked blocks %s, must be greater than 1.\n", optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ };
+ break;
+ case 'p': /* number of planes to write/read */
+ if ((part_size_g = atoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad partition size %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 */
+ launch_g = UC_READER;
+ break;
+ case 'w': /* writer only */
+ launch_g = UC_WRITER;
+ break;
+ default:
+ HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
+ usage(progname_g);
+ Hgoto_error(-1);
+ break;
+ } /* end inner switch */
+ HDprintf("launch = %d\n", launch_g);
+ break;
+ case '?':
+ HDfprintf(stderr, "getopt returned '%c'.\n", c);
+ usage(progname_g);
+ Hgoto_error(-1);
+ default:
+ HDfprintf(stderr, "getopt returned unexpected value.\n");
+ HDfprintf(stderr, "Unexpected value is %d\n", c);
+ Hgoto_error(-1);
+ } /* end outer switch */
+ } /* end while */
/* verify partition size must be >= blocksize */
if (part_size_g < blocksize_g ){
- fprintf(stderr, "Blocksize %d should not be bigger than partition size %d\n",
- blocksize_g, part_size_g);
- Hgoto_error(-1);
+ HDfprintf(stderr, "Blocksize %d should not be bigger than partition size %d\n", blocksize_g, part_size_g);
+ Hgoto_error(-1);
}
done:
/* All done. */
- return(ret_value);
+ return ret_value;
}
/* Setup parameters for the test case.
@@ -209,15 +208,16 @@ int setup_parameters(int argc, char * const argv[])
/* parse options */
if (parse_option(argc, argv) < 0){
- return(-1);
+ return -1;
}
/* show parameters and return */
- printf("blocksize = %ld\n", (long)blocksize_g);
- printf("part_size = %ld\n", (long)part_size_g);
- printf("nlinkedblock = %ld\n", (long)nlinkedblock_g);
- printf("launch = %d\n", launch_g);
- return(0);
+ HDprintf("blocksize = %ld\n", (long)blocksize_g);
+ HDprintf("part_size = %ld\n", (long)part_size_g);
+ HDprintf("nlinkedblock = %ld\n", (long)nlinkedblock_g);
+ HDprintf("launch = %d\n", launch_g);
+
+ return 0;
}
/* Create the test file with initial "empty" file, that is,
@@ -227,19 +227,19 @@ int setup_parameters(int argc, char * const argv[])
*/
int create_wo_file(void)
{
- int blkaddr=0; /* blkaddress of next linked block */
- int ret_code;
+ int blkaddr = 0; /* blkaddress of next linked block */
+ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
/* Create the data file */
if ((write_fd_g = HDopen(DATAFILE, O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) {
HDprintf("WRITER: error from open\n");
return -1;
}
- blkaddr=0;
+ blkaddr = 0;
/* write it to partition 0 */
- if ((ret_code=HDwrite(write_fd_g, &blkaddr, (size_t)SIZE_BLKADDR)) != SIZE_BLKADDR){
- printf("blkaddr write failed\n");
- return -1;
+ if ((bytes_wrote = HDwrite(write_fd_g, &blkaddr, (size_t)SIZE_BLKADDR)) != SIZE_BLKADDR){
+ HDprintf("blkaddr write failed\n");
+ return -1;
}
/* File initialized, return success */
@@ -252,38 +252,45 @@ int write_wo_file(void)
int blkaddr_old=0;
int i;
char buffer[BLOCKSIZE_DFT];
- int ret_code;
-
+ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */
+
/* write block 1, 2, ... */
- for (i=1; i<nlinkedblock_g; i++){
- /* calculate where to write this block */
- blkaddr = i*part_size_g + i;
- /* store old block address in byte 0-3 */
- HDmemcpy(&buffer[0], &blkaddr_old, sizeof(blkaddr_old));
- /* fill the rest with the lowest byte of i */
- HDmemset(&buffer[4], i & 0xff, (size_t) (BLOCKSIZE_DFT-4));
- /* write the block */
+ for (i = 1; i < nlinkedblock_g; i++) {
+
+ /* calculate where to write this block */
+ blkaddr = i * part_size_g + i;
+
+ /* store old block address in byte 0-3 */
+ HDmemcpy(&buffer[0], &blkaddr_old, sizeof(blkaddr_old));
+
+ /* fill the rest with the lowest byte of i */
+ HDmemset(&buffer[4], i & 0xff, (size_t) (BLOCKSIZE_DFT-4));
+
+ /* write the block */
#ifdef DEBUG
- printf("writing block at %d\n", blkaddr);
+ HDprintf("writing block at %d\n", blkaddr);
#endif
- HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET);
- if ((ret_code=HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g){
- printf("blkaddr write failed in partition %d\n", i);
- return -1;
- }
- blkaddr_old = blkaddr;
- }
+ HDlseek(write_fd_g, (HDoff_t)blkaddr, SEEK_SET);
+ if ((bytes_wrote = HDwrite(write_fd_g, buffer, (size_t)blocksize_g)) != blocksize_g){
+ HDprintf("blkaddr write failed in partition %d\n", i);
+ return -1;
+ }
+
+ blkaddr_old = blkaddr;
+
+ } /* end for */
+
/* write the last blkaddr in partition 0 */
HDlseek(write_fd_g, (HDoff_t)0, SEEK_SET);
- if ((ret_code=HDwrite(write_fd_g, &blkaddr_old, (size_t)sizeof(blkaddr_old))) != sizeof(blkaddr_old)){
- printf("blkaddr write failed in partition %d\n", 0);
- return -1;
+ if ((bytes_wrote = HDwrite(write_fd_g, &blkaddr_old, (size_t)sizeof(blkaddr_old))) != sizeof(blkaddr_old)){
+ HDprintf("blkaddr write failed in partition %d\n", 0);
+ return -1;
}
/* all writes done. return succeess. */
#ifdef DEBUG
- printf("wrote %d blocks\n", nlinkedblock_g);
+ HDprintf("wrote %d blocks\n", nlinkedblock_g);
#endif
return 0;
}
@@ -291,9 +298,9 @@ int write_wo_file(void)
int read_wo_file(void)
{
int read_fd;
- int blkaddr=0;
- int ret_code;
- int linkedblocks_read=0;
+ int blkaddr = 0;
+ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */
+ int linkedblocks_read = 0;
char buffer[BLOCKSIZE_DFT];
/* Open the data file */
@@ -301,42 +308,44 @@ int read_wo_file(void)
HDprintf("READER: error from open\n");
return -1;
}
+
/* keep reading the initial block address until it is non-zero before proceeding. */
- while (blkaddr == 0){
- HDlseek(read_fd, (HDoff_t)0, SEEK_SET);
- if ((ret_code=HDread(read_fd, &blkaddr, (size_t)sizeof(blkaddr))) != sizeof(blkaddr)){
- printf("blkaddr read failed in partition %d\n", 0);
- return -1;
- }
+ while (blkaddr == 0) {
+ HDlseek(read_fd, (HDoff_t)0, SEEK_SET);
+ if ((bytes_read = HDread(read_fd, &blkaddr, (size_t)sizeof(blkaddr))) != sizeof(blkaddr)) {
+ HDprintf("blkaddr read failed in partition %d\n", 0);
+ return -1;
+ }
}
linkedblocks_read++;
/* got a non-zero blkaddr. Proceed down the linked blocks. */
#ifdef DEBUG
- printf("got initial block address=%d\n", blkaddr);
+ HDprintf("got initial block address=%d\n", blkaddr);
#endif
- while (blkaddr != 0){
- HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET);
- if ((ret_code=HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g){
- printf("blkaddr read failed in partition %d\n", 0);
- return -1;
- }
- linkedblocks_read++;
- /* retrieve the block address in byte 0-3 */
- HDmemcpy(&blkaddr, &buffer[0], sizeof(blkaddr));
+ while (blkaddr != 0) {
+ HDlseek(read_fd, (HDoff_t)blkaddr, SEEK_SET);
+ if ((bytes_read = HDread(read_fd, buffer, (size_t)blocksize_g)) != blocksize_g){
+ HDprintf("blkaddr read failed in partition %d\n", 0);
+ return -1;
+ }
+ linkedblocks_read++;
+
+ /* retrieve the block address in byte 0-3 */
+ HDmemcpy(&blkaddr, &buffer[0], sizeof(blkaddr));
#ifdef DEBUG
- printf("got next block address=%d\n", blkaddr);
+ HDprintf("got next block address=%d\n", blkaddr);
#endif
}
#ifdef DEBUG
- printf("read %d blocks\n", linkedblocks_read);
+ HDprintf("read %d blocks\n", linkedblocks_read);
#endif
return 0;
}
-/* Overall Algorithm:
+/* Overall Algorithm:
* Parse options from user;
* Generate/pre-created the test file needed and close it;
* fork: child processes become the reader processes;
@@ -351,13 +360,13 @@ main(int argc, char *argv[])
pid_t childpid=0;
int child_ret_value;
pid_t mypid, tmppid;
- int child_status;
+ int child_status;
int child_wait_option=0;
int ret_value = 0;
/* initialization */
if (setup_parameters(argc, argv) < 0){
- Hgoto_error(1);
+ Hgoto_error(1);
}
/* ==============================================================*/
@@ -368,41 +377,43 @@ main(int argc, char *argv[])
/* ============*/
/* Create file */
/* ============*/
- if (launch_g != UC_READER){
- printf("Creating skeleton data file for test...\n");
- if (create_wo_file() < 0){
- fprintf(stderr, "***encounter error\n");
- Hgoto_error(1);
- }else
- printf("File created.\n");
+ if (launch_g != UC_READER) {
+ HDprintf("Creating skeleton data file for test...\n");
+ if (create_wo_file() < 0) {
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
+ }
+ else
+ HDprintf("File created.\n");
}
/* flush output before possible fork */
HDfflush(stdout);
- if (launch_g==UC_READWRITE){
- /* fork process */
- if((childpid = fork()) < 0) {
- perror("fork");
- Hgoto_error(1);
- };
+ if (launch_g==UC_READWRITE) {
+ /* fork process */
+ if((childpid = HDfork()) < 0) {
+ HDperror("fork");
+ Hgoto_error(1);
+ };
};
mypid = getpid();
/* ============= */
/* launch reader */
/* ============= */
- if (launch_g != UC_WRITER){
- /* child process launch the reader */
- if(0 == childpid) {
- printf("%d: launch reader process\n", mypid);
- if (read_wo_file() < 0){
- fprintf(stderr, "read_wo_file encountered error\n");
- exit(1);
- }
- /* Reader is done. Clean up by removing the data file */
- HDremove(DATAFILE);
- exit(0);
- }
+ if (launch_g != UC_WRITER) {
+ /* child process launch the reader */
+ if(0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+ if (read_wo_file() < 0) {
+ HDfprintf(stderr, "read_wo_file encountered error\n");
+ HDexit(EXIT_FAILURE);
+ }
+
+ /* Reader is done. Clean up by removing the data file */
+ HDremove(DATAFILE);
+ HDexit(EXIT_SUCCESS);
+ }
}
/* ============= */
@@ -410,42 +421,43 @@ main(int argc, char *argv[])
/* ============= */
/* this process continues to launch the writer */
#ifdef DEBUG
- printf("%d: continue as the writer process\n", mypid);
+ HDprintf("%d: continue as the writer process\n", mypid);
#endif
- if (write_wo_file() < 0){
- fprintf(stderr, "write_wo_file encountered error\n");
- Hgoto_error(1);
+ if (write_wo_file() < 0) {
+ HDfprintf(stderr, "write_wo_file encountered error\n");
+ Hgoto_error(1);
}
/* ================================================ */
/* If readwrite, collect exit code of child process */
/* ================================================ */
- if (launch_g == UC_READWRITE){
- if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0){
- perror("waitpid");
- Hgoto_error(1);
- }
- if (WIFEXITED(child_status)){
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
- printf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
- Hgoto_error(2);
- }
- } else {
- printf("%d: child process terminated abnormally\n", mypid);
- Hgoto_error(2);
- }
+ if (launch_g == UC_READWRITE) {
+ if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) {
+ HDperror("waitpid");
+ Hgoto_error(1);
+ }
+ if (WIFEXITED(child_status)) {
+ if ((child_ret_value=WEXITSTATUS(child_status)) != 0) {
+ HDprintf("%d: child process exited with non-zero code (%d)\n", mypid, child_ret_value);
+ Hgoto_error(2);
+ }
+ }
+ else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
}
-
+
done:
/* Print result and exit */
if (ret_value != 0){
- printf("Error(s) encountered\n");
- }else{
- printf("All passed\n");
+ HDprintf("Error(s) encountered\n");
+ }
+ else {
+ HDprintf("All passed\n");
}
- return(ret_value);
+ return ret_value;
}
#else /* H5_HAVE_FORK */
diff --git a/test/unlink.c b/test/unlink.c
index f5754f8..48dd79d 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,32 +433,35 @@ 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];
+ H5O_info2_t oi_hard1, oi_hard2;
+ hid_t file;
+ char filename[1024];
+ char linkval[1024];
+ int token_cmp;
TESTING("check new move function");
/* Open file */
- h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
+ h5_fixname(FILENAME[1], fapl, filename, sizeof(filename));
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
FAIL_STACK_ERROR
/* Get hard link info */
- if(H5Oget_info_by_name(file, "/group2/group_new_name", &oi_hard1, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(file, "/group2/group_new_name", &oi_hard1, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
- if(H5Oget_info_by_name(file, "/group1/hard", &oi_hard2, H5P_DEFAULT) < 0)
+ if(H5Oget_info_by_name3(file, "/group1/hard", &oi_hard2, H5O_INFO_BASIC, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Check hard links */
if(H5O_TYPE_GROUP != oi_hard1.type || H5O_TYPE_GROUP != oi_hard2.type)
FAIL_PUTS_ERROR(" Unexpected object type, should have been a group")
- if(H5F_addr_ne(oi_hard1.addr, oi_hard2.addr))
+ if(H5Otoken_cmp(file, &oi_hard1.token, &oi_hard2.token, &token_cmp) < 0)
+ FAIL_PUTS_ERROR(" H5Otoken_cmp failed")
+ if(token_cmp)
FAIL_PUTS_ERROR(" Hard link test failed. Link seems not to point to the expected file location.")
/* Check soft links */
- if(H5Lget_val(file, "group2/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0)
+ if(H5Lget_val(file, "group2/soft", linkval, sizeof(linkval), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
if(HDstrcmp(linkval, "/group1/group_move"))
FAIL_PUTS_ERROR(" Soft link test failed. Wrong link value")
@@ -473,7 +476,7 @@ error:
return 1;
} /* end check_new_move() */
-
+
/*-------------------------------------------------------------------------
* Function: test_filespace
*
@@ -492,21 +495,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 +517,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 +809,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 +915,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 +923,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 +978,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 +1007,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 +1027,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 +1035,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 +1235,7 @@ error:
return 1;
} /* end test_filespace() */
-
+
/*-------------------------------------------------------------------------
* Function: test_create_unlink
*
@@ -1251,10 +1254,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 +1268,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 +1302,7 @@ error:
return 1;
} /* end test_create_unlink() */
-
+
/*-------------------------------------------------------------------------
* Function: test_link_slashes
*
@@ -1320,7 +1323,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 +1370,7 @@ error:
return 1;
} /* end test_link_slashes() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_slashes
*
@@ -1388,7 +1391,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 +1467,7 @@ delete_node(hid_t pid, hid_t id)
return(0);
}
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_rightleaf
*
@@ -1499,14 +1502,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 +1546,7 @@ error:
return 1;
} /* end test_unlink_rightleaf() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_rightnode
*
@@ -1578,7 +1581,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 +1625,7 @@ error:
return 1;
} /* end test_unlink_rightnode() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_middlenode
*
@@ -1657,7 +1660,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 +1847,7 @@ error:
return 1;
} /* end test_unlink_middlenode() */
-
+
/*-------------------------------------------------------------------------
* Function: test_resurrect_dataset
*
@@ -1865,7 +1868,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 +1911,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 +1981,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 +2049,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 +2132,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 +2159,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_info2_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 +2180,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 +2208,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,8 +2230,8 @@ 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);
- if(H5Oget_info_by_name(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(objname, "/keep/keep %u\n", u);
+ if(H5Oget_info_by_name3(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 2) TEST_ERROR
} /* end for */
@@ -2244,8 +2247,8 @@ 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);
- if(H5Oget_info_by_name(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(objname, "/keep/keep %u\n", u);
+ if(H5Oget_info_by_name3(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 1) TEST_ERROR
} /* end for */
@@ -2263,14 +2266,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 +2293,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_info2_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 +2314,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 +2354,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,8 +2376,8 @@ 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);
- if(H5Oget_info_by_name(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(objname, "/keep/keep %u\n", u);
+ if(H5Oget_info_by_name3(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 2) TEST_ERROR
} /* end for */
@@ -2390,8 +2393,8 @@ 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);
- if(H5Oget_info_by_name(file_id, objname, &oi, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ HDsprintf(objname, "/keep/keep %u\n", u);
+ if(H5Oget_info_by_name3(file_id, objname, &oi, H5O_INFO_BASIC, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if(oi.rc != 1) TEST_ERROR
} /* end for */
@@ -2409,38 +2412,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
- *
- * Purpose: Test unlinking operations
+ * Function: main
*
- * Return: Success: zero
+ * Purpose: Test unlinking operations
*
- * Failure: non-zero
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * 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 +2466,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 +2499,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 +2549,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/unregister.c b/test/unregister.c
index a4bf24e..a2a507d 100644
--- a/test/unregister.c
+++ b/test/unregister.c
@@ -17,14 +17,16 @@
*/
#include "h5test.h"
+#include "H5CXprivate.h" /* API Contexts */
+
const char *FILENAME[] = {
"unregister_filter_1",
"unregister_filter_2",
NULL
};
-#define GROUP_NAME "group"
-#define DSET_NAME "dataset"
+#define GROUP_NAME "test_group"
+#define DSET_NAME "test_dataset"
#define FILENAME_BUF_SIZE 1024
#define DSET_DIM1 100
#define DSET_DIM2 200
@@ -34,39 +36,34 @@ const char *FILENAME[] = {
#define H5Z_FILTER_DUMMY 312
-static size_t filter_dummy(unsigned int flags, size_t cd_nelmts,
+static size_t do_nothing(unsigned int flags, size_t cd_nelmts,
const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf);
/* Dummy filter for test_unregister_filters only */
const H5Z_class2_t H5Z_DUMMY[1] = {{
- H5Z_CLASS_T_VERS, /* H5Z_class_t version */
- H5Z_FILTER_DUMMY, /* Filter id number */
- 1, 1, /* Encoding and decoding enabled */
- "dummy", /* Filter name for debugging */
- NULL, /* The "can apply" callback */
- NULL, /* The "set local" callback */
- filter_dummy, /* The actual filter function */
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ H5Z_FILTER_DUMMY, /* Filter ID number */
+ 1, 1, /* Encoding and decoding enabled */
+ "dummy", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ do_nothing, /* The actual filter function */
}};
/*-------------------------------------------------------------------------
- * Function: filter_dummy
+ * Function: do_nothing
*
- * Purpose: A dummy compression method that doesn't do anything. This
- * filter is only for test_unregister_filters. Please don't
+ * Purpose: A dummy compression method that doesn't do anything. This
+ * filter is only for test_unregister_filters. Please don't
* use it for other tests because it may mess up this test.
*
- * Return: Success: Data chunk size
- *
- * Failure: 0
- *
- * Programmer: Raymond Lu
- * April 24, 2013
+ * Return: Data chunk size
*
*-------------------------------------------------------------------------
*/
static size_t
-filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
+do_nothing(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
const unsigned int H5_ATTR_UNUSED *cd_values, size_t nbytes,
size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
{
@@ -74,181 +71,248 @@ filter_dummy(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
}
/*-------------------------------------------------------------------------
- * Function: test_unregister_filters
- *
- * Purpose: Tests unregistering filter before closing the file
+ * Function: test_unregister_filters
*
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Tests unregistering filter before closing the file
*
- * Programmer: Raymond Lu
- * 11 April 2013
+ * Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
static herr_t
-test_unregister_filters(hid_t my_fapl)
+test_unregister_filters(hid_t fapl_id)
{
- hid_t file1, file2;
- hid_t dc;
- hid_t gcpl, gid, group;
- hid_t dataset, space;
- int i, j, n;
- char gname[256];
+ hid_t fid1 = H5I_INVALID_HID;
+ hid_t fid2 = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t gcpl_id = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t gid_loop = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ int i, j, n;
+ char group_name[32];
char filename[FILENAME_BUF_SIZE];
- const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
- hsize_t dims[2];
- int points[DSET_DIM1][DSET_DIM2];
+ const hsize_t chunk_dims[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
+ hsize_t dims[2];
+ int **buf = NULL;
+ int *buf_data = NULL;
herr_t ret;
TESTING("Unregistering filter");
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(DSET_DIM1 * DSET_DIM2, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(DSET_DIM1, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < DSET_DIM1; i++)
+ buf[i] = buf_data + (i * DSET_DIM2);
+
/* Create first file */
- h5_fixname(FILENAME[0], my_fapl, filename, sizeof filename);
- if((file1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error;
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename));
+ if((fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Create second file */
- h5_fixname(FILENAME[1], my_fapl, filename, sizeof filename);
- if((file2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) goto error;
+ h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename));
+ if((fid2 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ goto error;
/* Register DUMMY filter */
- if(H5Zregister(H5Z_DUMMY) < 0) goto error;
+ if (H5Zregister(H5Z_DUMMY) < 0)
+ goto error;
+ if (H5Zfilter_avail(H5Z_FILTER_DUMMY) != TRUE)
+ goto error;
- if(H5Zfilter_avail(H5Z_FILTER_DUMMY)!=TRUE) goto error;
+ /*******************
+ * PART 1 - GROUPS *
+ *******************/
- if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error;
-
- /* Use DUMMY filter for creating groups */
- if(H5Pset_filter (gcpl, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error;
+ /* Use DUMMY filter for creating groups */
+ if((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ goto error;
+ if(H5Pset_filter(gcpl_id, H5Z_FILTER_DUMMY, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0)
+ goto error;
/* Create a group using this filter */
- if((gid = H5Gcreate2(file1, GROUP_NAME, H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error;
+ if((gid = H5Gcreate2(fid1, GROUP_NAME, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Create multiple groups under the main group */
- for (i=0; i < GROUP_ITERATION; i++) {
- sprintf(gname, "group_%d", i);
- if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(group) < 0) goto error;
+ for(i = 0; i < GROUP_ITERATION; i++) {
+ HDsprintf(group_name, "group_%d", i);
+ if((gid_loop = H5Gcreate2(gid, group_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ if(H5Gclose(gid_loop) < 0)
+ goto error;
}
- if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
+ /* Flush the file containing the groups */
+ if(H5Fflush(fid1, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
/* Unregister the filter before closing the group. It should fail */
H5E_BEGIN_TRY {
ret = H5Zunregister(H5Z_FILTER_DUMMY);
} H5E_END_TRY;
- if(ret>=0) {
+ if(ret >= 0) {
H5_FAILED();
- printf(" Line %d: Should not be able to unregister filter\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to unregister filter\n", __LINE__);
goto error;
- } /* end if */
+ }
/* Close the group */
- if(H5Gclose(gid) < 0) goto error;
+ if(H5Gclose(gid) < 0)
+ goto error;
/* Clean up objects used for this test */
- if(H5Pclose (gcpl) < 0) goto error;
+ if(H5Pclose (gcpl_id) < 0)
+ goto error;
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ /*********************
+ * PART 2 - DATASETS *
+ *********************/
- if(H5Pset_filter(dc, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0) goto error;
+ /* Use DUMMY filter for creating datasets */
+ if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk(dcpl_id, 2, chunk_dims) < 0)
+ goto error;
+ if(H5Pset_filter(dcpl_id, H5Z_FILTER_DUMMY, 0, (size_t)0, NULL) < 0)
+ goto error;
- /* Initialize the dataset */
+ /* Initialize the data for writing */
for(i = n = 0; i < DSET_DIM1; i++)
for(j = 0; j < DSET_DIM2; j++)
- points[i][j] = n++;
+ buf[i][j] = n++;
- /* Create the data space */
+ /* Create the dataspace */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
+ goto error;
/* Create a dataset in the first file */
- if((dataset = H5Dcreate2(file1, DSET_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(fid1, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
goto error;
/* Unregister the filter before closing the dataset. It should fail */
H5E_BEGIN_TRY {
ret = H5Zunregister(H5Z_FILTER_DUMMY);
} H5E_END_TRY;
- if(ret>=0) {
+ if(ret >= 0) {
H5_FAILED();
- printf(" Line %d: Should not be able to unregister filter\n", __LINE__);
+ HDprintf(" Line %d: Should not be able to unregister filter\n", __LINE__);
goto error;
- } /* end if */
+ }
- if(H5Dclose(dataset) < 0) goto error;
+ /* Close the dataset */
+ if(H5Dclose(did) < 0)
+ goto error;
/* Create a dataset in the second file */
- if((dataset = H5Dcreate2(file2, DSET_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(fid2, DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
goto error;
- if(H5Dclose(dataset) < 0) goto error;
+ /* Close the dataset in the second file */
+ if(H5Dclose(did) < 0)
+ goto error;
- /* Unregister the filter after closing all objects but before closing files.
- * It should flush all files. */
- if(H5Zunregister(H5Z_FILTER_DUMMY) < 0) goto error;
+ /* Unregister the filter after closing all objects but before closing files.
+ * It should flush all files.
+ */
+ if(H5Zunregister(H5Z_FILTER_DUMMY) < 0)
+ goto error;
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
- if(H5Fclose(file1) < 0) goto error;
- if(H5Fclose(file2) < 0) goto error;
+ if(H5Pclose(dcpl_id) < 0)
+ goto error;
+ if(H5Fclose(fid1) < 0)
+ goto error;
+ if(H5Fclose(fid2) < 0)
+ goto error;
+
+ HDfree(buf);
+ HDfree(buf_data);
PASSED();
- return 0;
+ return SUCCEED;
error:
- return -1;
+ H5E_BEGIN_TRY {
+ H5Fclose(fid1);
+ H5Fclose(fid2);
+ H5Pclose(dcpl_id);
+ H5Pclose(gcpl_id);
+ H5Gclose(gid);
+ H5Gclose(gid_loop);
+ H5Dclose(did);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+
+ HDfree(buf);
+ HDfree(buf_data);
+
+ return FAIL;
}
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Tests unregistering filter with H5Zunregister
- *
- * Return: Success: exit(EXIT_SUCCESS)
+ * Function: main
*
- * Failure: exit(EXIT_FAILURE)
+ * Purpose: Tests unregistering filter with H5Zunregister
*
- * Programmer: Raymond Lu
- * 11 April 2013
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fapl;
- int nerrors = 0;
+ hid_t fapl_id = H5I_INVALID_HID;
+ int nerrors = 0;
+ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
/* Testing setup */
h5_reset();
- fapl = h5_fileaccess();
+ fapl_id = h5_fileaccess();
+
+ /* Push API context */
+ if(H5CX_push() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = TRUE;
/* Test unregistering filter in its own file */
- nerrors += (test_unregister_filters(fapl) < 0 ? 1 : 0);
+ nerrors += (test_unregister_filters(fapl_id) < 0 ? 1 : 0);
+
+ h5_cleanup(FILENAME, fapl_id);
- if(nerrors)
+ if (nerrors)
goto error;
- printf("All filter unregistration tests passed.\n");
- h5_cleanup(FILENAME, fapl);
+ HDprintf("All filter unregistration tests passed.\n");
- return 0;
+ /* Pop API context */
+ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR
+ api_ctx_pushed = FALSE;
+
+
+ HDexit(EXIT_SUCCESS);
error:
nerrors = MAX(1, nerrors);
- printf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
+ HDprintf("***** %d FILTER UNREGISTRATION TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- return 1;
-}
+
+ if(api_ctx_pushed) H5CX_pop();
+
+ HDexit(EXIT_FAILURE);
+} /* end main() */
diff --git a/test/use.h b/test/use.h
index 0885cc5..52537d6 100644
--- a/test/use.h
+++ b/test/use.h
@@ -16,48 +16,46 @@
#include "h5test.h"
/* Macro definitions */
-#define Hgoto_error(val) {ret_value=val; goto done;}
-#define Hgoto_done {goto done;}
-#define Chunksize_DFT 256 /* chunksize default */
-#define ErrorReportMax 10 /* max number of errors reported */
+#define Hgoto_error(val) {ret_value=val; goto done;}
+#define Hgoto_done {goto done;}
+#define Chunksize_DFT 256 /* chunksize default */
+#define ErrorReportMax 10 /* max number of errors reported */
/* these two definitions must match each other */
-#define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */
-#define UC_CTYPE short /* use case C data type */
-#define UC_RANK 3 /* use case dataset rank */
+#define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */
+#define UC_CTYPE short /* use case C data type */
+#define UC_RANK 3 /* use case dataset rank */
/* Name of message file that is sent by the writer */
#define WRITER_MESSAGE "USE_WRITER_MESSAGE"
/* type declarations */
typedef enum part_t {
- UC_READWRITE =0, /* both writer and reader */
- UC_WRITER, /* writer only */
- UC_READER /* reader only */
+ UC_READWRITE = 0, /* both writer and reader */
+ UC_WRITER, /* writer only */
+ UC_READER /* reader only */
} part_t;
typedef struct options_t {
- hsize_t chunksize; /* chunks are chunksize^2 planes */
- hsize_t chunkplanes; /* number of planes per chunk, default 1 */
+ hsize_t chunksize; /* chunks are chunksize^2 planes */
+ hsize_t chunkplanes; /* number of planes per chunk, default 1 */
hsize_t chunkdims[UC_RANK]; /* chunk dims is (chunkplan, chunksize, chunksize) */
hsize_t dims[UC_RANK]; /* dataset initial dims */
hsize_t max_dims[UC_RANK]; /* dataset max dims */
- hsize_t nplanes; /* number of planes to write, default proportional to chunksize */
- char *filename; /* use case data filename */
- part_t launch; /* launch writer, reader or both */
- hbool_t use_swmr; /* use swmr open (1) or not */
- int iterations; /* iterations, default 1 */
+ hsize_t nplanes; /* number of planes to write, default proportional to chunksize */
+ char *filename; /* use case data filename */
+ part_t launch; /* launch writer, reader or both */
+ hbool_t use_swmr; /* use swmr open (1) or not */
+ int iterations; /* iterations, default 1 */
+ hid_t fapl_id; /* instance-specific FAPL ID */
+ const char *progname; /* Program name (used in usage and dset name) */
} options_t;
-/* global variables declarations */
-extern options_t UC_opts; /* Use Case Options */
-extern const char *progname_g; /* Program name */
-
/* prototype declarations */
-int parse_option(int argc, char * const argv[]);
-int setup_parameters(int argc, char * const argv[]);
-void show_parameters(void);
+int parse_option(int argc, char * const argv[], options_t * opts);
+int setup_parameters(int argc, char * const argv[], options_t * opts);
+void show_parameters(options_t * opts);
void usage(const char *prog);
-int create_uc_file(void);
-int write_uc_file(hbool_t tosend);
-int read_uc_file(hbool_t towait);
+int create_uc_file(options_t * opts);
+int write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts);
+int read_uc_file(hbool_t towait, options_t * opts);
diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c
index 005eb51..8fcf0d3 100644
--- a/test/use_append_chunk.c
+++ b/test/use_append_chunk.c
@@ -11,7 +11,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Use Case 1.7 Appending a single chunk
+ * Use Case 1.7 Appending a single chunk
* Description:
* Appending a single chunk of raw data to a dataset along an unlimited
* dimension within a pre-created file and reading the new data back.
@@ -24,35 +24,36 @@
* Level:
* User Level
* Guarantees:
- * o Readers will see the modified dimension sizes after the Writer
- * finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls.
- * o Readers will see newly appended data after the Writer finishes
- * the flush operation.
- *
+ * o Readers will see the modified dimension sizes after the Writer
+ * finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls.
+ * o Readers will see newly appended data after the Writer finishes
+ * the flush operation.
+ *
* Preconditions:
- * o Readers are not allowed to modify the file. o All datasets
- * that are modified by the Writer exist when the Writer opens the file.
- * o All datasets that are modified by the Writer exist when a Reader
- * opens the file. o Data is written by a hyperslab contained in
- * one chunk.
- *
+ * o Readers are not allowed to modify the file.
+ * o All datasets that are modified by the Writer exist when the Writer
+ * opens the file.
+ * o All datasets that are modified by the Writer exist when a Reader
+ * opens the file.
+ * o Data is written by a hyperslab contained in one chunk.
+ *
* Main Success Scenario:
- * 1. An application creates a file with required objects (groups,
- * datasets, and attributes).
- * 2. The Writer application opens the file and datasets in the file
- * and starts adding data along the unlimited dimension using a hyperslab
- * selection that corresponds to an HDF5 chunk.
- * 3. A Reader opens the file and a dataset in a file, and queries
- * the sizes of the dataset; if the extent of the dataset has changed,
- * reads the appended data back.
- *
+ * 1. An application creates a file with required objects (groups,
+ * datasets, and attributes).
+ * 2. The Writer application opens the file and datasets in the file
+ * and starts adding data along the unlimited dimension using a hyperslab
+ * selection that corresponds to an HDF5 chunk.
+ * 3. A Reader opens the file and a dataset in a file, and queries
+ * the sizes of the dataset; if the extent of the dataset has changed,
+ * reads the appended data back.
+ *
* Discussion points:
- * 1. Since the new data is written to the file, and metadata update
- * operation of adding pointer to the newly written chunk is atomic and
- * happens after the chunk is on the disk, only two things may happen
- * to the Reader:
- * o The Reader will not see new data.
- * o The Reader will see all new data written by Writer.
+ * 1. Since the new data is written to the file, and metadata update
+ * operation of adding pointer to the newly written chunk is atomic and
+ * happens after the chunk is on the disk, only two things may happen
+ * to the Reader:
+ * o The Reader will not see new data.
+ * o The Reader will see all new data written by Writer.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Created: Albert Cheng, 2013/5/28 */
@@ -68,46 +69,43 @@
#include "use.h"
-/* Global Variable definitions */
-options_t UC_opts; /* Use Case Options */
-const char *progname_g="use_append_chunk"; /* program name */
+#define USE_APPEND_CHUNK_PROGNAME "use_append_chunk"
+
+static options_t UC_opts; /* Use Case Options */
/* Setup parameters for the use case.
* Return: 0 succeed; -1 fail.
*/
-int setup_parameters(int argc, char * const argv[])
+int
+setup_parameters(int argc, char * const argv[], options_t * opts)
{
/* use case defaults */
- HDmemset(&UC_opts, 0, sizeof(options_t));
- UC_opts.chunksize = Chunksize_DFT;
- UC_opts.use_swmr = TRUE; /* use swmr open */
- UC_opts.iterations = 1;
- UC_opts.chunkplanes = 1;
-
- /* parse options */
- if (parse_option(argc, argv) < 0)
- return(-1);
-
- /* set chunk dims */
- UC_opts.chunkdims[0] = UC_opts.chunkplanes;
- UC_opts.chunkdims[1] = UC_opts.chunkdims[2] = UC_opts.chunksize;
-
- /* set dataset initial and max dims */
- UC_opts.dims[0] = 0;
- UC_opts.max_dims[0] = H5S_UNLIMITED;
- UC_opts.dims[1] = UC_opts.dims[2] = UC_opts.max_dims[1] = UC_opts.max_dims[2] = UC_opts.chunksize;
-
- /* set nplanes */
- if (UC_opts.nplanes == 0)
- UC_opts.nplanes = (hsize_t)UC_opts.chunksize;
-
- /* show parameters and return */
- show_parameters();
+ HDmemset(opts, 0, sizeof(options_t));
+ opts->chunksize = Chunksize_DFT;
+ opts->use_swmr = TRUE; /* use swmr open */
+ opts->iterations = 1;
+ opts->chunkplanes = 1;
+ opts->progname = USE_APPEND_CHUNK_PROGNAME;
+
+ if (parse_option(argc, argv, opts) < 0)
+ return(-1);
+
+ opts->chunkdims[0] = opts->chunkplanes;
+ opts->chunkdims[1] = opts->chunkdims[2] = opts->chunksize;
+
+ opts->dims[0] = 0;
+ opts->max_dims[0] = H5S_UNLIMITED;
+ opts->dims[1] = opts->dims[2] = opts->max_dims[1] = opts->max_dims[2] = opts->chunksize;
+
+ if (opts->nplanes == 0)
+ opts->nplanes = (hsize_t)opts->chunksize;
+
+ show_parameters(opts);
return(0);
-}
+} /* setup_parameters() */
-/* Overall Algorithm:
+/* Overall Algorithm:
* Parse options from user;
* Generate/pre-created test files needed and close it;
* fork: child process becomes the reader process;
@@ -119,19 +117,20 @@ main(int argc, char *argv[])
{
pid_t childpid=0;
pid_t mypid, tmppid;
- int child_status;
+ int child_status;
int child_wait_option=0;
int ret_value = 0;
int child_ret_value;
hbool_t send_wait = FALSE;
+ hid_t fapl = -1; /* File access property list */
+ hid_t fid = -1; /* File ID */
- /* initialization */
- if (setup_parameters(argc, argv) < 0){
- Hgoto_error(1);
+ if (setup_parameters(argc, argv, &UC_opts) < 0) {
+ Hgoto_error(1);
}
/* Determine the need to send/wait message file*/
- if(UC_opts.launch == UC_READWRITE) {
+ if (UC_opts.launch == UC_READWRITE) {
HDunlink(WRITER_MESSAGE);
send_wait = TRUE;
}
@@ -141,78 +140,131 @@ main(int argc, char *argv[])
/* UC_WRITER: create datafile, skip reader, launch writer. */
/* UC_READER: skip create, launch reader, exit. */
/* ==============================================================*/
- /* ============*/
+ /* =========== */
/* Create file */
- /* ============*/
- if (UC_opts.launch != UC_READER){
- printf("Creating skeleton data file for test...\n");
- if (create_uc_file() < 0){
- fprintf(stderr, "***encounter error\n");
- Hgoto_error(1);
- }else
- printf("File created.\n");
+ /* =========== */
+ if (UC_opts.launch != UC_READER) {
+ HDprintf("Creating skeleton data file for test...\n");
+ if ((UC_opts.fapl_id = h5_fileaccess()) < 0) {
+ HDfprintf(stderr, "can't create creation FAPL\n");
+ Hgoto_error(1);
+ }
+ if (H5Pset_libver_bounds(UC_opts.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+ HDfprintf(stderr, "can't set creation FAPL libver bounds\n");
+ Hgoto_error(1);
+ }
+ if (create_uc_file(&UC_opts) < 0) {
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
+ } else {
+ HDprintf("File created.\n");
+ }
+ /* Close FAPL to prevent issues with forking later */
+ if (H5Pclose(UC_opts.fapl_id) < 0) {
+ HDfprintf(stderr, "can't close creation FAPL\n");
+ Hgoto_error(1);
+ }
+ UC_opts.fapl_id = H5I_INVALID_HID;
}
- if (UC_opts.launch==UC_READWRITE){
- /* fork process */
- if((childpid = HDfork()) < 0) {
- HDperror("fork");
- Hgoto_error(1);
- };
- };
+ /* ============ */
+ /* Fork process */
+ /* ============ */
+ if (UC_opts.launch == UC_READWRITE) {
+ if ((childpid = HDfork()) < 0) {
+ HDperror("fork");
+ Hgoto_error(1);
+ }
+ }
mypid = HDgetpid();
/* ============= */
/* launch reader */
/* ============= */
- if (UC_opts.launch != UC_WRITER){
- /* child process launch the reader */
- if(0 == childpid) {
- printf("%d: launch reader process\n", mypid);
- if (read_uc_file(send_wait) < 0){
- fprintf(stderr, "read_uc_file encountered error\n");
- exit(1);
- }
- exit(0);
- }
+ if (UC_opts.launch != UC_WRITER) {
+ /* child process launch the reader */
+ if (0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+ if ((UC_opts.fapl_id = h5_fileaccess()) < 0) {
+ HDfprintf(stderr, "can't create read FAPL\n");
+ HDexit(EXIT_FAILURE);
+ }
+ if (read_uc_file(send_wait, &UC_opts) < 0) {
+ HDfprintf(stderr, "read_uc_file encountered error\n");
+ HDexit(EXIT_FAILURE);
+ }
+ if (H5Pclose(UC_opts.fapl_id) < 0) {
+ HDfprintf(stderr, "can't close read FAPL\n");
+ HDexit(EXIT_FAILURE);
+ }
+ HDexit(EXIT_SUCCESS);
+ }
}
/* ============= */
/* launch writer */
/* ============= */
/* this process continues to launch the writer */
- printf("%d: continue as the writer process\n", mypid);
- if (write_uc_file(send_wait) < 0){
- fprintf(stderr, "write_uc_file encountered error\n");
- Hgoto_error(1);
+ HDprintf("%d: continue as the writer process\n", mypid);
+
+ if ((fapl = h5_fileaccess()) < 0) {
+ HDfprintf(stderr, "can't create write FAPL\n");
+ Hgoto_error(1);
+ }
+
+ if (UC_opts.use_swmr) {
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+ HDfprintf(stderr, "can't set write FAPL libver bounds\n");
+ Hgoto_error(1);
+ }
+ }
+
+ if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0) {
+ HDfprintf(stderr, "H5Fopen failed\n");
+ Hgoto_error(1);
+ }
+
+ if (write_uc_file(send_wait, fid, &UC_opts) < 0) {
+ HDfprintf(stderr, "write_uc_file encountered error\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "Failed to close write\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Pclose(fapl) < 0) {
+ HDfprintf(stderr, "can't close write FAPL\n");
+ Hgoto_error(1);
}
/* ================================================ */
/* If readwrite, collect exit code of child process */
/* ================================================ */
- if (UC_opts.launch == UC_READWRITE){
- if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0){
- HDperror("waitpid");
- Hgoto_error(1);
- }
- if (WIFEXITED(child_status)){
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
- printf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
- Hgoto_error(2);
- }
- } else {
- printf("%d: child process terminated abnormally\n", mypid);
- Hgoto_error(2);
- }
+ if (UC_opts.launch == UC_READWRITE) {
+ if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) {
+ HDperror("waitpid");
+ Hgoto_error(1);
+ }
+
+ if (WIFEXITED(child_status)) {
+ if ((child_ret_value = WEXITSTATUS(child_status)) != 0) {
+ HDprintf("%d: child process exited with non-zero code (%d)\n",
+ mypid, child_ret_value);
+ Hgoto_error(2);
+ }
+ } else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
}
-
+
done:
- /* Print result and exit */
- if (ret_value != 0){
- printf("Error(s) encountered\n");
- }else{
- printf("All passed\n");
+ if (ret_value != 0) {
+ HDprintf("Error(s) encountered\n");
+ } else {
+ HDprintf("All passed\n");
}
return(ret_value);
diff --git a/test/use_append_chunk_mirror.c b/test/use_append_chunk_mirror.c
new file mode 100644
index 0000000..6ee01c0
--- /dev/null
+++ b/test/use_append_chunk_mirror.c
@@ -0,0 +1,403 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* HACKED VERSION
+ * Demonstrate SWMR with a mirrored file.
+ *
+ * Must be built with SERVER_IP as the IP address of the target system
+ * with a running mirror server, and SERVER_PORT as the primary server port.
+ *
+ * In addition to the local file, 'shinano.h5' will be created on the remote
+ * system, mirroring the local file. The file location will be local to
+ * Server's/Writer's invocation directory.
+ *
+ * Template for demonstration purposes:
+ *
+ * # Launch mirror server on remote machine (in foreground to easily stop)
+ * REMOTE(1)$ ./mirror_server /path/to/mirror_worker
+ *
+ * # Launch chunk writer with plenty of chunks.
+ * LOCAL(1)$ ./use_append_chunk_mirror -l w -n 10000
+ *
+ * # Wait one second for files to be created.
+ *
+ * # Launch chunk readers on both files.
+ * LOCAL(2)$ ./use_append_chunk_mirror -l r -n 10000
+ * REMOTE(2)$ ./use_append_chunk_mirror -l r -n 10000 -f shinano.h5
+ *
+ * # Hard-stop the server.
+ * REMOTE(1)$ ^C
+ * # alt, softer shutdown using echo and nc
+ * echo "SHUTDOWN" | nc localhost 3000
+ */
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Use Case 1.7 Appending a single chunk
+ * Description:
+ * Appending a single chunk of raw data to a dataset along an unlimited
+ * dimension within a pre-created file and reading the new data back.
+ * Goal:
+ * Read data appended by the Writer to a pre-existing dataset in a
+ * file. The dataset has one or more unlimited dimensions. The data is
+ * appended by a hyperslab that is contained in one chunk (for example,
+ * appending 2-dim planes along the slowest changing dimension in the
+ * 3-dim dataset).
+ * Level:
+ * User Level
+ * Guarantees:
+ * o Readers will see the modified dimension sizes after the Writer
+ * finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls.
+ * o Readers will see newly appended data after the Writer finishes
+ * the flush operation.
+ *
+ * Preconditions:
+ * o Readers are not allowed to modify the file.
+ * o All datasets that are modified by the Writer exist when the Writer
+ * opens the file.
+ * o All datasets that are modified by the Writer exist when a Reader
+ * opens the file.
+ * o Data is written by a hyperslab contained in one chunk.
+ *
+ * Main Success Scenario:
+ * 1. An application creates a file with required objects (groups,
+ * datasets, and attributes).
+ * 2. The Writer application opens the file and datasets in the file
+ * and starts adding data along the unlimited dimension using a hyperslab
+ * selection that corresponds to an HDF5 chunk.
+ * 3. A Reader opens the file and a dataset in a file, and queries
+ * the sizes of the dataset; if the extent of the dataset has changed,
+ * reads the appended data back.
+ *
+ * Discussion points:
+ * 1. Since the new data is written to the file, and metadata update
+ * operation of adding pointer to the newly written chunk is atomic and
+ * happens after the chunk is on the disk, only two things may happen
+ * to the Reader:
+ * o The Reader will not see new data.
+ * o The Reader will see all new data written by Writer.
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Created: Jacob Smith, 2019 */
+
+#include "use.h"
+
+/* This test uses many POSIX things that are not available on
+ * Windows. We're using a check for fork(2) here as a proxy for
+ * all POSIX/Unix/Linux things until this test can be made
+ * more platform-independent.
+ */
+#ifdef H5_HAVE_FORK
+
+#ifdef H5_HAVE_MIRROR_VFD
+
+#define THIS_PROGNAME "use_append_chunk_mirror"
+
+#define CONNECT_WITH_JELLY 0
+
+#if CONNECT_WITH_JELLY
+#define SERVER_IP "10.10.10.248" /* hard-coded IP address */
+#else
+#define SERVER_IP "127.0.0.1" /* localhost */
+#endif /* CONNECT_WITH_JELLY */
+#define SERVER_PORT 3000 /* hard-coded port number */
+#define MIRROR_FILE_NAME "shinano.h5" /* hard-coded duplicate/mirror filename */
+
+static options_t UC_opts; /* Use Case Options */
+
+/* Setup parameters for the use case.
+ * Return: 0 succeed; -1 fail.
+ */
+int
+setup_parameters(int argc, char * const argv[], options_t * opts)
+{
+ /* use case defaults */
+ HDmemset(opts, 0, sizeof(options_t));
+ opts->chunksize = Chunksize_DFT;
+ opts->use_swmr = TRUE;
+ opts->iterations = 1;
+ opts->chunkplanes = 1;
+ opts->progname = THIS_PROGNAME;
+
+ if (parse_option(argc, argv, opts) < 0)
+ return(-1);
+
+ opts->chunkdims[0] = opts->chunkplanes;
+ opts->chunkdims[1] = opts->chunkdims[2] = opts->chunksize;
+
+ opts->dims[0] = 0;
+ opts->max_dims[0] = H5S_UNLIMITED;
+ opts->dims[1] = opts->dims[2] = opts->max_dims[1] = opts->max_dims[2] = opts->chunksize;
+
+ if (opts->nplanes == 0)
+ opts->nplanes = (hsize_t)opts->chunksize;
+
+ show_parameters(opts);
+ return(0);
+} /* setup_parameters() */
+
+
+/* Overall Algorithm:
+ * Parse options from user;
+ * Generate/pre-created test files needed and close it;
+ * fork: child process becomes the reader process;
+ * while parent process continues as the writer process;
+ * both run till ending conditions are met.
+ */
+int
+main(int argc, char *argv[])
+{
+ pid_t childpid=0;
+ pid_t mypid, tmppid;
+ int child_status;
+ int child_wait_option=0;
+ int ret_value = 0;
+ int child_ret_value;
+ hbool_t send_wait = FALSE;
+ hid_t fid = -1; /* File ID */
+ H5FD_mirror_fapl_t mirr_fa;
+ H5FD_splitter_vfd_config_t split_fa;
+ hid_t mirr_fapl_id = H5I_INVALID_HID;
+
+ if (setup_parameters(argc, argv, &UC_opts) < 0) {
+ Hgoto_error(1);
+ }
+
+ mirr_fa.magic = H5FD_MIRROR_FAPL_MAGIC;
+ mirr_fa.version = H5FD_MIRROR_CURR_FAPL_T_VERSION;
+ mirr_fa.handshake_port = SERVER_PORT;
+ HDstrncpy(mirr_fa.remote_ip, SERVER_IP, H5FD_MIRROR_MAX_IP_LEN);
+
+
+ split_fa.wo_fapl_id = H5I_INVALID_HID;
+ split_fa.rw_fapl_id = H5I_INVALID_HID;
+ split_fa.magic = H5FD_SPLITTER_MAGIC;
+ split_fa.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ split_fa.log_file_path[0] = '\0'; /* none */
+ split_fa.ignore_wo_errs = FALSE;
+ HDstrncpy(split_fa.wo_path, MIRROR_FILE_NAME, H5FD_SPLITTER_PATH_MAX);
+
+ /* Determine the need to send/wait message file*/
+ if (UC_opts.launch == UC_READWRITE) {
+ HDunlink(WRITER_MESSAGE);
+ send_wait = TRUE;
+ }
+
+ /* ==============================================================*/
+ /* UC_READWRITE: create datafile, launch both reader and writer. */
+ /* UC_WRITER: create datafile, skip reader, launch writer. */
+ /* UC_READER: skip create, launch reader, exit. */
+ /* ==============================================================*/
+ /* =========== */
+ /* Create file */
+ /* =========== */
+ if (UC_opts.launch != UC_READER) {
+ HDprintf("Creating skeleton data file for test...\n");
+
+ /* Prepare mirror child driver */
+ mirr_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (mirr_fapl_id == H5I_INVALID_HID) {
+ HDfprintf(stderr, "can't create creation mirror FAPL\n");
+ Hgoto_error(1);
+ }
+ if (H5Pset_fapl_mirror(mirr_fapl_id, &mirr_fa) < 0) {
+ HDfprintf(stderr, "can't set creation mirror FAPL\n");
+ H5Eprint2(H5E_DEFAULT, stdout);
+ Hgoto_error(1);
+ }
+
+ /* Prepare parent "splitter" driver in UC_opts */
+ split_fa.wo_fapl_id = mirr_fapl_id;
+ split_fa.rw_fapl_id = H5P_DEFAULT;
+ UC_opts.fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (UC_opts.fapl_id == H5I_INVALID_HID) {
+ HDfprintf(stderr, "can't create creation FAPL\n");
+ Hgoto_error(1);
+ }
+ if (H5Pset_fapl_splitter(UC_opts.fapl_id, &split_fa) < 0) {
+ HDfprintf(stderr, "can't set creation FAPL\n");
+ H5Eprint2(H5E_DEFAULT, stdout);
+ Hgoto_error(1);
+ }
+
+ if (H5Pset_libver_bounds(UC_opts.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+ HDfprintf(stderr, "can't set creation FAPL libver bounds\n");
+ Hgoto_error(1);
+ }
+
+ /* Create file */
+ if (create_uc_file(&UC_opts) < 0) {
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
+ } else {
+ HDprintf("File created.\n");
+ }
+
+ /* Close FAPLs to prevent issues with forking later */
+ if (H5Pclose(UC_opts.fapl_id) < 0) {
+ HDfprintf(stderr, "can't close creation FAPL\n");
+ Hgoto_error(1);
+ }
+ UC_opts.fapl_id = H5I_INVALID_HID;
+ if (H5Pclose(mirr_fapl_id) < 0) {
+ HDfprintf(stderr, "can't close creation mirror FAPL\n");
+ Hgoto_error(1);
+ }
+ mirr_fapl_id = H5I_INVALID_HID;
+ }
+
+ /* ============ */
+ /* Fork process */
+ /* ============ */
+ if (UC_opts.launch == UC_READWRITE) {
+ if ((childpid = HDfork()) < 0) {
+ HDperror("fork");
+ Hgoto_error(1);
+ }
+ }
+ mypid = HDgetpid();
+
+ /* ============= */
+ /* launch reader */
+ /* ============= */
+ if (UC_opts.launch != UC_WRITER) {
+ /* child process -- launch the reader */
+ /* reader only opens the one file -- separate reader needed for mirrored file 'shinano.h5' */
+ if (0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+
+ UC_opts.fapl_id = H5P_DEFAULT;
+ if (read_uc_file(send_wait, &UC_opts) < 0) {
+ HDfprintf(stderr, "read_uc_file encountered error (%d)\n", mypid);
+ HDexit(1);
+ }
+
+ HDexit(0);
+ }
+ }
+
+ /* ============= */
+ /* launch writer */
+ /* ============= */
+ /* this process continues to launch the writer */
+ HDprintf("%d: continue as the writer process\n", mypid);
+
+ /* Prepare mirror child driver */
+ mirr_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (mirr_fapl_id == H5I_INVALID_HID) {
+ HDfprintf(stderr, "can't create creation mirror FAPL\n");
+ Hgoto_error(1);
+ }
+ if (H5Pset_fapl_mirror(mirr_fapl_id, &mirr_fa) < 0) {
+ HDfprintf(stderr, "can't set creation mirror FAPL\n");
+ H5Eprint2(H5E_DEFAULT, stdout);
+ Hgoto_error(1);
+ }
+
+ /* Prepare parent "splitter" driver in UC_opts */
+ split_fa.wo_fapl_id = mirr_fapl_id;
+ split_fa.rw_fapl_id = H5P_DEFAULT;
+ UC_opts.fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (UC_opts.fapl_id == H5I_INVALID_HID) {
+ HDfprintf(stderr, "can't create creation FAPL\n");
+ Hgoto_error(1);
+ }
+ if (H5Pset_fapl_splitter(UC_opts.fapl_id, &split_fa) < 0) {
+ HDfprintf(stderr, "can't set creation FAPL\n");
+ H5Eprint2(H5E_DEFAULT, stdout);
+ Hgoto_error(1);
+ }
+
+ if (UC_opts.use_swmr) {
+ if (H5Pset_libver_bounds(UC_opts.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+ HDfprintf(stderr, "can't set write FAPL libver bounds\n");
+ Hgoto_error(1);
+ }
+ }
+
+ if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), UC_opts.fapl_id)) < 0) {
+ HDfprintf(stderr, "H5Fopen failed\n");
+ Hgoto_error(1);
+ }
+
+ if (write_uc_file(send_wait, fid, &UC_opts) < 0) {
+ HDfprintf(stderr, "write_uc_file encountered error\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "Failed to close write\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Pclose(UC_opts.fapl_id) < 0) {
+ HDfprintf(stderr, "can't close write FAPL\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Pclose(mirr_fapl_id) < 0) {
+ HDfprintf(stderr, "can't close write mirror FAPL\n");
+ Hgoto_error(1);
+ }
+
+ /* ================================================ */
+ /* If readwrite, collect exit code of child process */
+ /* ================================================ */
+ if (UC_opts.launch == UC_READWRITE) {
+ if ((tmppid = HDwaitpid(childpid, &child_status, child_wait_option)) < 0) {
+ HDperror("waitpid");
+ Hgoto_error(1);
+ }
+
+ if (WIFEXITED(child_status)) {
+ if ((child_ret_value = WEXITSTATUS(child_status)) != 0) {
+ HDprintf("%d: child process exited with non-zero code (%d)\n",
+ mypid, child_ret_value);
+ Hgoto_error(2);
+ }
+ } else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
+ }
+
+done:
+ if (ret_value != 0) {
+ HDprintf("Error(s) encountered\n");
+ } else {
+ HDprintf("All passed\n");
+ }
+
+ return(ret_value);
+}
+
+#else /* H5_HAVE_MIRROR_VFD */
+
+int
+main(void)
+{
+ HDfprintf(stderr, "Mirror VFD is not built. Skipping.\n");
+ return EXIT_SUCCESS;
+} /* end main() */
+
+#endif /* H5_HAVE_MIRROR_VFD */
+
+#else /* H5_HAVE_FORK */
+
+int
+main(void)
+{
+ HDfprintf(stderr, "Non-POSIX platform. Skipping.\n");
+ return EXIT_SUCCESS;
+} /* end main() */
+
+#endif /* H5_HAVE_FORK */
+
diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c
index 9ee37cb..2eb5a1d 100644
--- a/test/use_append_mchunks.c
+++ b/test/use_append_mchunks.c
@@ -29,14 +29,14 @@
* finishes HDF5 metadata updates and issues H5Fflush or H5Oflush calls.
* o Readers will see newly appended data after the Writer finishes
* the flush operation.
- *
+ *
* Preconditions:
* o Readers are not allowed to modify the file.
* o All datasets that are modified by the Writer exist when the
* Writer opens the file.
* o All datasets that are modified by the Writer exist when a Reader
* opens the file.
- *
+ *
* Main Success Scenario:
* 1. An application creates a file with required objects (groups,
* datasets, and attributes).
@@ -45,7 +45,7 @@
* spans several chunks.
* 3. A Reader opens the file and a dataset in a file; if the size of
* the unlimited dimension has changed, reads the appended data back.
- *
+ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Created: Albert Cheng, 2013/6/1 */
@@ -61,46 +61,45 @@
#include "use.h"
-/* Global Variable definitions */
-options_t UC_opts; /* Use Case Options */
-const char *progname_g="use_append_mchunks"; /* program name */
+#define USE_APPEND_MCHUNKS_PROGNAME "use_append_mchunks"
+
+static options_t UC_opts; /* Use Case Options */
/* Setup parameters for the use case.
* Return: 0 succeed; -1 fail.
*/
-int setup_parameters(int argc, char * const argv[])
+int
+setup_parameters(int argc, char * const argv[], options_t * opts)
{
/* use case defaults */
- HDmemset(&UC_opts, 0, sizeof(options_t));
- UC_opts.chunksize = Chunksize_DFT;
- UC_opts.use_swmr = 1; /* use swmr open */
- UC_opts.iterations = 1;
- UC_opts.chunkplanes = 1;
-
- /* parse options */
- if (parse_option(argc, argv) < 0){
- return(-1);
+ HDmemset(opts, 0, sizeof(options_t));
+ opts->chunksize = Chunksize_DFT;
+ opts->use_swmr = 1; /* use swmr open */
+ opts->iterations = 1;
+ opts->chunkplanes = 1;
+ opts->progname = USE_APPEND_MCHUNKS_PROGNAME;
+ opts->fapl_id = H5I_INVALID_HID;
+
+ if (parse_option(argc, argv, opts) < 0) {
+ return(-1);
}
- /* set chunk dims */
- UC_opts.chunkdims[0] = (hsize_t)UC_opts.chunkplanes;
- UC_opts.chunkdims[1] = UC_opts.chunkdims[2] = (hsize_t)UC_opts.chunksize;
- /* set dataset initial and max dims */
- UC_opts.dims[0] = 0;
- UC_opts.max_dims[0] = H5S_UNLIMITED;
- UC_opts.dims[1] = UC_opts.dims[2] = UC_opts.max_dims[1] = UC_opts.max_dims[2] = 2 * (hsize_t)UC_opts.chunksize;
+ opts->chunkdims[0] = (hsize_t)opts->chunkplanes;
+ opts->chunkdims[1] = opts->chunkdims[2] = (hsize_t)opts->chunksize;
- /* set nplanes */
- if (UC_opts.nplanes == 0)
- UC_opts.nplanes = 2 * (hsize_t)UC_opts.chunksize;
+ opts->dims[0] = 0;
+ opts->max_dims[0] = H5S_UNLIMITED;
+ opts->dims[1] = opts->dims[2] = opts->max_dims[1] = opts->max_dims[2] = 2 * (hsize_t)opts->chunksize;
- /* show parameters and return */
- show_parameters();
+ if (opts->nplanes == 0)
+ opts->nplanes = 2 * (hsize_t)opts->chunksize;
+
+ show_parameters(opts);
return(0);
-}
+} /* end setup_parameters() */
-/* Overall Algorithm:
+/* Overall Algorithm:
* Parse options from user;
* Generate/pre-created test files needed and close it;
* fork: child process becomes the reader process;
@@ -112,19 +111,20 @@ main(int argc, char *argv[])
{
pid_t childpid=0;
pid_t mypid, tmppid;
- int child_status;
+ int child_status;
int child_wait_option=0;
int ret_value = 0;
int child_ret_value;
hbool_t send_wait = 0;
+ hid_t fapl = -1; /* File access property list */
+ hid_t fid = -1; /* File ID */
- /* initialization */
- if (setup_parameters(argc, argv) < 0){
- Hgoto_error(1);
+ if (setup_parameters(argc, argv, &UC_opts) < 0) {
+ Hgoto_error(1);
}
/* Determine the need to send/wait message file*/
- if(UC_opts.launch == UC_READWRITE) {
+ if (UC_opts.launch == UC_READWRITE) {
HDunlink(WRITER_MESSAGE);
send_wait = 1;
}
@@ -134,82 +134,136 @@ main(int argc, char *argv[])
/* UC_WRITER: create datafile, skip reader, launch writer. */
/* UC_READER: skip create, launch reader, exit. */
/* ==============================================================*/
- /* ============*/
+ /* =========== */
/* Create file */
- /* ============*/
- if (UC_opts.launch != UC_READER){
- printf("Creating skeleton data file for test...\n");
- if (create_uc_file() < 0){
- fprintf(stderr, "***encounter error\n");
- Hgoto_error(1);
- }else
- printf("File created.\n");
+ /* =========== */
+ if (UC_opts.launch != UC_READER) {
+ HDprintf("Creating skeleton data file for test...\n");
+ if ((UC_opts.fapl_id = h5_fileaccess()) < 0) {
+ HDfprintf(stderr, "can't create creation FAPL\n");
+ Hgoto_error(1);
+ }
+ if (H5Pset_libver_bounds(UC_opts.fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+ HDfprintf(stderr, "can't set creation FAPL libver bounds\n");
+ Hgoto_error(1);
+ }
+ if (create_uc_file(&UC_opts) < 0) {
+ HDfprintf(stderr, "***encounter error\n");
+ Hgoto_error(1);
+ } else {
+ HDprintf("File created.\n");
+ }
+ /* Close FAPL to prevent issues with forking later */
+ if (H5Pclose(UC_opts.fapl_id) < 0) {
+ HDfprintf(stderr, "can't close creation FAPL\n");
+ Hgoto_error(1);
+ }
+ UC_opts.fapl_id = H5I_INVALID_HID;
}
- if (UC_opts.launch==UC_READWRITE){
- /* fork process */
- if((childpid = fork()) < 0) {
- perror("fork");
- Hgoto_error(1);
- };
- };
+ /* ============ */
+ /* Fork process */
+ /* ============ */
+ if (UC_opts.launch==UC_READWRITE) {
+ if ((childpid = fork()) < 0) {
+ perror("fork");
+ Hgoto_error(1);
+ }
+ }
mypid = getpid();
/* ============= */
/* launch reader */
/* ============= */
- if (UC_opts.launch != UC_WRITER){
- /* child process launch the reader */
- if(0 == childpid) {
- printf("%d: launch reader process\n", mypid);
- if (read_uc_file(send_wait) < 0){
- fprintf(stderr, "read_uc_file encountered error\n");
- exit(1);
- }
- exit(0);
- }
+ if (UC_opts.launch != UC_WRITER) {
+ /* child process launch the reader */
+ if (0 == childpid) {
+ HDprintf("%d: launch reader process\n", mypid);
+ if ((UC_opts.fapl_id = h5_fileaccess()) < 0) {
+ HDfprintf(stderr, "can't create read FAPL\n");
+ HDexit(EXIT_FAILURE);
+ }
+ if (read_uc_file(send_wait, &UC_opts) < 0) {
+ HDfprintf(stderr, "read_uc_file encountered error\n");
+ HDexit(EXIT_FAILURE);
+ }
+ if (H5Pclose(UC_opts.fapl_id) < 0) {
+ HDfprintf(stderr, "can't close read FAPL\n");
+ HDexit(EXIT_FAILURE);
+ }
+ HDexit(EXIT_SUCCESS);
+ }
}
/* ============= */
/* launch writer */
/* ============= */
/* this process continues to launch the writer */
- printf("%d: continue as the writer process\n", mypid);
- if (write_uc_file(send_wait) < 0){
- fprintf(stderr, "write_uc_file encountered error\n");
- Hgoto_error(1);
+ HDprintf("%d: continue as the writer process\n", mypid);
+
+ /* Set the file access property list */
+ if ((fapl = h5_fileaccess()) < 0) {
+ HDfprintf(stderr, "can't get write FAPL\n");
+ Hgoto_error(1);
+ }
+
+ if (UC_opts.use_swmr) {
+ if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
+ HDfprintf(stderr, "can't set write FAPL libver bounds\n");
+ Hgoto_error(1);
+ }
+ }
+
+ if ((fid = H5Fopen(UC_opts.filename, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0) {
+ HDfprintf(stderr, "H5Fopen failed\n");
+ Hgoto_error(1);
+ }
+
+ if (write_uc_file(send_wait, fid, &UC_opts) < 0) {
+ HDfprintf(stderr, "write_uc_file encountered error\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "Failed to close file id\n");
+ Hgoto_error(1);
+ }
+
+ if (H5Pclose(fapl) < 0) {
+ HDfprintf(stderr, "can't close write FAPL\n");
+ Hgoto_error(1);
}
/* ================================================ */
/* If readwrite, collect exit code of child process */
/* ================================================ */
- if (UC_opts.launch == UC_READWRITE){
- if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0){
- perror("waitpid");
- Hgoto_error(1);
- }
- if (WIFEXITED(child_status)){
- if ((child_ret_value=WEXITSTATUS(child_status)) != 0){
- printf("%d: child process exited with non-zero code (%d)\n",
- mypid, child_ret_value);
- Hgoto_error(2);
- }
- } else {
- printf("%d: child process terminated abnormally\n", mypid);
- Hgoto_error(2);
- }
+ if (UC_opts.launch == UC_READWRITE) {
+ if ((tmppid = waitpid(childpid, &child_status, child_wait_option)) < 0) {
+ perror("waitpid");
+ Hgoto_error(1);
+ }
+
+ if (WIFEXITED(child_status)) {
+ if ((child_ret_value=WEXITSTATUS(child_status)) != 0) {
+ HDprintf("%d: child process exited with non-zero code (%d)\n",
+ mypid, child_ret_value);
+ Hgoto_error(1);
+ }
+ } else {
+ HDprintf("%d: child process terminated abnormally\n", mypid);
+ Hgoto_error(2);
+ }
}
-
+
done:
- /* Print result and exit */
- if (ret_value != 0){
- printf("Error(s) encountered\n");
- }else{
- printf("All passed\n");
+ if (ret_value != 0) {
+ HDprintf("Error(s) encountered\n");
+ } else {
+ HDprintf("All passed\n");
}
return(ret_value);
-}
+} /* end main() */
#else /* H5_HAVE_FORK */
diff --git a/test/use_common.c b/test/use_common.c
index 5aa6692..7e19167 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -21,10 +21,11 @@
#include "use.h"
-#define H5D_FRIEND /*suppress error about including H5Dpkg */
-#define H5D_TESTING
-#include "H5Dpkg.h"
-
+/* ----------------------------------------------------------------------------
+ * Print a common/shared usage message.
+ * Receives program name to show default test file name (<program_name>.h5).
+ * ----------------------------------------------------------------------------
+ */
void
usage(const char *prog)
{
@@ -41,10 +42,13 @@ usage(const char *prog)
HDfprintf(stderr, "\n");
} /* end usage() */
-/* Setup Use Case parameters by parsing command line options.
-* Setup default values if not set by options. */
+/* ----------------------------------------------------------------------------
+ * Setup Use Case parameters by parsing command line options.
+ * Includes default values for unspecified options.
+ * ----------------------------------------------------------------------------
+ */
int
-parse_option(int argc, char * const argv[])
+parse_option(int argc, char * const argv[], options_t * opts)
{
int ret_value=0;
int c;
@@ -56,391 +60,373 @@ parse_option(int argc, char * const argv[])
/* suppress getopt from printing error */
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 */
- use_swmr = HDatoi(optarg);
- if (use_swmr != 0 && use_swmr != 1) {
- HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
- usage(progname_g);
+ while (1) {
+ c = getopt(argc, argv, nagg_options);
+ if (-1 == c)
+ break;
+ switch (c) {
+ case 'h':
+ usage(opts->progname);
+ exit(EXIT_SUCCESS);
+ break;
+ case 'f': /* usecase data file name */
+ opts->filename = HDstrdup(optarg);
+ break;
+ case 'i': /* iterations */
+ if ((opts->iterations = HDatoi(optarg)) <= 0) {
+ HDfprintf(stderr, "bad iterations number %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case 'l': /* launch reader or writer only */
+ switch (*optarg) {
+ case 'r': /* reader only */
+ opts->launch = UC_READER;
+ break;
+ case 'w': /* writer only */
+ opts->launch = UC_WRITER;
+ break;
+ default:
+ HDfprintf(stderr, "launch value(%c) should be w or r only.\n", *optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ break;
+ } /* end switch (reader/writer-only mode toggle) */
+ break;
+ case 'n': /* number of planes to write/read */
+ if ((opts->nplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case 's': /* use swmr file open mode */
+ use_swmr = HDatoi(optarg);
+ if (use_swmr != 0 && use_swmr != 1) {
+ HDfprintf(stderr, "swmr value should be 0(no) or 1(yes)\n");
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ opts->use_swmr = (hbool_t)use_swmr;
+ break;
+ case 'y': /* Number of planes per chunk */
+ if ((opts->chunkplanes = HDstrtoul(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad number of planes per chunk %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case 'z': /* size of chunk=(z,z) */
+ if ((opts->chunksize = HDstrtoull(optarg, NULL, 0)) <= 0) {
+ HDfprintf(stderr, "bad chunksize %s, must be a positive integer\n", optarg);
+ usage(opts->progname);
+ Hgoto_error(-1);
+ }
+ break;
+ case '?':
+ HDfprintf(stderr, "getopt returned '%c'.\n", c);
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);
- }
- }
+ default:
+ HDfprintf(stderr, "getopt returned unexpected value.\n");
+ HDfprintf(stderr, "Unexpected value is %d\n", c);
+ Hgoto_error(-1);
+ } /* end switch (argument symbol) */
+ } /* end while (there are still arguments) */
/* 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");
+ if (!opts->filename) {
+ /* default data file name is <progname>.h5 */
+ if ((opts->filename=(char*)HDmalloc(HDstrlen(opts->progname)+4))==NULL) {
+ HDfprintf(stderr, "malloc: failed\n");
+ Hgoto_error(-1);
+ }
+ HDstrcpy(opts->filename, opts->progname);
+ HDstrcat(opts->filename, ".h5");
}
done:
- /* All done. */
return(ret_value);
-}
-
-/* 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],
- (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],
- (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");
-}
-
-/* Create the skeleton use case file for testing.
+} /* end parse_option() */
+
+/* ----------------------------------------------------------------------------
+ * Show parameters used for this use case.
+ * ----------------------------------------------------------------------------
+ */
+void
+show_parameters(options_t * opts)
+{
+ HDprintf("===Parameters used:===\n");
+ HDprintf("chunk dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->chunkdims[0],
+ (unsigned long long)opts->chunkdims[1], (unsigned long long)opts->chunkdims[2]);
+ HDprintf("dataset max dims=(%llu, %llu, %llu)\n", (unsigned long long)opts->max_dims[0],
+ (unsigned long long)opts->max_dims[1], (unsigned long long)opts->max_dims[2]);
+ HDprintf("number of planes to write=%llu\n", (unsigned long long)opts->nplanes);
+ HDprintf("using SWMR mode=%s\n", opts->use_swmr ? "yes(1)" : "no(0)");
+ HDprintf("data filename=%s\n", opts->filename);
+ HDprintf("launch part=");
+ switch (opts->launch) {
+ case UC_READWRITE:
+ HDprintf("Reader/Writer\n");
+ break;
+ case UC_WRITER:
+ HDprintf("Writer\n");
+ break;
+ case UC_READER:
+ HDprintf("Reader\n");
+ break;
+ default:
+ /* should not happen */
+ HDprintf("Illegal part(%d)\n", opts->launch);
+ }
+ HDprintf("number of iterations=%d (not used yet)\n", opts->iterations);
+ HDprintf("===Parameters shown===\n");
+} /* end show_parameters() */
+
+/* ----------------------------------------------------------------------------
+ * Create the skeleton use case file for testing.
* It has one 3d dataset using chunked storage.
* The dataset is (unlimited, chunksize, chunksize).
* Dataset type is 2 bytes integer.
* It starts out "empty", i.e., first dimension is 0.
*
* Return: 0 succeed; -1 fail.
+ * ----------------------------------------------------------------------------
*/
-int create_uc_file(void)
+int
+create_uc_file(options_t * opts)
{
- 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 */
- hid_t dsid; /* Dataset ID */
- hid_t fapl; /* File access property list */
+ 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 */
+ hid_t dsid; /* Dataset ID */
H5D_chunk_index_t idx_type; /* Chunk index type */
- /* Create the file */
- if((fapl = h5_fileaccess()) < 0)
- return -1;
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- if((fid = H5Fcreate(UC_opts.filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if ((fid = H5Fcreate(opts->filename, H5F_ACC_TRUNC, H5P_DEFAULT, opts->fapl_id)) < 0)
return -1;
/* Set up dimension sizes */
dims[0] = 0;
- dims[1] = dims[2] = UC_opts.max_dims[1];
+ dims[1] = dims[2] = opts->max_dims[1];
/* Create dataspace for creating datasets */
- if((sid = H5Screate_simple(3, dims, UC_opts.max_dims)) < 0)
+ if ((sid = H5Screate_simple(3, dims, opts->max_dims)) < 0)
return -1;
/* Create dataset creation property list */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
return -1;
- if(H5Pset_chunk(dcpl, 3, UC_opts.chunkdims) < 0)
+ if (H5Pset_chunk(dcpl, 3, opts->chunkdims) < 0)
return -1;
/* create dataset of progname */
- if((dsid = H5Dcreate2(fid, progname_g, UC_DATATYPE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- return -1;
+ if ((dsid = H5Dcreate2(fid, opts->progname, UC_DATATYPE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ return -1;
/* Check that the chunk index type is not version 1 B-tree.
* Version 1 B-trees are not supported under SWMR.
*/
- if(H5D__layout_idx_type_test(dsid, &idx_type) < 0)
+ if (H5Dget_chunk_index_type(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");
+ if (idx_type == H5D_CHUNK_IDX_BTREE) {
+ HDfprintf(stderr, "ERROR: Chunk index is version 1 B-tree: aborting.\n");
return -1;
}
/* Close everything */
- if(H5Dclose(dsid) < 0)
- return -1;
- if(H5Pclose(fapl) < 0)
+ if (H5Dclose(dsid) < 0)
return -1;
- if(H5Pclose(dcpl) < 0)
+ if (H5Pclose(dcpl) < 0)
return -1;
- if(H5Sclose(sid) < 0)
+ if (H5Sclose(sid) < 0)
return -1;
- if(H5Fclose(fid) < 0)
+ if (H5Fclose(fid) < 0)
return -1;
return 0;
-}
+} /* end create_uc_file() */
-/* Append planes, each of (1,2*chunksize,2*chunksize) to the dataset.
+/* ----------------------------------------------------------------------------
+ * 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 plan with the plane number and then write it at the nth plane.
* Increase the plane number and repeat till the end of dataset, when it
* reaches chunksize long. End product is a (2*chunksize)^3 cube.
*
* Return: 0 succeed; -1 fail.
+ * ----------------------------------------------------------------------------
*/
-int write_uc_file(hbool_t tosend)
+int
+write_uc_file(hbool_t tosend, hid_t file_id, options_t * opts)
{
- 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=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;
-
- name = UC_opts.filename;
-
- /* Open the file */
- if((fapl = h5_fileaccess()) < 0)
- return -1;
- if(UC_opts.use_swmr)
- if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- return -1;
- if((fid = H5Fopen(name, H5F_ACC_RDWR | (UC_opts.use_swmr ? H5F_ACC_SWMR_WRITE : 0), fapl)) < 0){
- fprintf(stderr, "H5Fopen failed\n");
- return -1;
- }
-
- if(tosend)
+ hid_t dsid; /* dataset ID */
+ hid_t dcpl; /* Dataset creation property list */
+ UC_CTYPE *buffer, *bufptr; /* data buffer */
+ hsize_t cz=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 (TRUE == tosend) {
/* Send a message that H5Fopen is complete--releasing the file lock */
h5_send_message(WRITER_MESSAGE, NULL, NULL);
+ }
/* Open the dataset of the program name */
- if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Dopen2 failed\n");
- return -1;
+ if ((dsid = H5Dopen2(file_id, opts->progname, H5P_DEFAULT)) < 0) {
+ 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;
+ if ((dcpl = H5Dget_create_plist(dsid)) < 0) {
+ 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;
+ if (H5D_CHUNKED != H5Pget_layout(dcpl)) {
+ 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;
+ if ((rank = H5Pget_chunk(dcpl, 3, chunk_dims)) != 3) {
+ 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],
+ if (chunk_dims[0]!=opts->chunkdims[0] || chunk_dims[1] != cz || chunk_dims[2] != cz) {
+ 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 */
memdims[0]=1;
- memdims[1] = UC_opts.dims[1];
- memdims[2] = UC_opts.dims[2];
+ memdims[1] = opts->dims[1];
+ memdims[2] = 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;
+ }
/*
* Get dataset rank and dimension.
*/
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;
+ if (rank != UC_RANK) {
+ 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;
+ if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) {
+ 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],
+ if (dims[0] != 0 || dims[1] != memdims[1] || dims[2] != memdims[2]) {
+ 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;
- };
+ if ((m_sid=H5Screate_simple(rank, memdims, NULL))<0) {
+ HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ return -1;
+ }
/* write planes */
count[0]=1;
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;
+ for (i=0; i < 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;
+ }
+ }
/* 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");
+ if (opts->use_swmr) {
+ if (H5Odisable_mdc_flushes(dsid) < 0) {
+ HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n");
return -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");
+ /* extend the dataset by one for new plane */
+ dims[0]=i+1;
+ if (H5Dset_extent(dsid, dims) < 0) {
+ 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");
+ if ((f_sid = H5Dget_space(dsid)) < 0) {
+ 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");
+ if (H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0) {
+ 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");
+ if (H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0) {
+ 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");
+ if (opts->use_swmr) {
+ if (H5Oenable_mdc_flushes(dsid) < 0) {
+ 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;
+ }
+ } /* end for each plane to write */
/* Done writing. Free/Close all resources including data file */
HDfree(buffer);
- if (H5Dclose(dsid) < 0){
- fprintf(stderr, "Failed to close datasete\n");
- return -1;
- }
- if (H5Sclose(m_sid) < 0){
- fprintf(stderr, "Failed to close memory space\n");
- return -1;
- }
- if (H5Sclose(f_sid) < 0){
- fprintf(stderr, "Failed to close file space\n");
- return -1;
+ if (H5Dclose(dsid) < 0) {
+ HDfprintf(stderr, "Failed to close datasete\n");
+ return -1;
}
- if (H5Pclose(fapl) < 0){
- fprintf(stderr, "Failed to property list\n");
- return -1;
+ if (H5Sclose(m_sid) < 0) {
+ HDfprintf(stderr, "Failed to close memory space\n");
+ return -1;
}
- if (H5Fclose(fid) < 0){
- fprintf(stderr, "Failed to close file id\n");
- return -1;
+ if (H5Sclose(f_sid) < 0) {
+ HDfprintf(stderr, "Failed to close file space\n");
+ return -1;
}
return 0;
-}
-
+} /* end write_uc_file() */
-/* Read planes from the dataset.
+/* ----------------------------------------------------------------------------
+ * Read planes from the dataset.
* It expects the dataset is being changed (growing).
* It checks the unlimited dimension (1st one). When it increases,
* it will read in the new planes, one by one, and verify the data correctness.
@@ -449,61 +435,51 @@ int write_uc_file(hbool_t tosend)
* that is the expected end of data, the reader exits.
*
* Return: 0 succeed; -1 fail.
+ * ----------------------------------------------------------------------------
*/
-int read_uc_file(hbool_t towait)
+int
+read_uc_file(hbool_t towait, options_t * opts)
{
- 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 */
+ 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, nplanes_seen=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 loops_waiting_for_plane;
/* Before reading, wait for the message that H5Fopen is complete--file lock is released */
- if(towait && h5_wait_message(WRITER_MESSAGE) < 0) {
- fprintf(stderr, "Cannot find writer message file...failed\n");
+ if (towait && h5_wait_message(WRITER_MESSAGE) < 0) {
+ HDfprintf(stderr, "Cannot find writer message file...failed\n");
return -1;
}
- name = UC_opts.filename;
-
- /* Open the file */
- if((fapl = h5_fileaccess()) < 0)
- return -1;
- if((fid = H5Fopen(name, H5F_ACC_RDONLY | (UC_opts.use_swmr ? H5F_ACC_SWMR_READ : 0), fapl)) < 0){
- fprintf(stderr, "H5Fopen failed\n");
+ HDfprintf(stderr, "Opening to read %s\n", opts->filename);
+ if ((fid = H5Fopen(opts->filename, H5F_ACC_RDONLY | (opts->use_swmr ? H5F_ACC_SWMR_READ : 0), opts->fapl_id)) < 0) {
+ HDfprintf(stderr, "H5Fopen failed\n");
return -1;
}
- if (H5Pclose(fapl) < 0){
- fprintf(stderr, "Failed to property list\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;
+ if ((dsid = H5Dopen2(fid, opts->progname, H5P_DEFAULT)) < 0) {
+ HDfprintf(stderr, "H5Dopen2 failed\n");
+ return -1;
}
- /* allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
- memdims[0]=1;
- memdims[1] = UC_opts.dims[1];
- memdims[2] = UC_opts.dims[2];
+ /* Allocate space for data buffer 1 X dims[1] X dims[2] of UC_CTYPE */
+ memdims[0] = 1;
+ memdims[1] = opts->dims[1];
+ memdims[2] = 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;
+ }
/*
* Get dataset rank and dimension.
@@ -511,145 +487,132 @@ int read_uc_file(hbool_t towait)
*/
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;
+ if (rank != UC_RANK) {
+ 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;
+ if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0) {
+ 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]),
- (unsigned long long)(dims[2]));
+ 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[1] != memdims[1] || dims[2] != memdims[2]){
- fprintf(stderr, "dataset dimension is not as expected. Got dims=(%llu,%llu,%llu)\n",
- (unsigned long long)dims[0], (unsigned long long)dims[1],
+ if (dims[1] != memdims[1] || dims[2] != memdims[2]) {
+ HDfprintf(stderr, "dataset dimension is not as expected. Got dims=(%llu,%llu,%llu)\n",
+ (unsigned long long)dims[0], (unsigned long long)dims[1],
(unsigned long long)dims[2]);
- fprintf(stderr, "But memdims=(%llu,%llu,%llu)\n",
- (unsigned long long)memdims[0], (unsigned long long)memdims[1],
+ HDfprintf(stderr, "But memdims=(%llu,%llu,%llu)\n",
+ (unsigned long long)memdims[0], (unsigned long long)memdims[1],
(unsigned long long)memdims[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;
- };
- /* Read 1 plane at a time whenever the dataset grows larger
- * (along dim[0]) */
- count[0]=1;
- count[1]=dims[1];
- count[2]=dims[2];
+ /* Setup mem-space for buffer */
+ if ((m_sid=H5Screate_simple(rank, memdims, NULL)) < 0) {
+ HDfprintf(stderr, "H5Screate_simple for memory failed\n");
+ return -1;
+ }
+
+ /* Read 1 plane at a time whenever the dataset grows larger (along dim[0]) */
+ count[0] = 1;
+ count[1] = dims[1];
+ count[2] = dims[2];
/* 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){
- /* end the previous message */
- printf("\n");
- nonewplane=0;
- }
- printf("reading planes %llu to %llu\n", (unsigned long long)nplane_old,
+ loops_waiting_for_plane=0;
+ while (nplanes_seen < opts->nplanes) {
+ /* print progress message according to if new planes are availalbe */
+ if (nplanes_seen < dims[0]) {
+ if (loops_waiting_for_plane) {
+ /* end the previous message */
+ HDprintf("\n");
+ loops_waiting_for_plane=0;
+ }
+ HDprintf("reading planes %llu to %llu\n", (unsigned long long)nplanes_seen,
(unsigned long long)dims[0]);
- }else{
- if (nonewplane){
- printf(".");
- if (nonewplane>=30){
- fprintf(stderr, "waited too long for new plane, quit.\n");
- return -1;
- }
- }else{
- /* print mesg only the first time; dots still no new plane */
- printf("no new planes to read ");
- }
- 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){
- fprintf(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){
- fprintf(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){
- fprintf(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++){
- for (k=0; k<dims[2]; k++){
- if ((hsize_t)*bufptr++ != nplane){
- if (++nerrs < ErrorReportMax){
- fprintf(stderr,
- "found error %llu plane(%llu,%llu), expected %llu, got %d\n",
- (unsigned long long)nplane, (unsigned long long)j,
+ }
+ else {
+ if (loops_waiting_for_plane) {
+ HDprintf(".");
+ if (loops_waiting_for_plane>=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("waiting for new planes to read ");
+ }
+ loops_waiting_for_plane++;
+ /* pause for a second */
+ HDsleep(1);
+ }
+
+ for (nplane=nplanes_seen; 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) {
+ 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) {
+ 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++) {
+ 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)k, (unsigned long long)nplane, (int)*(bufptr-1));
- }
- }
- }
- }
- if (nerrs){
- nreadererr++;
- fprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
+ } /* end if should print error */
+ } /* end if value mismatch */
+ } /* end for plane second dimension */
+ } /* end for plane first dimension */
+ if (nerrs) {
+ nreadererr++;
+ HDfprintf(stderr, "found %d unexpected values in plane %llu\n", nerrs,
(unsigned long long)nplane);
- }
- }
- /* Have read all current planes */
- nplane_old=dims[0];
-
- /* check if dataset has grown since last time */
-#if 0
- /* close dsid and file, then reopen them */
- if (H5Dclose(dsid) < 0){
- fprintf(stderr, "H5Dclose failed\n");
- return -1;
- }
- if (H5Fclose(fid) < 0){
- fprintf(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){
- fprintf(stderr, "H5Fopen failed\n");
- return -1;
- }
- if((dsid = H5Dopen2(fid, progname_g, H5P_DEFAULT)) < 0){
- fprintf(stderr, "H5Dopen2 failed\n");
- return -1;
- }
-#else
- H5Drefresh(dsid);
-#endif
- f_sid = H5Dget_space(dsid); /* Get filespace handle first. */
- if (H5Sget_simple_extent_dims(f_sid, dims, NULL) < 0){
- fprintf(stderr, "H5Sget_simple_extent_dims got error\n");
- return -1;
- }
+ }
+ } /* end for each plane added since last read */
+
+ nplanes_seen=dims[0];
+
+ /* check if dataset has grown since last time (update dims) */
+ H5Drefresh(dsid);
+ 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;
+ }
+ } /* end while (expecting more planes to read) */
+
+ if (H5Fclose(fid) < 0) {
+ HDfprintf(stderr, "H5Fclose failed\n");
+ return -1;
}
if (nreadererr)
- return -1;
+ return -1;
else
- return 0;
-}
+ return 0;
+} /* end read_uc_file() */
#endif /* H5_HAVE_FORK */
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 340f578..32a8244 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 = atoi(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 = atoi(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 = atoi(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 = atoi(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 = (hsize_t)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,55 +162,55 @@ 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;
- chunkdims_g[1]= chunkdims_g[2] = chunksize_g;
+ chunkdims_g[0] = (hsize_t)chunkplanes_g;
+ chunkdims_g[1]= chunkdims_g[2] = (hsize_t)chunksize_g;
/* set dataset initial and max dims */
dims_g[0] = 0;
max_dims_g[0] = H5S_UNLIMITED;
- dims_g[1] = dims_g[2] = max_dims_g[1] = max_dims_g[2] = chunksize_g;
+ dims_g[1] = dims_g[2] = max_dims_g[1] = max_dims_g[2] = (hsize_t)chunksize_g;
/* set nplanes */
if (nplanes_g == 0)
- nplanes_g = chunksize_g;
+ nplanes_g = (hsize_t)chunksize_g;
/* show parameters and return */
show_parameters();
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=(hsize_t)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,87 @@ 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++) {
+ if(i > SHRT_MAX) {
+ HDfprintf(stderr, "rank(%d) of dataset overflow\n", rank);
+ return -1;
+ }
+ *bufptr++ = (short)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 +498,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 +510,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 +545,7 @@ int
main(void)
{
HDfprintf(stderr, "Non-POSIX platform. Skipping.\n");
- return EXIT_SUCCESS;
+ HDexit(EXIT_SUCCESS);
} /* end main() */
#endif /* H5_HAVE_FORK */
diff --git a/test/vds.c b/test/vds.c
index c9b7a1b..c4d1391 100644
--- a/test/vds.c
+++ b/test/vds.c
@@ -36,6 +36,12 @@ const char *FILENAME[] = {
"vds_src_1",
"vds%%_src",
"vds_dapl",
+ "vds_virt_2",
+ "vds_virt_3",
+ "vds_src_2",
+ "vds_src_3",
+ "vds%%_src2",
+ "vds_dapl2",
NULL
};
@@ -49,6 +55,8 @@ const char *FILENAME[] = {
#define FILENAME_BUF_SIZE 1024
+#define TMPDIR "tmp_vds/"
+
/*-------------------------------------------------------------------------
* Function: vds_select_equal
@@ -57,14 +65,7 @@ const char *FILENAME[] = {
* provided dataspaces are the same.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Monday, March 2, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static htri_t
@@ -114,7 +115,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(npoints1 != npoints2)
return FALSE;
- /* Allocate point lists. Do not return directly afer
+ /* Allocate point lists. Do not return directly after
* allocating, to make sure buffers are freed. */
if(NULL == (buf1 = (hsize_t *)HDmalloc((size_t)rank1 * (size_t)npoints1 * sizeof(hsize_t))))
TEST_ERROR
@@ -130,7 +131,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(buf1[i] != buf2[i]) {
ret_value = FALSE;
break;
- } /* end if */
+ }
/* Free buffers */
HDfree(buf1);
@@ -180,7 +181,7 @@ vds_select_equal(hid_t space1, hid_t space2)
if(buf1[i] != buf2[i]) {
ret_value = FALSE;
break;
- } /* end if */
+ }
/* Free buffers */
HDfree(buf1);
@@ -217,14 +218,7 @@ error:
* parameters.
*
* Return: Success: 0
- *
* Failure: -1
- *
- * Programmer: Neil Fortner
- * Monday, March 2, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -298,8 +292,7 @@ vds_check_mapping(hid_t dcpl, size_t i, hid_t vspace, hid_t srcspace,
error:
H5E_BEGIN_TRY {
- if(space_out >= 0)
- (void)H5Sclose(space_out);
+ H5Sclose(space_out);
} H5E_END_TRY
return -1;
@@ -312,14 +305,7 @@ error:
* Purpose: Tests API functions related to virtual datasets.
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Monday, February 16, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* Helper function to get DCPL for examination depending on config */
@@ -331,7 +317,7 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
hid_t dset = -1; /* Virtual dataset */
H5D_space_status_t space_status; /* Dataset space status */
void *plist_buf = NULL; /* Serialized property list buffer */
- H5O_info_t oinfo; /* Object info struct */
+ H5O_native_info_t ninfo; /* Object info struct */
htri_t tri_ret;
HDassert((config >= TEST_API_BASIC) && (config < TEST_API_NTESTS));
@@ -370,12 +356,12 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
file = -1;
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open dataset */
if((dset = H5Dopen2(file, "vdset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get DCPL from dataset */
if((*ex_dcpl = H5Dget_create_plist(dset)) < 0)
@@ -386,23 +372,23 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
TEST_ERROR
/* Test H5Oget_info returns correct metadata size */
- if(H5Oget_info(dset, &oinfo) < 0)
+ if(H5Oget_native_info(dset, &ninfo, H5O_NATIVE_INFO_META_SIZE) < 0)
TEST_ERROR
- if(oinfo.meta_size.obj.index_size != (hsize_t)0)
+ if(ninfo.meta_size.obj.index_size != (hsize_t)0)
TEST_ERROR
if(config == TEST_API_REOPEN_FILE) {
- if(oinfo.meta_size.obj.heap_size != exp_meta_size) {
- printf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)oinfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
+ if(ninfo.meta_size.obj.heap_size != exp_meta_size) {
+ HDprintf("VDS metadata size: %llu Expected: %llu\n", (long long unsigned)ninfo.meta_size.obj.heap_size, (long long unsigned)exp_meta_size);
TEST_ERROR
- } /* end if */
- } /* end if */
+ }
+ }
else
- if((oinfo.meta_size.obj.heap_size != exp_meta_size)
- && (oinfo.meta_size.obj.heap_size != (hsize_t)0))
+ if((ninfo.meta_size.obj.heap_size != exp_meta_size)
+ && (ninfo.meta_size.obj.heap_size != (hsize_t)0))
TEST_ERROR
- if(oinfo.meta_size.attr.index_size != (hsize_t)0)
+ if(ninfo.meta_size.attr.index_size != (hsize_t)0)
TEST_ERROR
- if(oinfo.meta_size.attr.index_size != (hsize_t)0)
+ if(ninfo.meta_size.attr.index_size != (hsize_t)0)
TEST_ERROR
/* Test H5Dget_space_status */
@@ -424,21 +410,21 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
if(H5Fclose(file) < 0)
TEST_ERROR
file = -1;
- } /* end if */
+ }
else if(config == TEST_API_COPY_PLIST) {
/* Copy property list */
if((*ex_dcpl = H5Pcopy(dcpl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else if(config == TEST_API_ENCDEC_PLIST) {
size_t plist_buf_size;
/* Encode property list to plist_buf */
- if(H5Pencode(dcpl, NULL, &plist_buf_size) < 0)
+ if(H5Pencode2(dcpl, NULL, &plist_buf_size, fapl) < 0)
TEST_ERROR
if(NULL == (plist_buf = HDmalloc(plist_buf_size)))
TEST_ERROR
- if(H5Pencode(dcpl, plist_buf, &plist_buf_size) < 0)
+ if(H5Pencode2(dcpl, plist_buf, &plist_buf_size, fapl) < 0)
TEST_ERROR
/* Decode serialized property list to *ex_dcpl */
@@ -448,14 +434,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
/* Free plist_buf */
HDfree(plist_buf);
plist_buf = NULL;
- } /* end if */
+ }
else {
/* Simply copy the id to ex_dcpl and increment the ref count so ex_dcpl
* can be closed */
if(H5Iinc_ref(dcpl) < 0)
TEST_ERROR
*ex_dcpl = dcpl;
- } /* end else */
+ }
/* Verify examination DCPL is equal to original DCPL. Do not compare the
* plist to itself, and do not do the comparison if we reopened the file,
@@ -466,16 +452,14 @@ test_api_get_ex_dcpl(test_api_config_t config, hid_t fapl, hid_t dcpl,
TEST_ERROR
if(!tri_ret)
TEST_ERROR
- } /* end if */
+ }
return 0;
error:
H5E_BEGIN_TRY {
- if(file >= 0)
- (void)H5Fclose(file);
- if(dset >= 0)
- (void)H5Dclose(dset);
+ H5Fclose(file);
+ H5Dclose(dset);
} H5E_END_TRY;
if(plist_buf)
HDfree(plist_buf);
@@ -485,7 +469,7 @@ error:
/* Main test function */
static int
-test_api(test_api_config_t config, hid_t fapl)
+test_api(test_api_config_t config, hid_t fapl, H5F_libver_t low)
{
char filename[FILENAME_BUF_SIZE];
hid_t dcpl = -1; /* Dataset creation property list */
@@ -532,7 +516,7 @@ test_api(test_api_config_t config, hid_t fapl)
case TEST_API_NTESTS:
default:
TEST_ERROR
- } /* end switch */
+ }
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
@@ -634,7 +618,8 @@ test_api(test_api_config_t config, hid_t fapl)
TEST_ERROR
/* Get examination DCPL */
- if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)213) < 0)
+ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename,
+ (low >= H5F_LIBVER_V112)?(hsize_t)99:(low >= H5F_LIBVER_V110?174:213)) < 0)
TEST_ERROR
/* Test H5Pget_virtual_count */
@@ -818,7 +803,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Create virtual dataspace */
if((vspace[i] = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR
- } /* end for */
+ }
/* Select all (should not be necessary, but just to be sure) */
if(H5Sselect_all(srcspace[0]) < 0)
@@ -932,7 +917,7 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
@@ -1038,10 +1023,11 @@ test_api(test_api_config_t config, hid_t fapl)
/* Add virtual layout mapping */
if(H5Pset_virtual(dcpl, vspace[i], tmp_filename, tmp_dsetname, srcspace[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get examination DCPL */
- if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename, (hsize_t)697) < 0)
+ if(test_api_get_ex_dcpl(config, fapl, dcpl, &ex_dcpl, vspace[0], filename,
+ (low >= H5F_LIBVER_V112)?(hsize_t)607:(hsize_t)697) < 0)
TEST_ERROR
/* Test H5Pget_virtual_count */
@@ -1063,7 +1049,7 @@ test_api(test_api_config_t config, hid_t fapl)
/* Check that the mapping in the DCPL is correct */
if(vds_check_mapping(ex_dcpl, (size_t)i, vspace[i], srcspace[0], tmp_filename, tmp_dsetname) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Close */
if(H5Sclose(srcspace[0]) < 0)
@@ -1073,7 +1059,7 @@ test_api(test_api_config_t config, hid_t fapl)
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(ex_dcpl) < 0)
TEST_ERROR
ex_dcpl = -1;
@@ -1123,23 +1109,292 @@ test_api(test_api_config_t config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(ex_dcpl >= 0)
- (void)H5Pclose(ex_dcpl);
+ for(i = 0; i < (sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Pclose(dcpl);
+ H5Pclose(ex_dcpl);
} H5E_END_TRY;
return 1;
} /* end test_api() */
+/*-------------------------------------------------------------------------
+ * Function: test_vds_prefix_first
+ *
+ * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp"
+ * Should be able to access the target source files in tmp directory via the prefix set
+ * by H5Pset_virtual_prefix()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+test_vds_prefix_first(unsigned config, hid_t fapl)
+{
+ char *srcfilename = NULL;
+ char *srcfilename_map = NULL;
+ char *vfilename = NULL;
+ char *srcfilenamepct = NULL;
+ char *srcfilenamepct_map = NULL;
+ const char *srcfilenamepct_map_orig = "vds%%%%_src";
+ hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dapl = -1; /* Dataset access property list */
+ hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */
+ hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */
+ hid_t memspace = -1; /* Memory dataspace */
+ hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */
+ hid_t vdset = -1; /* Virtual dataset */
+ hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */
+ int buf[10][26]; /* Write and expected read buffer */
+ int rbuf[10][26]; /* Read buffer */
+ int fill = -1; /* Fill value */
+ int i, j;
+ char buffer[1024]; /* buffer to read vds_prefix */
+
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection")
+
+ if((srcfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((vfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilenamepct = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilenamepct_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+
+ h5_fixname(FILENAME[0], fapl, vfilename, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[8], fapl, srcfilename, FILENAME_BUF_SIZE);
+ h5_fixname_printf(FILENAME[8], fapl, srcfilename_map, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[10], fapl, srcfilenamepct, FILENAME_BUF_SIZE);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, FILENAME_BUF_SIZE);
+
+ /* create tmp directory and get current working directory path */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Initialize VDS prefix items */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, TMPDIR) < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, TMPDIR) != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /* Create source dataspace */
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Close srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ HDfree(srcfilename);
+ HDfree(srcfilename_map);
+ HDfree(vfilename);
+ HDfree(srcfilenamepct);
+ HDfree(srcfilenamepct_map);
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ } H5E_END_TRY;
+
+ if(HDsetenv("HDF5_VDS_PREFIX", "", 1) < 0)
+ TEST_ERROR
+
+ HDfree(srcfilename);
+ HDfree(srcfilename_map);
+ HDfree(vfilename);
+ HDfree(srcfilenamepct);
+ HDfree(srcfilenamepct_map);
+
+ return 1;
+} /* end test_vds_prefix */
+
/*-------------------------------------------------------------------------
* Function: test_basic_io
@@ -1148,25 +1403,18 @@ error:
* pattern-matching file/dataset strings
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Tuesday, March 3, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_basic_io(unsigned config, hid_t fapl)
{
- char srcfilename[FILENAME_BUF_SIZE];
- char srcfilename_map[FILENAME_BUF_SIZE];
- char vfilename[FILENAME_BUF_SIZE];
- char vfilename2[FILENAME_BUF_SIZE];
- char srcfilenamepct[FILENAME_BUF_SIZE];
- char srcfilenamepct_map[FILENAME_BUF_SIZE];
+ char *srcfilename = NULL;
+ char *srcfilename_map = NULL;
+ char *vfilename = NULL;
+ char *vfilename2 = NULL;
+ char *srcfilenamepct = NULL;
+ char *srcfilenamepct_map = NULL;
const char *srcfilenamepct_map_orig = "vds%%%%_src";
hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
hid_t vfile = -1; /* File with virtual dset */
@@ -1190,16 +1438,29 @@ test_basic_io(unsigned config, hid_t fapl)
int erbuf[10][26]; /* Expected read buffer */
int fill = -1; /* Fill value */
herr_t ret; /* Generic return value */
- int i, j;
+ int i, j, u, v;
TESTING("basic virtual dataset I/O")
- h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
- h5_fixname(FILENAME[1], fapl, vfilename2, sizeof vfilename2);
- h5_fixname(FILENAME[2], fapl, srcfilename, sizeof srcfilename);
- h5_fixname_printf(FILENAME[2], fapl, srcfilename_map, sizeof srcfilename_map);
- h5_fixname(FILENAME[4], fapl, srcfilenamepct, sizeof srcfilenamepct);
- h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map);
+ if((srcfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((vfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((vfilename2 = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilenamepct = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilenamepct_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+
+ h5_fixname(FILENAME[0], fapl, vfilename, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[1], fapl, vfilename2, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[2], fapl, srcfilename, FILENAME_BUF_SIZE);
+ h5_fixname_printf(FILENAME[2], fapl, srcfilename_map, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[4], fapl, srcfilenamepct, FILENAME_BUF_SIZE);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, FILENAME_BUF_SIZE);
/* Create DCPL */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
@@ -1238,12 +1499,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source dataset */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1272,8 +1533,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1287,7 +1548,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1316,7 +1577,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1400,12 +1661,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1441,8 +1702,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1456,7 +1717,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1487,7 +1748,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1536,8 +1797,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1546,7 +1807,7 @@ test_basic_io(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open v_dset2 */
if((vdset = H5Dopen2(vfile, "v_dset2", H5P_DEFAULT)) < 0)
@@ -1572,7 +1833,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Only copy to a different file if the source datasets are in a different
* file */
@@ -1614,8 +1875,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen copied virtual file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1624,7 +1885,7 @@ test_basic_io(unsigned config, hid_t fapl)
vfile2 = -1;
if((vfile2 = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Open v_dset3 */
if((vdset = H5Dopen2(vfile2, "v_dset3", H5P_DEFAULT)) < 0)
@@ -1650,13 +1911,13 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Close copied virtual file */
if(H5Fclose(vfile2) < 0)
TEST_ERROR
vfile2 = -1;
- } /* end if */
+ }
/* Close */
if(H5Dclose(srcdset[0]) < 0)
@@ -1735,12 +1996,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "%src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1782,8 +2043,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1797,7 +2058,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1828,7 +2089,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2%", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -1923,12 +2184,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -1964,8 +2225,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -1979,7 +2240,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read first source dataset through virtual dataset */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -2032,7 +2293,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -2131,12 +2392,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2164,7 +2425,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[i][j] = buf[2 * i][j];
for(/* j = 13 */; j < 26; j++)
evbuf[i][j] = buf[2 * i + 1][j - 13];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2181,7 +2442,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[i + 5][j] = buf[2 * i][j + 13];
for(/* j = 13 */; j < 26; j++)
evbuf[i + 5][j] = buf[2 * i + 1][j];
- } /* end for */
+ }
/* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -2196,8 +2457,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -2211,7 +2472,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset by hyperslab */
/* Reset rbuf */
@@ -2227,7 +2488,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[i][j] = evbuf[2 * i][j];
for(/* j = 13 */; j < 26; j++)
erbuf[i][j] = evbuf[2 * i + 1][j - 13];
- } /* end for */
+ }
/* Read second slice */
if(H5Dread(vdset, H5T_NATIVE_INT, vspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2239,7 +2500,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[i + 5][j] = evbuf[2 * i][j + 13];
for(/* j = 13 */; j < 26; j++)
erbuf[i + 5][j] = evbuf[2 * i + 1][j];
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2263,7 +2524,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[2 * i][j] = buf[i][j];
for(/* j = 13 */; j < 26; j++)
evbuf[2 * i + 1][j - 13] = buf[i][j];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2280,7 +2541,7 @@ test_basic_io(unsigned config, hid_t fapl)
evbuf[2 * i][j + 13] = buf[i + 5][j];
for(/* j = 13 */; j < 26; j++)
evbuf[2 * i + 1][j] = buf[i + 5][j];
- } /* end for */
+ }
/* Reopen srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -2291,7 +2552,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
/* Reset rbuf */
@@ -2307,7 +2568,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[2 * i][j] = evbuf[i][j];
for(/* j = 13 */; j < 26; j++)
erbuf[2 * i + 1][j - 13] = evbuf[i][j];
- } /* end for */
+ }
/* Read second dataset */
if(H5Dread(srcdset[1], H5T_NATIVE_INT, srcspace[1], srcspace[1], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2319,7 +2580,7 @@ test_basic_io(unsigned config, hid_t fapl)
erbuf[2 * i][j + 13] = evbuf[i + 5][j];
for(/* j = 13 */; j < 26; j++)
erbuf[2 * i + 1][j] = evbuf[i + 5][j];
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2439,12 +2700,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2498,8 +2759,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -2513,7 +2774,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset by hyperslab */
/* Reset rbuf */
@@ -2538,7 +2799,7 @@ test_basic_io(unsigned config, hid_t fapl)
for(j = 0; j < 26; j++) {
erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0]));
- } /* end for */
+ }
/* Verify read data */
for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
@@ -2584,7 +2845,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source datasets */
/* Reset rbuf */
@@ -2605,7 +2866,7 @@ test_basic_io(unsigned config, hid_t fapl)
for(j = 0; j < 26; j++) {
erbuf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
erbuf[i + 1][j] -= (int)(sizeof(buf) / sizeof(buf[0][0]));
- } /* end for */
+ }
/* Read second dataset */
if(H5Dread(srcdset[1], H5T_NATIVE_INT, memspace, srcspace[0], H5P_DEFAULT, rbuf[0]) < 0)
@@ -2780,12 +3041,12 @@ test_basic_io(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source dataset */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -2822,8 +3083,8 @@ test_basic_io(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -2837,7 +3098,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data through virtual dataset */
/* Reset rbuf */
@@ -2943,7 +3204,7 @@ test_basic_io(unsigned config, hid_t fapl)
if((j >= 3) && (j < 6)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -2996,7 +3257,7 @@ test_basic_io(unsigned config, hid_t fapl)
if((j >= 6) && (j < 9)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -3214,7 +3475,7 @@ test_basic_io(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read data directly from source dataset */
/* Select hyperslab in memory space */
@@ -3279,44 +3540,763 @@ test_basic_io(unsigned config, hid_t fapl)
memspace = -1;
+ /*
+ * Test 8: For code coverage: Horizontal block virtual mappings, and file
+ * selection, grid memory selection
+ */
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create memory dataspace */
+ if((memspace = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspaces */
+ dims[0] = 8;
+ dims[1] = 15;
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+ if((vspace[1] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ dims[0] = 4;
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all in source space (should not be necessary, but just to be sure)
+ */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Select hyperslabs in virtual spaces */
+ start[0] = 0;
+ start[1] = 0;
+ if(H5Sselect_hyperslab(vspace[0], H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+ start[0] = 4;
+ if(H5Sselect_hyperslab(vspace[1], H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mappings */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset1", srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Pset_virtual(dcpl, vspace[1], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset2", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Reset dims */
+ dims[0] = 10;
+ dims[1] = 26;
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source datasets */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if((srcdset[1] = H5Dcreate2(srcfile[0], "src_dset2", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Reset erbuf */
+ HDmemset(erbuf[0], 0, sizeof(rbuf));
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Select hyperslab in memory */
+ start[0] = 0;
+ start[1] = 0;
+ count[0] = 4;
+ count[1] = 15;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to first source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ u = 0;
+ v = 0;
+ for(i = 2; i < 4; i++)
+ for(j = 0; j < 15; j++) {
+ erbuf[u][v] = buf[i][j];
+ v += 2;
+ if(v >= 24) {
+ u += 2;
+ v = 0;
+ }
+ }
+
+ /* Select hyperslab in memory */
+ start[0] = 4;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to second source dataset */
+ if(H5Dwrite(srcdset[1], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ for(i = 4; i < 6; i++)
+ for(j = 0; j < 15; j++) {
+ erbuf[u][v] = buf[i][j];
+ v += 2;
+ if(v >= 24) {
+ u += 2;
+ v = 0;
+ }
+ }
+
+ /* Close srcdsets and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Select hyperslab in memory */
+ start[0] = 0;
+ start[1] = 0;
+ stride[0] = 2;
+ stride[1] = 2;
+ count[0] = 5;
+ count[1] = 12;
+ block[0] = 1;
+ block[1] = 1;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR
+
+ /* Select hyperslab in file */
+ start[0] = 2;
+ start[1] = 0;
+ count[0] = 4;
+ count[1] = 15;
+ if(H5Sselect_hyperslab(vspace[0], H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, memspace, vspace[0], H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != erbuf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(!(config & TEST_IO_CLOSE_SRC)) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Sclose(vspace[1]) < 0)
+ TEST_ERROR
+ vspace[1] = -1;
+ if(H5Sclose(memspace) < 0)
+ TEST_ERROR
+ memspace = -1;
+
+
+ /*
+ * Test 9: For code coverage: Horizontal block virtual mappings, and file
+ * selection, grid memory selection, 3 mappings, 3D memory space
+ */
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create memory dataspace */
+ dims[1] = 13;
+ dims[2] = 2;
+ if((memspace = H5Screate_simple(3, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspaces */
+ dims[0] = 6;
+ dims[1] = 10;
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+ if((vspace[1] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+ if((vspace[2] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ dims[0] = 2;
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all in source space (should not be necessary, but just to be sure)
+ */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Select hyperslabs in virtual spaces */
+ start[0] = 0;
+ start[1] = 0;
+ if(H5Sselect_hyperslab(vspace[0], H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+ start[0] = 2;
+ if(H5Sselect_hyperslab(vspace[1], H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+ start[0] = 4;
+ if(H5Sselect_hyperslab(vspace[2], H5S_SELECT_SET, start, NULL, dims, NULL) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mappings */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset1", srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Pset_virtual(dcpl, vspace[1], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset2", srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Pset_virtual(dcpl, vspace[2], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset3", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Reset dims */
+ dims[0] = 10;
+ dims[1] = 26;
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source datasets */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if((srcdset[1] = H5Dcreate2(srcfile[0], "src_dset2", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if((srcdset[2] = H5Dcreate2(srcfile[0], "src_dset3", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Reset erbuf */
+ HDmemset(erbuf[0], 0, sizeof(rbuf));
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Select hyperslab in memory */
+ start[0] = 0;
+ start[1] = 0;
+ start[2] = 0;
+ count[0] = 2;
+ count[1] = 5;
+ count[2] = 2;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to first source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ u = 0;
+ v = 0;
+ for(i = 0; i < 2; i++)
+ for(j = 0; j < 10; j++) {
+ erbuf[u][v] = buf[i][j];
+ if(++v == 6)
+ v += 2;
+ else if(v == 14) {
+ u += 2;
+ v = 0;
+ }
+ }
+
+ /* Select hyperslab in memory */
+ start[0] = 2;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to second source dataset */
+ if(H5Dwrite(srcdset[1], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ for(i = 2; i < 4; i++)
+ for(j = 0; j < 10; j++) {
+ erbuf[u][v] = buf[i][j];
+ if(++v == 6)
+ v += 2;
+ else if(v == 14) {
+ u += 2;
+ v = 0;
+ }
+ }
+
+ /* Select hyperslab in memory */
+ start[0] = 4;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to third source dataset */
+ if(H5Dwrite(srcdset[2], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ for(i = 4; i < 6; i++)
+ for(j = 0; j < 10; j++) {
+ erbuf[u][v] = buf[i][j];
+ if(++v == 6)
+ v += 2;
+ else if(v == 14) {
+ u += 2;
+ v = 0;
+ }
+ }
+
+ /* Close srcdsets and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Dclose(srcdset[2]) < 0)
+ TEST_ERROR
+ srcdset[2] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Select hyperslab in memory */
+ start[0] = 0;
+ start[1] = 0;
+ start[2] = 0;
+ stride[0] = 2;
+ stride[1] = 4;
+ stride[2] = 1;
+ count[0] = 5;
+ count[1] = 2;
+ count[2] = 1;
+ block[0] = 1;
+ block[1] = 3;
+ block[2] = 2;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != erbuf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(!(config & TEST_IO_CLOSE_SRC)) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Dclose(srcdset[2]) < 0)
+ TEST_ERROR
+ srcdset[2] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Sclose(vspace[1]) < 0)
+ TEST_ERROR
+ vspace[1] = -1;
+ if(H5Sclose(vspace[2]) < 0)
+ TEST_ERROR
+ vspace[2] = -1;
+ if(H5Sclose(memspace) < 0)
+ TEST_ERROR
+ memspace = -1;
+
+
+ /*
+ * Test 10: For code coverage: Vertical stripe virtual mappings, vertical
+ * block file selection, block memory selection, 3D VDS
+ */
+ /* Clear virtual layout in DCPL */
+ if(H5Pset_layout(dcpl, H5D_VIRTUAL) < 0)
+ TEST_ERROR
+
+ /* Create memory dataspace */
+ if((memspace = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspaces */
+ dims[0] = 10;
+ dims[1] = 9;
+ dims[2] = 6;
+ if((vspace[0] = H5Screate_simple(3, dims, NULL)) < 0)
+ TEST_ERROR
+ if((vspace[1] = H5Screate_simple(3, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create source dataspace */
+ dims[1] = 12;
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all in source space (should not be necessary, but just to be sure)
+ */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Select hyperslabs in virtual spaces */
+ start[0] = 0;
+ start[1] = 0;
+ start[2] = 0;
+ count[0] = 1;
+ count[1] = 4;
+ count[2] = 3;
+ stride[0] = 1;
+ stride[1] = 2;
+ stride[2] = 2;
+ block[0] = 10;
+ block[1] = 1;
+ block[2] = 1;
+ if(H5Sselect_hyperslab(vspace[0], H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR
+ start[2] = 1;
+ if(H5Sselect_hyperslab(vspace[1], H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mappings */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset1", srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Pset_virtual(dcpl, vspace[1], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset2", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Reset dims */
+ dims[0] = 10;
+ dims[1] = 26;
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source datasets */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ if((srcdset[1] = H5Dcreate2(srcfile[0], "src_dset2", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Initialize erbuf */
+ HDmemset(erbuf[0], 0, sizeof(rbuf));
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 24; j += 6) {
+ erbuf[i][j] = -1;
+ erbuf[i][j + 1] = -1;
+ }
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Select hyperslab in memory */
+ start[0] = 0;
+ start[1] = 0;
+ count[0] = 10;
+ count[1] = 12;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to first source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ u = 0;
+ v = 0;
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 8; j++) {
+ if(v == 0 || v == 12)
+ erbuf[u][v] = buf[i][j];
+ v += 2;
+ if(!(v % 6))
+ v += 6;
+ if(v >= 28) {
+ u++;
+ v = 0;
+ }
+ }
+
+ /* Select hyperslab in memory */
+ start[1] = 8;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Write data directly to second source dataset */
+ if(H5Dwrite(srcdset[1], H5T_NATIVE_INT, memspace, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Update erbuf */
+ u = 0;
+ v = 1;
+ for(i = 0; i < 10; i++)
+ for(j = 8; j < 16; j++) {
+ if(v == 1 || v == 13)
+ erbuf[u][v] = buf[i][j];
+ v += 2;
+ if(!((v - 1) % 6))
+ v += 6;
+ if(v >= 28) {
+ u++;
+ v = 1;
+ }
+ }
+
+ /* Close srcdsets and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Select hyperslab in memory */
+ start[0] = 0;
+ start[1] = 0;
+ stride[0] = 1;
+ stride[1] = 6;
+ count[0] = 1;
+ count[1] = 4;
+ block[0] = 10;
+ block[1] = 2;
+ if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, stride, count, block) < 0)
+ TEST_ERROR
+
+ /* Select hyperslab in file */
+ start[0] = 0;
+ start[1] = 0;
+ start[2] = 0;
+ count[0] = 10;
+ count[1] = 4;
+ count[2] = 2;
+ if(H5Sselect_hyperslab(vspace[0], H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, memspace, vspace[0], H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != erbuf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(!(config & TEST_IO_CLOSE_SRC)) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Dclose(srcdset[1]) < 0)
+ TEST_ERROR
+ srcdset[1] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Sclose(vspace[1]) < 0)
+ TEST_ERROR
+ vspace[1] = -1;
+ if(H5Sclose(memspace) < 0)
+ TEST_ERROR
+ memspace = -1;
+
+
/* Close */
if(H5Pclose(dcpl) < 0)
TEST_ERROR
dcpl = -1;
+ HDfree(srcfilename);
+ HDfree(srcfilename_map);
+ HDfree(vfilename);
+ HDfree(vfilename2);
+ HDfree(srcfilenamepct);
+ HDfree(srcfilenamepct_map);
+
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- if(vfile2 >= 0)
- (void)H5Fclose(vfile2);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Fclose(vfile2);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
} H5E_END_TRY;
+ HDfree(srcfilename);
+ HDfree(srcfilename_map);
+ HDfree(vfilename);
+ HDfree(vfilename2);
+ HDfree(srcfilenamepct);
+ HDfree(srcfilenamepct_map);
+
return 1;
} /* end test_basic_io() */
@@ -3327,14 +4307,7 @@ error:
* Purpose: Tests VDS with unlimited selections
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Thursday, April 30, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -3447,12 +4420,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -3517,8 +4490,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -3532,7 +4505,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3577,11 +4550,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Test H5Pget_virtual_view() */
if(H5Pget_virtual_view(dapl, &virtual_view) < 0)
@@ -3601,7 +4574,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -3649,11 +4622,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -3662,7 +4635,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[0] = 5;
@@ -3699,8 +4672,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -3714,7 +4687,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3761,11 +4734,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -3779,7 +4752,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -3832,11 +4805,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -3845,7 +4818,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 5;
@@ -3887,8 +4860,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -3902,7 +4875,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -3964,7 +4937,7 @@ test_unlim(unsigned config, hid_t fapl)
if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -4029,11 +5002,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Shrink to 15 */
dims[1] = 15;
@@ -4060,12 +5033,12 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end if */
+ }
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -4079,7 +5052,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4127,11 +5100,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -4166,11 +5139,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try setting extent manually */
/* Grow to 18 */
@@ -4198,11 +5171,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Grow to 20 */
dims[1] = 20;
@@ -4228,7 +5201,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < (int)mdims[1]; j++)
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -4241,12 +5214,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -4322,12 +5295,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -4392,8 +5365,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -4407,7 +5380,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4451,11 +5424,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -4469,7 +5442,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4511,11 +5484,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -4524,7 +5497,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[1] = 7;
@@ -4566,8 +5539,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -4581,7 +5554,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4627,11 +5600,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -4645,7 +5618,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4696,11 +5669,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -4709,7 +5682,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[1] = 10;
@@ -4751,8 +5724,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -4766,7 +5739,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -4828,7 +5801,7 @@ test_unlim(unsigned config, hid_t fapl)
if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -4845,7 +5818,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -4897,11 +5870,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -4914,12 +5887,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -5014,12 +5987,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -5059,7 +6032,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < 2; j++) {
erbuf[i][6 * j] = buf[i][2 * j];
erbuf[i][(6 * j) + 1] = buf[i][(2 * j) + 1];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)mdims[0]; i++)
@@ -5075,7 +6048,7 @@ test_unlim(unsigned config, hid_t fapl)
for(j = 0; j < 2; j++) {
erbuf[i][(6 * j) + 2] = buf[i][2 * j];
erbuf[i][(6 * j) + 3] = buf[i][(2 * j) + 1];
- } /* end for */
+ }
/* Adjust write buffer */
for(i = 0; i < (int)mdims[0]; i++)
@@ -5096,7 +6069,7 @@ test_unlim(unsigned config, hid_t fapl)
for(i = 0; i < 10; i++) {
erbuf[i][4] = buf[i][0];
erbuf[i][5] = buf[i][1];
- } /* end for */
+ }
/* Close srcdsets and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5114,8 +6087,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5129,7 +6102,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5173,11 +6146,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -5191,7 +6164,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5233,11 +6206,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5246,7 +6219,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[1] = 7;
@@ -5283,8 +6256,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5298,7 +6271,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5343,11 +6316,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -5361,7 +6334,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5371,7 +6344,7 @@ test_unlim(unsigned config, hid_t fapl)
erbuf[i][12] = buf[i][0];
erbuf[i][13] = buf[i][1];
erbuf[i][18] = buf[i][2];
- } /* end for */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5415,11 +6388,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[2] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5428,7 +6401,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset3", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[2] */
dims[1] = 5;
@@ -5460,7 +6433,7 @@ test_unlim(unsigned config, hid_t fapl)
erbuf[i][10] = buf[i][0];
erbuf[i][11] = buf[i][1];
erbuf[i][16] = buf[i][2];
- } /* end for */
+ }
/* Close srcdset[2] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5472,8 +6445,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5487,7 +6460,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5532,11 +6505,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -5550,7 +6523,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5596,11 +6569,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5609,7 +6582,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[1] = 6;
@@ -5640,7 +6613,7 @@ test_unlim(unsigned config, hid_t fapl)
for(i = 0; i < 10; i++) {
erbuf[i][14] = buf[i][0];
erbuf[i][15] = buf[i][1];
- } /* end for */
+ }
/* Close srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -5652,8 +6625,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5667,7 +6640,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -5711,11 +6684,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -5729,7 +6702,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -5771,11 +6744,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now just read middle 2 rows */
HDmemset(rbuf[0], 0, sizeof(rbuf));
@@ -5801,11 +6774,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else if((i == 4) || (i == 5)) {
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != 0)
TEST_ERROR
@@ -5824,12 +6797,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -5910,12 +6883,12 @@ test_unlim(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create source datasets */
if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset1", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, srcdcpl, H5P_DEFAULT)) < 0)
@@ -5968,8 +6941,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -5983,7 +6956,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6029,11 +7002,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -6047,7 +7020,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -6089,11 +7062,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[0] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -6102,7 +7075,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset1", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[0] */
dims[0] = 5;
@@ -6140,8 +7113,8 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6155,7 +7128,7 @@ test_unlim(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6201,11 +7174,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -6219,7 +7192,7 @@ test_unlim(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -6267,11 +7240,11 @@ test_unlim(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -6284,12 +7257,12 @@ test_unlim(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -6329,36 +7302,21 @@ test_unlim(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(srcdcpl >= 0)
- (void)H5Pclose(srcdcpl);
- if(dapl >= 0)
- (void)H5Pclose(dapl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(srcdcpl);
+ H5Pclose(dapl);
} H5E_END_TRY;
return 1;
@@ -6372,28 +7330,21 @@ error:
* source dataset resolution
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Tuesday, May 26, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
test_printf(unsigned config, hid_t fapl)
{
- char srcfilename[FILENAME_BUF_SIZE];
- char srcfilename_map[FILENAME_BUF_SIZE];
- char srcfilename2[FILENAME_BUF_SIZE];
- char srcfilename2_map[FILENAME_BUF_SIZE];
- char vfilename[FILENAME_BUF_SIZE];
- char printf_srcfilename_map[FILENAME_BUF_SIZE];
+ char *srcfilename = NULL;
+ char *srcfilename_map = NULL;
+ char *srcfilename2 = NULL;
+ char *srcfilename2_map = NULL;
+ char *vfilename = NULL;
+ char *printf_srcfilename_map = NULL;
+ char *srcfilenamepct = NULL;
+ char *srcfilenamepct_map = NULL;
const char *printf_srcfilename_map_orig = "vds_src_%b";
- char srcfilenamepct[FILENAME_BUF_SIZE];
- char srcfilenamepct_map[FILENAME_BUF_SIZE];
const char *srcfilenamepct_map_orig = "vds%%%%_src";
hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
hid_t vfile = -1; /* File with virtual dset */
@@ -6421,14 +7372,31 @@ test_printf(unsigned config, hid_t fapl)
TESTING("virtual dataset I/O with printf source")
- h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
- h5_fixname(FILENAME[2], fapl, srcfilename, sizeof srcfilename);
- h5_fixname_printf(FILENAME[2], fapl, srcfilename_map, sizeof srcfilename_map);
- h5_fixname(FILENAME[3], fapl, srcfilename2, sizeof srcfilename2);
- h5_fixname_printf(FILENAME[2], fapl, srcfilename2_map, sizeof srcfilename2_map);
- h5_fixname_printf(printf_srcfilename_map_orig, fapl, printf_srcfilename_map, sizeof printf_srcfilename_map);
- h5_fixname(FILENAME[4], fapl, srcfilenamepct, sizeof srcfilenamepct);
- h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map);
+ if((srcfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilename2 = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilename2_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((vfilename = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((printf_srcfilename_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilenamepct = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+ if((srcfilenamepct_map = (char *)HDcalloc(FILENAME_BUF_SIZE, sizeof(char))) == NULL)
+ TEST_ERROR;
+
+ h5_fixname(FILENAME[0], fapl, vfilename, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[2], fapl, srcfilename, FILENAME_BUF_SIZE);
+ h5_fixname_printf(FILENAME[2], fapl, srcfilename_map, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[3], fapl, srcfilename2, FILENAME_BUF_SIZE);
+ h5_fixname_printf(FILENAME[2], fapl, srcfilename2_map, FILENAME_BUF_SIZE);
+ h5_fixname_printf(printf_srcfilename_map_orig, fapl, printf_srcfilename_map, FILENAME_BUF_SIZE);
+ h5_fixname(FILENAME[4], fapl, srcfilenamepct, FILENAME_BUF_SIZE);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, FILENAME_BUF_SIZE);
/* Create DCPL */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
@@ -6485,12 +7453,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -6502,7 +7470,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6516,7 +7484,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6602,8 +7570,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6617,7 +7585,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6661,11 +7629,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -6702,8 +7670,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6717,7 +7685,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -6757,11 +7725,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try with different selections */
count[0] = 10;
@@ -6788,12 +7756,12 @@ test_printf(unsigned config, hid_t fapl)
if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end for */
+ }
+ }
start[1] = 0;
/* Now try writing through VDS */
@@ -6829,7 +7797,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[2] = H5Dopen2(srcfile[0], "src_dset2", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Read srcdset[0] */
count[0] = 10;
@@ -6931,12 +7899,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -6948,7 +7916,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -6962,7 +7930,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7100,14 +8068,14 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(config & TEST_IO_DIFFERENT_FILE) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7121,7 +8089,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7165,11 +8133,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Test H5Pget_virtual_printf_gap() */
if(H5Pget_virtual_printf_gap(dapl, &gap_size) < 0)
@@ -7189,7 +8157,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7241,11 +8209,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 2, reopen file as well if
* config option specified */
@@ -7259,7 +8227,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7311,11 +8279,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 3, reopen file as well if
* config option specified */
@@ -7329,7 +8297,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7381,11 +8349,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 4, reopen file as well if
* config option specified */
@@ -7399,7 +8367,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7451,11 +8419,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -7469,7 +8437,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -7515,11 +8483,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reset dapl */
if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
@@ -7533,16 +8501,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -7615,7 +8583,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7681,7 +8649,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7695,7 +8663,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7739,11 +8707,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile[1] if config option specified */
if(config & TEST_IO_CLOSE_SRC)
@@ -7778,7 +8746,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -7792,7 +8760,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7836,11 +8804,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -7856,7 +8824,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -7926,7 +8894,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -7992,7 +8960,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8006,7 +8974,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8050,11 +9018,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile[1] if config option specified */
if(config & TEST_IO_CLOSE_SRC)
@@ -8089,7 +9057,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8103,7 +9071,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8147,11 +9115,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close */
if(!(config & TEST_IO_CLOSE_SRC)) {
@@ -8167,7 +9135,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[1]) < 0)
TEST_ERROR
srcfile[1] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -8180,7 +9148,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Sclose(vspace[0]) < 0)
TEST_ERROR
vspace[0] = -1;
- } /* end if */
+ }
/*
@@ -8238,12 +9206,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -8255,7 +9223,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8269,7 +9237,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8355,8 +9323,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8370,7 +9338,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8414,11 +9382,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -8454,8 +9422,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8469,7 +9437,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8513,11 +9481,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -8531,7 +9499,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -8578,11 +9546,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -8618,8 +9586,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8633,7 +9601,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -8677,11 +9645,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -8695,7 +9663,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -8742,11 +9710,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf_gap set to 1, reopen file as well if
* config option specified */
@@ -8760,7 +9728,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -8807,11 +9775,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reset dapl */
if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
@@ -8825,16 +9793,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -8910,12 +9878,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -8927,7 +9895,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -8941,7 +9909,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9037,8 +10005,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9052,7 +10020,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9096,11 +10064,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -9114,7 +10082,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9161,11 +10129,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -9205,8 +10173,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9220,7 +10188,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9264,11 +10232,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with view set to H5D_VDS_LAST_AVAILABLE, reopen file
* as well if config option specified */
@@ -9282,7 +10250,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9328,11 +10296,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -9369,8 +10337,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9384,7 +10352,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9428,11 +10396,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -9466,11 +10434,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try setting extent manually */
/* Shrink to 12 */
@@ -9496,11 +10464,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Shrink to 10 */
dims[1] = 12;
@@ -9525,12 +10493,12 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end if */
+ }
+ }
/* Close VDS and reopen with view set to H5D_VDS_FIRST_MISSING, reopen file
* as well if config option specified */
@@ -9544,7 +10512,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9590,11 +10558,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now test reopening virtual dataset without calling H5Dget_space, if
* REOPEN_VIRT flag set */
@@ -9628,11 +10596,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Now try setting extent manually */
/* Grow to 12 */
@@ -9658,11 +10626,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Grow to 15 */
dims[1] = 15;
@@ -9687,12 +10655,12 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
- } /* end if */
+ }
+ }
/* Reset dapl */
if(H5Pset_virtual_view(dapl, H5D_VDS_LAST_AVAILABLE) < 0)
@@ -9704,16 +10672,16 @@ test_printf(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -9770,12 +10738,12 @@ test_printf(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile[0] = H5Fcreate(srcfilenamepct, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile[0] = vfile;
if(H5Iinc_ref(srcfile[0]) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
@@ -9787,7 +10755,7 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9801,7 +10769,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9867,8 +10835,8 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -9882,7 +10850,7 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -9926,11 +10894,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Close VDS and reopen with printf gap set to 127, reopen file as well if
* config option specified */
@@ -9944,7 +10912,7 @@ test_printf(unsigned config, hid_t fapl)
vfile = -1;
if((vfile = H5Fopen(vfilename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
TEST_ERROR
@@ -9990,11 +10958,11 @@ test_printf(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reset dapl */
if(H5Pset_virtual_printf_gap(dapl, (hsize_t)0) < 0)
@@ -10008,12 +10976,12 @@ test_printf(unsigned config, hid_t fapl)
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile[0]) < 0)
TEST_ERROR
srcfile[0] = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -10039,39 +11007,44 @@ test_printf(unsigned config, hid_t fapl)
TEST_ERROR
memspace = -1;
+ HDfree(srcfilename);
+ HDfree(srcfilename_map);
+ HDfree(srcfilename2);
+ HDfree(srcfilename2_map);
+ HDfree(vfilename);
+ HDfree(printf_srcfilename_map);
+ HDfree(srcfilenamepct);
+ HDfree(srcfilenamepct_map);
+
PASSED();
return 0;
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++) {
- if(srcfile[i] >= 0)
- (void)H5Fclose(srcfile[i]);
- } /* end for */
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- if(srcspace >= 0)
- (void)H5Sclose(srcspace);
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(dapl >= 0)
- (void)H5Pclose(dapl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ H5Sclose(srcspace);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(dapl);
} H5E_END_TRY;
+ HDfree(srcfilename);
+ HDfree(srcfilename_map);
+ HDfree(srcfilename2);
+ HDfree(srcfilename2_map);
+ HDfree(vfilename);
+ HDfree(printf_srcfilename_map);
+ HDfree(srcfilenamepct);
+ HDfree(srcfilenamepct_map);
+
return 1;
} /* end test_printf() */
@@ -10083,14 +11056,7 @@ error:
* VDS
*
* Return: Success: 0
- *
* Failure: number of errors
- *
- * Programmer: Neil Fortner
- * Friday, August 14, 2015
- *
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static int
@@ -10212,12 +11178,12 @@ test_all(unsigned config, hid_t fapl)
if(config & TEST_IO_DIFFERENT_FILE) {
if((srcfile = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR
- } /* end if */
+ }
else {
srcfile = vfile;
if(H5Iinc_ref(srcfile) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Create virtual dataset */
if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
@@ -10229,7 +11195,7 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10243,7 +11209,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10314,14 +11280,14 @@ test_all(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(config & TEST_IO_DIFFERENT_FILE) {
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10335,7 +11301,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10381,11 +11347,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10394,7 +11360,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 2;
@@ -10429,8 +11395,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10444,7 +11410,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10490,11 +11456,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10534,8 +11500,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10549,7 +11515,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10595,11 +11561,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10608,7 +11574,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 3;
@@ -10652,8 +11618,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10667,7 +11633,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10713,11 +11679,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10757,8 +11723,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10772,7 +11738,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10818,11 +11784,11 @@ test_all(unsigned config, hid_t fapl)
if((i >= (int)dims[0]) || (j >= (int)dims[1])) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcdset[1] and srcfile if config option specified */
if(config & TEST_IO_CLOSE_SRC) {
@@ -10831,7 +11797,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((srcdset[1] = H5Dopen2(srcfile, "src_dset_unlim", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Extend srcdset[1] */
dims[0] = 7;
@@ -10876,8 +11842,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10891,7 +11857,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -10937,11 +11903,11 @@ test_all(unsigned config, hid_t fapl)
if(j >= (int)dims[1]) {
if(rbuf[i][j] != 0)
TEST_ERROR
- } /* end if */
+ }
else
if(rbuf[i][j] != erbuf[i][j])
TEST_ERROR
- } /* end for */
+ }
/* Reopen srcfile if config option specified */
if((config & TEST_IO_CLOSE_SRC) && (config & TEST_IO_DIFFERENT_FILE))
@@ -10981,8 +11947,8 @@ test_all(unsigned config, hid_t fapl)
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
- } /* end if */
+ }
+ }
/* Reopen virtual dataset and file if config option specified */
if(config & TEST_IO_REOPEN_VIRT) {
@@ -10996,7 +11962,7 @@ test_all(unsigned config, hid_t fapl)
TEST_ERROR
if((vdset = H5Dopen2(vfile, "v_dset", H5P_DEFAULT)) < 0)
TEST_ERROR
- } /* end if */
+ }
/* Get VDS space */
if((filespace = H5Dget_space(vdset)) < 0)
@@ -11048,16 +12014,16 @@ test_all(unsigned config, hid_t fapl)
if(H5Dclose(srcdset[i]) < 0)
TEST_ERROR
srcdset[i] = -1;
- } /* end for */
+ }
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
else if(!(config & TEST_IO_DIFFERENT_FILE)) {
if(H5Fclose(srcfile) < 0)
TEST_ERROR
srcfile = -1;
- } /* end if */
+ }
if(H5Dclose(vdset) < 0)
TEST_ERROR
vdset = -1;
@@ -11068,12 +12034,12 @@ test_all(unsigned config, hid_t fapl)
if(H5Sclose(srcspace[i]) < 0)
TEST_ERROR
srcspace[i] = -1;
- } /* end for */
+ }
for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
if(H5Sclose(vspace[i]) < 0)
TEST_ERROR
vspace[i] = -1;
- } /* end for */
+ }
if(H5Pclose(dcpl) < 0)
TEST_ERROR
dcpl = -1;
@@ -11089,32 +12055,19 @@ test_all(unsigned config, hid_t fapl)
error:
H5E_BEGIN_TRY {
- for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++) {
- if(srcdset[i] >= 0)
- (void)H5Dclose(srcdset[i]);
- } /* end for */
- if(vdset >= 0)
- (void)H5Dclose(vdset);
- if(srcfile >= 0)
- (void)H5Fclose(srcfile);
- if(vfile >= 0)
- (void)H5Fclose(vfile);
- for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++) {
- if(srcspace[i] >= 0)
- (void)H5Sclose(srcspace[i]);
- } /* end for */
- for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++) {
- if(vspace[i] >= 0)
- (void)H5Sclose(vspace[i]);
- } /* end for */
- if(filespace >= 0)
- (void)H5Sclose(filespace);
- if(memspace >= 0)
- (void)H5Sclose(memspace);
- if(dcpl >= 0)
- (void)H5Pclose(dcpl);
- if(srcdcpl >= 0)
- (void)H5Pclose(srcdcpl);
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ H5Fclose(srcfile);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Pclose(srcdcpl);
} H5E_END_TRY;
return 1;
@@ -11128,10 +12081,6 @@ error:
*
* Return: Success: 0
* Failure: 1
- *
- * Programmer: Dana Robinson
- * March 2016
- *
*-------------------------------------------------------------------------
*/
static int
@@ -11272,11 +12221,12 @@ test_dapl_values(hid_t fapl_id)
*
* Purpose: Tests datasets with virtual layout
*
- * Return: EXIT_SUCCESS/EXIT_FAILURE
- *
- * Programmer: Neil Fortner
- * Tuesday, February 17, 2015
+ * Note:
+ * Tests are modified to test with the low/high bounds combination
+ * set in fapl.
+ * Please see RFC for "H5Sencode/H5Sdecode Format Change".
*
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*-------------------------------------------------------------------------
*/
int
@@ -11284,8 +12234,10 @@ main(void)
{
char filename[FILENAME_BUF_SIZE];
hid_t fapl;
+ hid_t my_fapl = -1; /* File access property list */
int test_api_config;
unsigned bit_config;
+ H5F_libver_t low, high; /* Low and high bounds */
int nerrors = 0;
/* Testing setup */
@@ -11294,31 +12246,66 @@ main(void)
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
- for(test_api_config = (int)TEST_API_BASIC; test_api_config < (int)TEST_API_NTESTS; test_api_config++)
- nerrors += test_api((test_api_config_t)test_api_config, fapl);
- for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
- printf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
- nerrors += test_basic_io(bit_config, fapl);
- nerrors += test_unlim(bit_config, fapl);
- nerrors += test_printf(bit_config, fapl);
- nerrors += test_all(bit_config, fapl);
- } /* end for */
+ /* Set to use the latest file format */
+ if((my_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ char msg[80]; /* Message for file version bounds */
+ const char *low_string; /* The low bound string */
+ const char *high_string; /* The high bound string */
- nerrors += test_dapl_values(fapl);
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
+
+ /* Test virtual dataset only for V110 and above */
+ if(high < H5F_LIBVER_V110)
+ continue;
+
+ /* Set the low/high version bounds */
+ if(H5Pset_libver_bounds(my_fapl, low, high) < 0)
+ TEST_ERROR
- /* Verify symbol table messages are cached */
- nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
+ /* Display testing info */
+ low_string = h5_get_version_string(low);
+ high_string = h5_get_version_string(high);
+ HDsprintf(msg, "Testing virtual dataset with file version bounds: (%s, %s):", low_string, high_string);
+ HDputs(msg);
+
+ for(test_api_config = (int)TEST_API_BASIC; test_api_config < (int)TEST_API_NTESTS; test_api_config++)
+ nerrors += test_api((test_api_config_t)test_api_config, my_fapl, low);
+ for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
+ HDprintf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
+ nerrors += test_basic_io(bit_config, my_fapl);
+ nerrors += test_vds_prefix_first(bit_config, my_fapl);
+ nerrors += test_unlim(bit_config, my_fapl);
+ nerrors += test_printf(bit_config, my_fapl);
+ nerrors += test_all(bit_config, my_fapl);
+ }
+
+ nerrors += test_dapl_values(my_fapl);
+
+ /* Verify symbol table messages are cached */
+ nerrors += (h5_verify_cached_stabs(FILENAME, my_fapl) < 0 ? 1 : 0);
+
+ } /* end for high */
+ } /* end for low */
+
+ if(H5Pclose(my_fapl) < 0)
+ TEST_ERROR
if(nerrors)
goto error;
- printf("All virtual dataset tests passed.\n");
+ HDprintf("All virtual dataset tests passed.\n");
h5_cleanup(FILENAME, fapl);
return EXIT_SUCCESS;
error:
nerrors = MAX(1, nerrors);
- printf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
+ HDprintf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
return EXIT_FAILURE;
} /* end main() */
diff --git a/test/vds_env.c b/test/vds_env.c
new file mode 100644
index 0000000..3d5b5dd
--- /dev/null
+++ b/test/vds_env.c
@@ -0,0 +1,365 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer: Neil Fortner <nfortne2@hdfgroup.org>
+ * Monday, February 16, 2015
+ *
+ * Purpose: Tests datasets with virtual layout.
+ */
+#include "h5test.h"
+
+const char *FILENAME[] = {
+ "vds_env_virt_0",
+ "vds_env_virt_3",
+ "vds_env_src_2",
+ "vds_env%%_src2",
+ NULL
+};
+
+/* I/O test config flags */
+#define TEST_IO_CLOSE_SRC 0x01u
+#define TEST_IO_DIFFERENT_FILE 0x02u
+#define TEST_IO_REOPEN_VIRT 0x04u
+#define TEST_IO_NTESTS 0x08u
+
+#define FILENAME_BUF_SIZE 1024
+
+#define TMPDIR "tmp_vds_env/"
+
+/*-------------------------------------------------------------------------
+ * Function: test_vds_prefix_second
+ *
+ * Purpose: Set up vds link prefix via H5Pset_virtual_prefix() to be "tmp"
+ * Should be able to access the target source files in tmp directory via the prefix set
+ * by H5Pset_virtual_prefix()
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static int
+test_vds_prefix_second(unsigned config, hid_t fapl)
+{
+ char srcfilename[FILENAME_BUF_SIZE];
+ char srcfilename_map[FILENAME_BUF_SIZE];
+ char vfilename[FILENAME_BUF_SIZE];
+ char vfilename2[FILENAME_BUF_SIZE];
+ char srcfilenamepct[FILENAME_BUF_SIZE];
+ char srcfilenamepct_map[FILENAME_BUF_SIZE];
+ const char *srcfilenamepct_map_orig = "vds%%%%_src";
+ hid_t srcfile[4] = {-1, -1, -1, -1}; /* Files with source dsets */
+ hid_t vfile = -1; /* File with virtual dset */
+ hid_t dcpl = -1; /* Dataset creation property list */
+ hid_t dapl = -1; /* Dataset access property list */
+ hid_t srcspace[4] = {-1, -1, -1, -1}; /* Source dataspaces */
+ hid_t vspace[4] = {-1, -1, -1, -1}; /* Virtual dset dataspaces */
+ hid_t memspace = -1; /* Memory dataspace */
+ hid_t srcdset[4] = {-1, -1, -1, -1}; /* Source datsets */
+ hid_t vdset = -1; /* Virtual dataset */
+ hsize_t dims[4] = {10, 26, 0, 0}; /* Data space current size */
+ int buf[10][26]; /* Write and expected read buffer */
+ int rbuf[10][26]; /* Read buffer */
+ int fill = -1; /* Fill value */
+ int i, j;
+ char buffer[1024]; /* buffer to read vds_prefix */
+
+ TESTING("basic virtual dataset I/O via H5Pset_vds_prefix(): all selection with ENV prefix")
+
+ h5_fixname(FILENAME[0], fapl, vfilename, sizeof vfilename);
+ h5_fixname(FILENAME[1], fapl, vfilename2, sizeof vfilename2);
+ h5_fixname(FILENAME[2], fapl, srcfilename, sizeof srcfilename);
+ h5_fixname_printf(FILENAME[2], fapl, srcfilename_map, sizeof srcfilename_map);
+ h5_fixname(FILENAME[3], fapl, srcfilenamepct, sizeof srcfilenamepct);
+ h5_fixname_printf(srcfilenamepct_map_orig, fapl, srcfilenamepct_map, sizeof srcfilenamepct_map);
+
+ /* create tmp directory and get current working directory path */
+ if (HDmkdir(TMPDIR, (mode_t)0755) < 0 && errno != EEXIST)
+ TEST_ERROR
+
+ /* Create DCPL */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR
+
+ /* Set fill value */
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill) < 0)
+ TEST_ERROR
+
+ /* Set prefix to a nonexistent directory, will be overwritten by environment variable */
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ TEST_ERROR
+
+ if(H5Pset_virtual_prefix(dapl, "someprefix") < 0)
+ TEST_ERROR
+ if(H5Pget_virtual_prefix(dapl, buffer, sizeof(buffer)) < 0)
+ TEST_ERROR
+
+ if(HDstrcmp(buffer, "someprefix") != 0)
+ FAIL_PUTS_ERROR("vds prefix not set correctly");
+
+ /* Create source dataspace */
+ if((srcspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataspace */
+ if((vspace[0] = H5Screate_simple(2, dims, NULL)) < 0)
+ TEST_ERROR
+
+ /* Select all (should not be necessary, but just to be sure) */
+ if(H5Sselect_all(srcspace[0]) < 0)
+ TEST_ERROR
+ if(H5Sselect_all(vspace[0]) < 0)
+ TEST_ERROR
+
+ /* Add virtual layout mapping */
+ if(H5Pset_virtual(dcpl, vspace[0], config & TEST_IO_DIFFERENT_FILE ? srcfilename_map : ".", "src_dset", srcspace[0]) < 0)
+ TEST_ERROR
+
+ /* Create virtual file */
+ if((vfile = H5Fcreate(vfilename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+
+ /* Create source file if requested */
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
+ if((srcfile[0] = H5Fcreate(srcfilename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
+ }
+ else {
+ srcfile[0] = vfile;
+ if(H5Iinc_ref(srcfile[0]) < 0)
+ TEST_ERROR
+ }
+
+ /* Create source dataset */
+ if((srcdset[0] = H5Dcreate2(srcfile[0], "src_dset", H5T_NATIVE_INT, srcspace[0], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
+
+ /* Create virtual dataset */
+ if((vdset = H5Dcreate2(vfile, "v_dset", H5T_NATIVE_INT, vspace[0], H5P_DEFAULT, dcpl, dapl)) < 0)
+ TEST_ERROR
+
+ /* Populate write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] = (i * (int)(sizeof(buf[0]) / sizeof(buf[0][0]))) + j;
+
+ /* Write data directly to source dataset */
+ if(H5Dwrite(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Close srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ }
+ }
+
+ /* Reopen virtual dataset and file if config option specified */
+ if(config & TEST_IO_REOPEN_VIRT) {
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if((vfile = H5Fopen(vfilename2, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
+ if((vdset = H5Dopen2(vfile, "v_dset", dapl)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data through virtual dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++) {
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j]) {
+ TEST_ERROR
+ }
+ }
+
+ /* Adjust write buffer */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ buf[i][j] += (int)(sizeof(buf) / sizeof(buf[0][0]));
+
+ /* Write data through virtual dataset */
+ if(H5Dwrite(vdset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf[0]) < 0)
+ TEST_ERROR
+
+ /* Reopen srcdset and srcfile if config option specified */
+ if(config & TEST_IO_CLOSE_SRC) {
+ if(config & TEST_IO_DIFFERENT_FILE) {
+ if(NULL == HDgetcwd(buffer, 1024))
+ TEST_ERROR
+ if(HDchdir(TMPDIR) < 0)
+ TEST_ERROR
+ if((srcfile[0] = H5Fopen(srcfilename, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
+ if(HDchdir(buffer) < 0)
+ TEST_ERROR
+ }
+ if((srcdset[0] = H5Dopen2(srcfile[0], "src_dset", H5P_DEFAULT)) < 0)
+ TEST_ERROR
+ }
+
+ /* Read data directly from source dataset */
+ HDmemset(rbuf[0], 0, sizeof(rbuf));
+ if(H5Dread(srcdset[0], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf[0]) < 0)
+ TEST_ERROR
+
+ /* Verify read data */
+ for(i = 0; i < (int)(sizeof(buf) / sizeof(buf[0])); i++)
+ for(j = 0; j < (int)(sizeof(buf[0]) / sizeof(buf[0][0])); j++)
+ if(rbuf[i][j] != buf[i][j])
+ TEST_ERROR
+
+ /* Close */
+ if(H5Dclose(vdset) < 0)
+ TEST_ERROR
+ vdset = -1;
+ if(H5Dclose(srcdset[0]) < 0)
+ TEST_ERROR
+ srcdset[0] = -1;
+ if(H5Fclose(srcfile[0]) < 0)
+ TEST_ERROR
+ srcfile[0] = -1;
+ if(H5Fclose(vfile) < 0)
+ TEST_ERROR
+ vfile = -1;
+ if(H5Sclose(srcspace[0]) < 0)
+ TEST_ERROR
+ srcspace[0] = -1;
+ if(H5Sclose(vspace[0]) < 0)
+ TEST_ERROR
+ vspace[0] = -1;
+ if(H5Pclose(dapl) < 0)
+ TEST_ERROR
+ dapl = -1;
+ if(H5Pclose(dcpl) < 0)
+ TEST_ERROR
+ dcpl = -1;
+
+ PASSED();
+ return 0;
+
+ error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < (int)(sizeof(srcdset) / sizeof(srcdset[0])); i++)
+ H5Dclose(srcdset[i]);
+ H5Dclose(vdset);
+ for(i = 0; i < (int)(sizeof(srcfile) / sizeof(srcfile[0])); i++)
+ H5Fclose(srcfile[i]);
+ H5Fclose(vfile);
+ for(i = 0; i < (int)(sizeof(srcspace) / sizeof(srcspace[0])); i++)
+ H5Sclose(srcspace[i]);
+ for(i = 0; i < (int)(sizeof(vspace) / sizeof(vspace[0])); i++)
+ H5Sclose(vspace[i]);
+ H5Sclose(memspace);
+ H5Pclose(dapl);
+ H5Pclose(dcpl);
+ } H5E_END_TRY;
+
+ return 1;
+} /* end test_vds_prefix2 */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests datasets with virtual layout
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ hid_t fapl, my_fapl;
+ unsigned bit_config;
+ H5F_libver_t low, high; /* Low and high bounds */
+ int nerrors = 0;
+
+ /* Testing setup */
+ h5_reset();
+ fapl = h5_fileaccess();
+
+ /* Set to use the latest file format */
+ if((my_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
+
+ /* Loop through all the combinations of low/high version bounds */
+ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) {
+ for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) {
+ char msg[80]; /* Message for file version bounds */
+ const char *low_string; /* The low bound string */
+ const char *high_string; /* The high bound string */
+
+ /* Invalid combinations, just continue */
+ if(high == H5F_LIBVER_EARLIEST || high < low)
+ continue;
+
+ /* Test virtual dataset only for V110 and above */
+ if(high < H5F_LIBVER_V110)
+ continue;
+
+ /* Set the low/high version bounds */
+ if(H5Pset_libver_bounds(my_fapl, low, high) < 0)
+ TEST_ERROR
+
+ /* Display testing info */
+ low_string = h5_get_version_string(low);
+ high_string = h5_get_version_string(high);
+ HDsprintf(msg, "Testing virtual dataset with file version bounds: (%s, %s):", low_string, high_string);
+ HDputs(msg);
+
+ for(bit_config = 0; bit_config < TEST_IO_NTESTS; bit_config++) {
+ HDprintf("Config: %s%s%s\n", bit_config & TEST_IO_CLOSE_SRC ? "closed source dataset, " : "", bit_config & TEST_IO_DIFFERENT_FILE ? "different source file" : "same source file", bit_config & TEST_IO_REOPEN_VIRT ? ", reopen virtual file" : "");
+ nerrors += test_vds_prefix_second(bit_config, fapl);
+ }
+
+ /* Verify symbol table messages are cached */
+ nerrors += (h5_verify_cached_stabs(FILENAME, my_fapl) < 0 ? 1 : 0);
+
+ } /* end for high */
+ } /* end for low */
+
+ if(H5Pclose(my_fapl) < 0)
+ TEST_ERROR
+
+ if(nerrors)
+ goto error;
+ HDprintf("All virtual dataset tests passed.\n");
+ h5_cleanup(FILENAME, fapl);
+
+ return EXIT_SUCCESS;
+
+error:
+ nerrors = MAX(1, nerrors);
+ HDprintf("***** %d VIRTUAL DATASET TEST%s FAILED! *****\n",
+ nerrors, 1 == nerrors ? "" : "S");
+ return EXIT_FAILURE;
+} /* end main() */
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index a8e4d50..edb01bc 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -77,87 +77,25 @@
/* Dataset dimensions */
#define SM_HEIGHT 2 /* K */
#define LG_HEIGHT 4 /* N */
-#define SM_LG_HEIGHT 6 /* SM_HEIGHT + LG_HEIGHT */
#define FULL_HEIGHT 18 /* (3 * K) + (3 * N) */
-#define HALF_HEIGHT 9
#define WIDTH 8 /* M */
-#define HALF_WIDTH 4
-
-/* Max number of planes in the dataset */
-#define N_MAX_PLANES H5S_UNLIMITED
/* Number of planes each writer will write */
#define N_PLANES_TO_WRITE 25
-/* Dataset datatypes */
-#define SOURCE_DATATYPE H5T_STD_I32LE
-#define VDS_DATATYPE H5T_STD_I32LE
-
-/* Starting size of datasets, both source and VDS */
-static hsize_t DIMS[N_SOURCES][RANK] = {
- {0, SM_HEIGHT, WIDTH},
- {0, LG_HEIGHT, WIDTH},
- {0, SM_HEIGHT, WIDTH},
- {0, LG_HEIGHT, WIDTH},
- {0, SM_HEIGHT, WIDTH},
- {0, LG_HEIGHT, WIDTH}
-};
-static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH};
-
-/* Maximum size of datasets, both source and VDS.
- * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max
- * number of planes written out by the writers before they stop.
- * That number is specified separately.
- */
-static hsize_t MAX_DIMS[N_SOURCES][RANK] = {
- {N_MAX_PLANES, SM_HEIGHT, WIDTH},
- {N_MAX_PLANES, LG_HEIGHT, WIDTH},
- {N_MAX_PLANES, SM_HEIGHT, WIDTH},
- {N_MAX_PLANES, LG_HEIGHT, WIDTH},
- {N_MAX_PLANES, SM_HEIGHT, WIDTH},
- {N_MAX_PLANES, LG_HEIGHT, WIDTH}
-};
-static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH};
-
/* Planes */
-static hsize_t PLANES[N_SOURCES][RANK] = {
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH}
-};
-static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH};
+H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK];
/* File names for source datasets */
-static char FILE_NAMES[N_SOURCES][NAME_LEN] = {
- {"vds_swmr_src_a.h5"},
- {"vds_swmr_src_b.h5"},
- {"vds_swmr_src_c.h5"},
- {"vds_swmr_src_d.h5"},
- {"vds_swmr_src_e.h5"},
- {"vds_swmr_src_f.h5"}
-};
+H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN];
/* VDS file name */
-static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN];
/* Dataset names */
-static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset";
-static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
-static char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
+H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN];
+H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN];
/* Fill values */
-static int32_t FILL_VALUES[N_SOURCES] = {
- -1,
- -2,
- -3,
- -4,
- -5,
- -6
-};
-static int32_t VDS_FILL_VALUE = -9;
-
#endif /* VDS_SWMR_H */
diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c
index 24c6131..b14ecc2 100644
--- a/test/vds_swmr_gen.c
+++ b/test/vds_swmr_gen.c
@@ -14,6 +14,52 @@
#include "h5test.h"
#include "vds_swmr.h"
+/* Max number of planes in the dataset */
+#define N_MAX_PLANES H5S_UNLIMITED
+
+/* Dataset datatypes */
+#define SOURCE_DATATYPE H5T_STD_I32LE
+#define VDS_DATATYPE H5T_STD_I32LE
+
+/* Starting size of datasets, both source and VDS */
+static hsize_t DIMS[N_SOURCES][RANK] = {
+ {0, SM_HEIGHT, WIDTH},
+ {0, LG_HEIGHT, WIDTH},
+ {0, SM_HEIGHT, WIDTH},
+ {0, LG_HEIGHT, WIDTH},
+ {0, SM_HEIGHT, WIDTH},
+ {0, LG_HEIGHT, WIDTH}
+};
+static hsize_t VDS_DIMS[RANK] = {0, FULL_HEIGHT, WIDTH};
+
+/* Maximum size of datasets, both source and VDS.
+ * NOTE: Theoretical (i.e.: H5S_UNLIMITED), not the actual max
+ * number of planes written out by the writers before they stop.
+ * That number is specified separately.
+ */
+static hsize_t MAX_DIMS[N_SOURCES][RANK] = {
+ {N_MAX_PLANES, SM_HEIGHT, WIDTH},
+ {N_MAX_PLANES, LG_HEIGHT, WIDTH},
+ {N_MAX_PLANES, SM_HEIGHT, WIDTH},
+ {N_MAX_PLANES, LG_HEIGHT, WIDTH},
+ {N_MAX_PLANES, SM_HEIGHT, WIDTH},
+ {N_MAX_PLANES, LG_HEIGHT, WIDTH}
+};
+static hsize_t VDS_MAX_DIMS[RANK] = {N_MAX_PLANES, FULL_HEIGHT, WIDTH};
+
+static char SOURCE_DSET_NAME[NAME_LEN] = "source_dset";
+
+static int32_t FILL_VALUES[N_SOURCES] = {
+ -1,
+ -2,
+ -3,
+ -4,
+ -5,
+ -6
+};
+
+static int32_t VDS_FILL_VALUE = -9;
+
int
main(void)
{
@@ -61,7 +107,7 @@ main(void)
map_start = 0;
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
@@ -99,11 +145,13 @@ main(void)
if(H5Sselect_hyperslab(src_sid, H5S_SELECT_SET, start, NULL,
MAX_DIMS[i], NULL) < 0)
TEST_ERROR
- start[1] = map_start;
+ start[1] = (hsize_t)map_start;
if(H5Sselect_hyperslab(vds_sid, H5S_SELECT_SET, start, NULL,
MAX_DIMS[i], NULL) < 0)
TEST_ERROR
- map_start += PLANES[i][1];
+ if(PLANES[i][1] > INT_MAX)
+ TEST_ERROR
+ map_start += (int)PLANES[i][1];
/* Add VDS mapping */
if(H5Pset_virtual(vds_dcplid, vds_sid, FILE_NAMES[i],
diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c
index 1de0cc5..1ee65a0 100644
--- a/test/vds_swmr_reader.c
+++ b/test/vds_swmr_reader.c
@@ -14,10 +14,13 @@
#include "h5test.h"
#include "vds_swmr.h"
+static hsize_t VDS_PLANE[RANK] = {1, FULL_HEIGHT, WIDTH};
+
int
main(void)
{
hid_t fid = -1; /* HDF5 file ID */
+ hid_t faplid = -1; /* file access property list ID */
hid_t did = -1; /* dataset ID */
hid_t msid = -1; /* memory dataspace ID */
hid_t fsid = -1; /* file dataspace ID */
@@ -32,18 +35,20 @@ main(void)
hsize_t dims[RANK]; /* current size of dataset */
hsize_t max_dims[RANK]; /* max size of dataset */
- hbool_t has_errors = FALSE;/* if the read data contains errors */
-
/* Open the VDS file and dataset */
- if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, H5P_DEFAULT)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
+ TEST_ERROR
+ if((fid = H5Fopen(VDS_FILE_NAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, faplid)) < 0)
TEST_ERROR
if((did = H5Dopen2(fid, VDS_DSET_NAME, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Create the read buffer */
- n_elements = VDS_PLANE[1] * VDS_PLANE[2];
- size = n_elements * sizeof(int);
+ if(VDS_PLANE[1] * VDS_PLANE[2] > INT_MAX)
+ TEST_ERROR
+ n_elements = (int)(VDS_PLANE[1] * VDS_PLANE[2]);
+ size = (size_t)n_elements * sizeof(int);
if(NULL == (buffer = (int *)HDmalloc(size)))
TEST_ERROR
@@ -99,13 +104,14 @@ main(void)
TEST_ERROR
if(H5Dread(did, H5T_NATIVE_INT, msid, fsid, H5P_DEFAULT, buffer) < 0)
TEST_ERROR
-
if(H5Sclose(fsid) < 0)
TEST_ERROR
} while (dims[0] < N_PLANES_TO_WRITE);
/* Close file and dataset */
+ if(H5Pclose(faplid) < 0)
+ TEST_ERROR
if(H5Sclose(msid) < 0)
TEST_ERROR
if(H5Dclose(did) < 0)
@@ -123,6 +129,8 @@ error:
H5E_BEGIN_TRY {
if(fid >= 0)
(void)H5Fclose(fid);
+ if(faplid >= 0)
+ (void)H5Pclose(faplid);
if(did >= 0)
(void)H5Dclose(did);
if(msid >= 0)
diff --git a/test/vds_swmr_writer.c b/test/vds_swmr_writer.c
index 7824aa0..d70352d 100644
--- a/test/vds_swmr_writer.c
+++ b/test/vds_swmr_writer.c
@@ -43,7 +43,7 @@ main(int argc, char *argv[])
******************************/
/* The file number is passed on the command line.
- * This is an integer index into the FILE_NAMES array.
+ * This is an integer index into the FILE_NAMES array.
*/
if(argc != 2) {
HDfprintf(stderr, "ERROR: Must pass the source file number on the command line.\n");
@@ -56,7 +56,7 @@ main(int argc, char *argv[])
/* Open the source file and dataset */
/* All SWMR files need to use the latest file format */
- if((faplid = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((faplid = h5_fileaccess()) < 0)
TEST_ERROR
if(H5Pset_libver_bounds(faplid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
TEST_ERROR
diff --git a/test/vfd.c b/test/vfd.c
index 5d5ebfc..d94aec6 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -25,6 +25,7 @@
#define FAMILY_SIZE (1*KB)
#define FAMILY_SIZE2 (5*KB)
#define MULTI_SIZE 128
+#define SPLITTER_SIZE 8 /* dimensions of a dataset */
#define CORE_INCREMENT (4*KB)
#define CORE_PAGE_SIZE (1024*KB)
@@ -58,6 +59,10 @@ const char *FILENAME[] = {
"stdio_file", /*7*/
"windows_file", /*8*/
"new_multi_file_v16",/*9*/
+ "ro_s3_file", /*10*/
+ "splitter_rw_file", /*11*/
+ "splitter_wo_file", /*12*/
+ "splitter.log", /*13*/
NULL
};
@@ -65,8 +70,47 @@ const char *FILENAME[] = {
#define COMPAT_BASENAME "family_v16_"
#define MULTI_COMPAT_BASENAME "multi_file_v16"
+#define SPLITTER_DATASET_NAME "dataset"
+
+/* Macro: HEXPRINT()
+ * Helper macro to pretty-print hexadecimal output of a buffer of known size.
+ * Each line has the address of the first printed byte, and four columns of
+ * four-byte data.
+ */
+static int __k;
+#define HEXPRINT(size, buf) \
+for (__k = 0; __k < (size); __k++) { \
+ if (__k % 16 == 0) { \
+ HDprintf("\n%04x", __k); \
+ } \
+ HDprintf((__k%4 == 0) ? " %02X" : " %02X", (unsigned char)(buf)[__k]); \
+} /* end #define HEXPRINT() */
+
+
+/* Helper structure to pass around dataset information.
+ */
+struct splitter_dataset_def {
+ void *buf; /* contents of dataset */
+ const char *dset_name; /* dataset name, always added to root group */
+ hid_t mem_type_id; /* datatype */
+ const hsize_t *dims; /* dimensions */
+ int n_dims; /* rank */
+};
+
+static int splitter_prepare_file_paths(H5FD_splitter_vfd_config_t *vfd_config,
+ char *filename_rw_out);
+static int splitter_create_single_file_at(const char *filename, hid_t fapl_id,
+ const struct splitter_dataset_def *data);
+static int splitter_compare_expected_data(hid_t file_id,
+ const struct splitter_dataset_def *data);
+static int run_splitter_test(const struct splitter_dataset_def *data,
+ hbool_t ignore_wo_errors, hbool_t provide_logfile_path,
+ hid_t sub_fapl_ids[2]);
+static int splitter_RO_test(const struct splitter_dataset_def *data,
+ hid_t child_fapl_id);
+static int splitter_tentative_open_test(hid_t child_fapl_id);
+static int file_exists(const char *filename, hid_t fapl_id);
-
/*-------------------------------------------------------------------------
* Function: test_sec2
*
@@ -149,7 +193,7 @@ test_sec2(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* Currently it should be around 2 KB.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -178,7 +222,7 @@ error:
return -1;
} /* end test_sec2() */
-
+
/*-------------------------------------------------------------------------
* Function: test_core
*
@@ -258,7 +302,7 @@ test_core(void)
| H5FD_FEAT_ACCUMULATE_METADATA
| H5FD_FEAT_DATA_SIEVE
| H5FD_FEAT_AGGREGATE_SMALLDATA
- | H5FD_FEAT_ALLOW_FILE_IMAGE
+ | H5FD_FEAT_ALLOW_FILE_IMAGE
| H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS))
TEST_ERROR
@@ -341,7 +385,7 @@ test_core(void)
/* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -379,7 +423,7 @@ test_core(void)
for(i = 0; i < CORE_DSET_DIM1; i++)
for(j = 0; j < CORE_DSET_DIM2; j++)
*pw++ = val++;
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
/* Create the dataspace */
dims[0] = CORE_DSET_DIM1;
@@ -412,8 +456,8 @@ test_core(void)
for(j = 0; j < CORE_DSET_DIM2; j++)
if(*pr++ != *pw++) {
H5_FAILED();
- printf(" Read different values than written in data set.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -469,7 +513,7 @@ test_core(void)
TEST_ERROR;
/* Read the data back from the dataset */
- HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
+ HDmemset(data_r, 0, DSET1_DIM1 * DSET1_DIM2 * sizeof(int));
if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_r) < 0)
TEST_ERROR;
@@ -480,15 +524,15 @@ test_core(void)
for(j = 0; j < CORE_DSET_DIM2; j++)
if(*pw++ != *pr++) {
H5_FAILED();
- printf(" Read different values than written in data set.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
/* Check file size API.
* There is no garantee the size of metadata in file is constant.
* Just try to check if it's reasonable.
- *
+ *
* TODO: Needs justification of why is this is a reasonable size.
*/
if(H5Fget_filesize(fid, &file_size) < 0)
@@ -534,7 +578,7 @@ error:
return -1;
} /* end test_core() */
-
+
/*-------------------------------------------------------------------------
* Function: test_direct
*
@@ -561,6 +605,7 @@ test_direct(void)
size_t mbound;
size_t fbsize;
size_t cbsize;
+ void *proto_points = NULL, *proto_check = NULL;
int *points = NULL, *check = NULL, *p1 = NULL, *p2 = NULL;
int wdata2[DSET2_DIM] = {11,12,13,14};
int rdata2[DSET2_DIM];
@@ -597,7 +642,7 @@ test_direct(void)
if(file<0) {
H5Pclose (fapl);
SKIPPED();
- printf(" Probably the file system doesn't support Direct I/O\n");
+ HDprintf(" Probably the file system doesn't support Direct I/O\n");
return 0;
}
@@ -632,10 +677,12 @@ test_direct(void)
/* Allocate aligned memory for data set 1. For data set 1, everything is aligned including
* memory address, size of data, and file address. */
- if(0 != HDposix_memalign(&points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int))))
+ if(0 != HDposix_memalign(&proto_points, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int))))
TEST_ERROR;
- if(0 != HDposix_memalign(&check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int))))
+ points = proto_points;
+ if(0 != HDposix_memalign(&proto_check, (size_t)FBSIZE, (size_t)(DSET1_DIM1 * DSET1_DIM2 * sizeof(int))))
TEST_ERROR;
+ check = proto_check;
/* Initialize the dset1 */
p1 = points;
@@ -674,8 +721,8 @@ test_direct(void)
for(j = 0; j < DSET1_DIM2; j++)
if(*p1++ != *p2++) {
H5_FAILED();
- printf(" Read different values than written in data set 1.\n");
- printf(" At index %d,%d\n", i, j);
+ HDprintf(" Read different values than written in data set 1.\n");
+ HDprintf(" At index %d,%d\n", i, j);
TEST_ERROR;
} /* end if */
@@ -706,8 +753,8 @@ test_direct(void)
for(i = 0; i < DSET2_DIM; i++)
if(wdata2[i] != rdata2[i]) {
H5_FAILED();
- printf(" Read different values than written in data set 2.\n");
- printf(" At index %d\n", i);
+ HDprintf(" Read different values than written in data set 2.\n");
+ HDprintf(" At index %d\n", i);
TEST_ERROR;
} /* end if */
@@ -745,16 +792,16 @@ error:
H5Fclose(file);
} H5E_END_TRY;
- if(points)
- HDfree(points);
- if(check)
- HDfree(check);
+ if(proto_points)
+ HDfree(proto_points);
+ if(proto_check)
+ HDfree(proto_check);
return -1;
#endif /*H5_HAVE_DIRECT*/
}
-
+
/*-------------------------------------------------------------------------
* Function: test_family_opens
*
@@ -769,6 +816,13 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'first_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
test_family_opens(char *fname, hid_t fa_pl)
{
@@ -825,15 +879,15 @@ test_family_opens(char *fname, hid_t fa_pl)
error:
return -1;
} /* end test_family_opens() */
+H5_GCC_DIAG_ON(format-nonliteral)
+
-
/*-------------------------------------------------------------------------
* Function: test_family
*
* Purpose: Tests the file handle interface for FAMILY driver
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Tuesday, Sept 24, 2002
@@ -848,15 +902,24 @@ test_family(void)
hid_t driver_id = -1; /* ID for this VFD */
unsigned long driver_flags = 0; /* VFD feature flags */
char filename[1024];
- char dname[]="dataset";
+ char dname[] = "dataset";
unsigned int i, j;
int *fhandle=NULL, *fhandle2=NULL;
- int buf[FAMILY_NUMBER][FAMILY_SIZE];
+ int **buf = NULL;
+ int *buf_data = NULL;
hsize_t dims[2]={FAMILY_NUMBER, FAMILY_SIZE};
hsize_t file_size;
TESTING("FAMILY file driver");
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < FAMILY_NUMBER; i++)
+ buf[i] = buf_data + (i * FAMILY_SIZE);
+
/* Set property list and file name for FAMILY driver */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
@@ -880,7 +943,7 @@ test_family(void)
| H5FD_FEAT_AGGREGATE_SMALLDATA))
TEST_ERROR
- if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
if(H5Fclose(file) < 0)
@@ -895,7 +958,7 @@ test_family(void)
if(H5Pset_fapl_family(fapl, (hsize_t)H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
+ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
/* Check file size API */
@@ -907,7 +970,7 @@ test_family(void)
TEST_ERROR;
/* Create and write dataset */
- if((space=H5Screate_simple(2, dims, NULL)) < 0)
+ if((space = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
/* Retrieve the access property list... */
@@ -922,14 +985,14 @@ test_family(void)
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;
- if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i = 0; i < FAMILY_NUMBER; i++)
for(j = 0; j < FAMILY_SIZE; j++)
buf[i][j] = (int)((i * 10000) + j);
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR;
/* check file handle API */
@@ -994,8 +1057,11 @@ test_family(void)
if(H5Pclose(fapl) < 0)
TEST_ERROR;
+ HDfree(buf);
+ HDfree(buf_data);
+
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1005,10 +1071,14 @@ error:
H5Pclose(fapl2);
H5Fclose(file);
} H5E_END_TRY;
- return -1;
-}
-
+ HDfree(buf);
+ HDfree(buf_data);
+
+ return FAIL;
+} /* end test_family() */
+
+
/*-------------------------------------------------------------------------
* Function: test_family_compat
*
@@ -1027,6 +1097,13 @@ error:
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'newname_individual', etc. in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
test_family_compat(void)
{
@@ -1110,26 +1187,150 @@ error:
return -1;
} /* end test_family_compat() */
+H5_GCC_DIAG_ON(format-nonliteral)
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_family_member_fapl
+ *
+ * Purpose: Actually use the member fapl input to the member vfd.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ * Programmer: Jacob Smith
+ * 21 May 2019
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_family_member_fapl(void)
+{
+ hid_t file = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t memb_fapl_id = H5I_INVALID_HID;
+ hid_t space = H5I_INVALID_HID;
+ hid_t dset = H5I_INVALID_HID;
+ char filename[1024];
+ char dname[] = "dataset";
+ unsigned i = 0;
+ unsigned j = 0;
+ int **buf = NULL;
+ int *buf_data = NULL;
+ hsize_t dims[2] = {FAMILY_NUMBER, FAMILY_SIZE};
+
+ TESTING("Family member FAPL");
+
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(FAMILY_NUMBER * FAMILY_SIZE, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(FAMILY_NUMBER, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < FAMILY_NUMBER; i++)
+ buf[i] = buf_data + (i * FAMILY_SIZE);
+
+ if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ if((memb_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ if (H5Pset_fapl_sec2(memb_fapl_id) == FAIL)
+ TEST_ERROR;
+ if (H5Pset_fapl_family(fapl_id, (hsize_t)FAMILY_SIZE, memb_fapl_id) == FAIL)
+ TEST_ERROR;
+
+ h5_fixname(FILENAME[2], fapl_id, filename, sizeof(filename));
+
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ if((space = H5Screate_simple(2, dims, NULL)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ /* Create and write to dataset, then close file.
+ */
+ if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ for (i = 0; i < FAMILY_NUMBER; i++) {
+ for (j = 0; j < FAMILY_SIZE; j++) {
+ buf[i][j] = (int)((i * 10000) + j);
+ }
+ }
+
+ if (H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) == FAIL)
+ TEST_ERROR;
+
+ if (H5Dclose(dset) == FAIL)
+ TEST_ERROR;
+ if (H5Sclose(space) == FAIL)
+ TEST_ERROR;
+ if (H5Fclose(file) == FAIL)
+ TEST_ERROR;
+
+ /* "Close" member FAPL at top level and re-open file.
+ * Should succeed, with library managing reference count properly
+ */
+ if (H5Pclose(memb_fapl_id) == FAIL)
+ TEST_ERROR;
+
+ if ((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) == H5I_INVALID_HID)
+ TEST_ERROR;
+
+ if (H5Fclose(file) == FAIL)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[2], fapl_id);
+
+ if (H5Pclose(fapl_id) == FAIL)
+ TEST_ERROR;
+
+ HDfree(buf);
+ HDfree(buf_data);
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Sclose(space);
+ H5Dclose(dset);
+ H5Pclose(memb_fapl_id);
+ H5Pclose(fapl_id);
+ H5Fclose(file);
+ } H5E_END_TRY;
+
+ HDfree(buf);
+ HDfree(buf_data);
+
+ return FAIL;
+} /* end test_family_member_fapl() */
+
-
/*-------------------------------------------------------------------------
* Function: test_multi_opens
*
* Purpose: Private function for test_multi() to tests wrong ways of
* reopening multi file.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Thursday, May 19, 2005
*
*-------------------------------------------------------------------------
*/
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'sf_name' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+H5_GCC_DIAG_OFF(format-nonliteral)
static herr_t
test_multi_opens(char *fname)
{
- hid_t file=-1;
+ hid_t fid = H5I_INVALID_HID;
char super_name[1024]; /*name string "%%s-s.h5"*/
char sf_name[1024]; /*name string "multi_file-s.h5"*/
@@ -1138,20 +1339,20 @@ test_multi_opens(char *fname)
HDsnprintf(sf_name, sizeof(sf_name), super_name, fname);
H5E_BEGIN_TRY {
- file = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
+ fid = H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
} H5E_END_TRY;
- return(file >= 0 ? -1 : 0);
-}
+ return(fid >= 0 ? FAIL : SUCCEED);
+} /* end test_multi_opens() */
+H5_GCC_DIAG_ON(format-nonliteral)
+
-
/*-------------------------------------------------------------------------
* Function: test_multi
*
* Purpose: Tests the file handle interface for MUTLI driver
*
- * Return: Success: 0
- * Failure: -1
+ * Return: SUCCEED/FAIL
*
* Programmer: Raymond Lu
* Tuesday, Sept 24, 2002
@@ -1179,10 +1380,19 @@ test_multi(void)
char dname[]="dataset";
char meta[] = "this is some metadata on this file";
int i, j;
- int buf[MULTI_SIZE][MULTI_SIZE];
+ int **buf = NULL;
+ int *buf_data = NULL;
TESTING("MULTI file driver");
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(MULTI_SIZE * MULTI_SIZE, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(MULTI_SIZE, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < MULTI_SIZE; i++)
+ buf[i] = buf_data + (i * MULTI_SIZE);
+
/* Set file access property list for MULTI driver */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
@@ -1193,7 +1403,7 @@ test_multi(void)
HDmemset(memb_addr, 0, sizeof(memb_addr));
HDmemset(sv, 0, sizeof(sv));
- for(mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ for(mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++) {
memb_fapl[mt] = H5P_DEFAULT;
memb_map[mt] = H5FD_MEM_SUPER;
}
@@ -1201,19 +1411,19 @@ test_multi(void)
memb_map[H5FD_MEM_BTREE] = H5FD_MEM_BTREE;
memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP;
- 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/4;
- 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/2;
- 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/4)*3;
@@ -1285,7 +1495,7 @@ test_multi(void)
for(i=0; i<MULTI_SIZE; i++)
for(j=0; j<MULTI_SIZE; j++)
buf[i][j] = i*10000+j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR;
if((fapl2=H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -1330,7 +1540,7 @@ test_multi(void)
if((atype = H5Tcopy(H5T_C_S1)) < 0)
TEST_ERROR;
- if(H5Tset_size(atype, strlen(meta) + 1) < 0)
+ if(H5Tset_size(atype, HDstrlen(meta) + 1) < 0)
TEST_ERROR;
if(H5Tset_strpad(atype, H5T_STR_NULLTERM) < 0)
@@ -1363,9 +1573,12 @@ test_multi(void)
if(H5Pclose(fapl) < 0)
TEST_ERROR;
+ HDfree(buf);
+ HDfree(buf_data);
+
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1374,18 +1587,23 @@ error:
H5Pclose(fapl);
H5Pclose(fapl2);
H5Fclose(file);
+ H5Aclose(attr);
} H5E_END_TRY;
- return -1;
-}
-
+ HDfree(buf);
+ HDfree(buf_data);
+
+ return FAIL;
+} /* end test_multi() */
+
+
/*-------------------------------------------------------------------------
* Function: test_multi_compat
*
* Purpose: Tests the backward compatibility for MULTI driver.
* See if we can open files created with v1.6 library.
* The source file was created by the test/file_handle.c
- * of the v1.6 library. This test verifies the fix for
+ * of the v1.6 library. This test verifies the fix for
* Issue 2598. In v1.6 library, there was EOA for the whole
* MULTI file saved in the super block. We took it out in
* v1.8 library because it's meaningless for the MULTI file.
@@ -1413,10 +1631,19 @@ test_multi_compat(void)
char sv[H5FD_MEM_NTYPES][32];
hsize_t dims[2]={MULTI_SIZE, MULTI_SIZE};
int i, j;
- int buf[MULTI_SIZE][MULTI_SIZE];
+ int **buf = NULL;
+ int *buf_data = NULL;
TESTING("MULTI file driver backward compatibility");
+ /* Set up data array */
+ if(NULL == (buf_data = (int *)HDcalloc(MULTI_SIZE * MULTI_SIZE, sizeof(int))))
+ TEST_ERROR;
+ if(NULL == (buf = (int **)HDcalloc(MULTI_SIZE, sizeof(buf_data))))
+ TEST_ERROR;
+ for (i = 0; i < MULTI_SIZE; i++)
+ buf[i] = buf_data + (i * MULTI_SIZE);
+
/* Set file access property list for MULTI driver */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
@@ -1427,17 +1654,17 @@ test_multi_compat(void)
HDmemset(memb_addr, 0, sizeof memb_addr);
HDmemset(sv, 0, sizeof sv);
- for(mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt))
+ for(mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt++)
memb_map[mt] = H5FD_MEM_SUPER;
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT;
- 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;
memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT;
- 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/2;
@@ -1446,18 +1673,20 @@ test_multi_compat(void)
h5_fixname(FILENAME[9], fapl, newname, sizeof newname);
- /* Make copy for the data file in the build directory, to protect the
- * original file in the source directory */
- sprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
- sprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
+ /* Make copy for the data file in the build directory, to protect the
+ * original file in the source directory
+ */
+ HDsprintf(filename_s, "%s-%c.h5", MULTI_COMPAT_BASENAME, 's');
+ HDsprintf(newname_s, "%s-%c.h5", FILENAME[9], 's');
h5_make_local_copy(filename_s, newname_s);
- sprintf(filename_r, "%s-%c.h5", MULTI_COMPAT_BASENAME, 'r');
- sprintf(newname_r, "%s-%c.h5", FILENAME[9], 'r');
+ HDsprintf(filename_r, "%s-%c.h5", MULTI_COMPAT_BASENAME, 'r');
+ HDsprintf(newname_r, "%s-%c.h5", FILENAME[9], 'r');
h5_make_local_copy(filename_r, newname_r);
/* Reopen the file for read only. Verify 1.8 library can open file
- * created with 1.6 library. */
+ * created with 1.6 library.
+ */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
@@ -1483,7 +1712,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for adding another dataset. The new EOA for metadata file
+ /* Reopen the file for adding another dataset. The new EOA for metadata file
* should be written to the file */
if((file=H5Fopen(newname, H5F_ACC_RDWR, fapl)) < 0)
TEST_ERROR;
@@ -1498,7 +1727,7 @@ test_multi_compat(void)
for(i=0; i<MULTI_SIZE; i++)
for(j=0; j<MULTI_SIZE; j++)
buf[i][j] = i*10000+j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_data) < 0)
TEST_ERROR;
if(H5Dclose(dset) < 0)
@@ -1510,7 +1739,7 @@ test_multi_compat(void)
if(H5Fclose(file) < 0)
TEST_ERROR;
- /* Reopen the file for read only again. Verify the library can handle
+ /* Reopen the file for read only again. Verify the library can handle
* the EOA correctly */
if((file=H5Fopen(newname, H5F_ACC_RDONLY, fapl)) < 0)
TEST_ERROR;
@@ -1536,9 +1765,12 @@ test_multi_compat(void)
if(H5Pclose(fapl) < 0)
TEST_ERROR;
+ HDfree(buf);
+ HDfree(buf_data);
+
PASSED();
- return 0;
+ return SUCCEED;
error:
H5E_BEGIN_TRY {
@@ -1547,10 +1779,14 @@ error:
H5Pclose(fapl);
H5Fclose(file);
} H5E_END_TRY;
- return -1;
-}
-
+ HDfree(buf);
+ HDfree(buf_data);
+
+ return FAIL;
+} /* end test_multi_compat() */
+
+
/*-------------------------------------------------------------------------
* Function: test_log
*
@@ -1661,7 +1897,7 @@ error:
return -1;
}
-
+
/*-------------------------------------------------------------------------
* Function: test_stdio
*
@@ -1766,7 +2002,7 @@ error:
}
-
+
/*-------------------------------------------------------------------------
* Function: test_windows
*
@@ -1888,7 +2124,1151 @@ 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() */
+
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Macro: SPLITTER_TEST_FAULT()
+ *
+ * utility macro, helps create stack-like backtrace on error.
+ * requires defined in the calling function:
+ * * variable `int ret_value` (return -1 on error)`
+ * * label `done` for exit on fault
+ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+#define SPLITTER_TEST_FAULT(mesg) { \
+ H5_FAILED(); \
+ AT(); \
+ HDfprintf(stderr, mesg); \
+ H5Eprint2(H5E_DEFAULT, stderr); \
+ fflush(stderr); \
+ ret_value = -1; \
+ goto done; \
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: compare_splitter_config_info
+ *
+ * Purpose: Helper function to compare configuration info found in a
+ * FAPL against a canonical structure.
+ *
+ * Return: Success: 0, if config info in FAPL matches info structure.
+ * Failure: -1, if difference detected.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+compare_splitter_config_info(hid_t fapl_id, H5FD_splitter_vfd_config_t *info)
+{
+ int ret_value = 0;
+ H5FD_splitter_vfd_config_t fetched_info;
+
+ fetched_info.magic = H5FD_SPLITTER_MAGIC;
+ fetched_info.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ fetched_info.rw_fapl_id = H5I_INVALID_HID;
+ fetched_info.wo_fapl_id = H5I_INVALID_HID;
+
+ if (H5Pget_fapl_splitter(fapl_id, &fetched_info) < 0) {
+ SPLITTER_TEST_FAULT("can't get splitter info\n");
+ }
+ if (info->rw_fapl_id == H5P_DEFAULT) {
+ if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) {
+ SPLITTER_TEST_FAULT("Read-Write driver mismatch (default)\n");
+ }
+ }
+ else {
+ if (H5Pget_driver(fetched_info.rw_fapl_id) != H5Pget_driver(info->rw_fapl_id)) {
+ SPLITTER_TEST_FAULT("Read-Write driver mismatch\n");
+ }
+ }
+ if (info->wo_fapl_id == H5P_DEFAULT) {
+ if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(H5P_FILE_ACCESS_DEFAULT)) {
+ SPLITTER_TEST_FAULT("Write-Only driver mismatch (default)\n");
+ }
+ }
+ else {
+ if (H5Pget_driver(fetched_info.wo_fapl_id) != H5Pget_driver(info->wo_fapl_id)) {
+ SPLITTER_TEST_FAULT("Write-Only driver mismatch\n");
+ }
+ }
+ if ( (HDstrlen(info->wo_path) != HDstrlen(fetched_info.wo_path)) ||
+ HDstrncmp(info->wo_path, fetched_info.wo_path, H5FD_SPLITTER_PATH_MAX))
+ {
+ HDfprintf(stderr, "MISMATCH: '%s' :: '%s'\n", info->wo_path, fetched_info.wo_path);
+ HEXPRINT(H5FD_SPLITTER_PATH_MAX, info->wo_path);
+ HEXPRINT(H5FD_SPLITTER_PATH_MAX, fetched_info.wo_path);
+ SPLITTER_TEST_FAULT("Write-Only file path mismatch\n");
+ }
+
+done:
+ return ret_value;
+} /* end compare_splitter_config_info() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: run_splitter_test
+ *
+ * Purpose: Auxiliary function for test_splitter().
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description:
+ * Perform basic open-write-close with the Splitter VFD.
+ * Prior to operations, removes files from a previous run,
+ * if they exist.
+ * After writing, compares read-write and write-only files.
+ * Includes FAPL sanity testing.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+run_splitter_test(const struct splitter_dataset_def *data,
+ hbool_t ignore_wo_errors,
+ hbool_t provide_logfile_path,
+ hid_t sub_fapl_ids[2])
+{
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t fapl_id_out = H5I_INVALID_HID;
+ hid_t fapl_id_cpy = H5I_INVALID_HID;
+ H5FD_splitter_vfd_config_t vfd_config;
+ char filename_rw[H5FD_SPLITTER_PATH_MAX + 1];
+ FILE *logfile = NULL;
+ int ret_value = 0;
+
+ vfd_config.magic = H5FD_SPLITTER_MAGIC;
+ vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config.ignore_wo_errs = ignore_wo_errors;
+ vfd_config.rw_fapl_id = sub_fapl_ids[0];
+ vfd_config.wo_fapl_id = sub_fapl_ids[1];
+
+ if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) {
+ SPLITTER_TEST_FAULT("can't prepare file paths\n");
+ }
+
+ if (provide_logfile_path == FALSE) {
+ *vfd_config.log_file_path = '\0'; /* reset as empty string */
+ }
+
+ /* Create a new fapl to use the SPLITTER file driver */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("can't create FAPL ID\n");
+ }
+ if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) {
+ SPLITTER_TEST_FAULT("can't set splitter FAPL\n");
+ }
+ if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) {
+ SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n");
+ }
+
+ if (compare_splitter_config_info(fapl_id, &vfd_config) < 0) {
+ SPLITTER_TEST_FAULT("information mismatch\n");
+ }
+
+ /*
+ * Copy property list, light compare, and close the copy.
+ * Helps test driver-implemented FAPL-copying and library ID management.
+ */
+
+ fapl_id_cpy = H5Pcopy(fapl_id);
+ if (H5I_INVALID_HID == fapl_id_cpy) {
+ SPLITTER_TEST_FAULT("can't copy FAPL\n");
+ }
+ if (compare_splitter_config_info(fapl_id_cpy, &vfd_config) < 0) {
+ SPLITTER_TEST_FAULT("information mismatch\n");
+ }
+ if (H5Pclose(fapl_id_cpy) < 0) {
+ SPLITTER_TEST_FAULT("can't close fapl copy\n");
+ }
+
+ /*
+ * Proceed with test. Create file.
+ */
+ file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (file_id < 0) {
+ SPLITTER_TEST_FAULT("can't create file\n");
+ }
+
+ /*
+ * Check driver from file
+ */
+
+ fapl_id_out = H5Fget_access_plist(file_id);
+ if (H5I_INVALID_HID == fapl_id_out) {
+ SPLITTER_TEST_FAULT("can't get file's FAPL\n");
+
+ }
+ if (H5Pget_driver(fapl_id_out) != H5FD_SPLITTER) {
+ SPLITTER_TEST_FAULT("wrong file FAPL driver\n");
+ }
+ if (compare_splitter_config_info(fapl_id_out, &vfd_config) < 0) {
+ SPLITTER_TEST_FAULT("information mismatch\n");
+ }
+ if (H5Pclose(fapl_id_out) < 0) {
+ SPLITTER_TEST_FAULT("can't close file's FAPL\n");
+ }
+
+ /*
+ * Create and write the dataset
+ */
+
+ space_id = H5Screate_simple(data->n_dims, data->dims, NULL);
+ if (space_id < 0) {
+ SPLITTER_TEST_FAULT("can't create dataspace\n");
+ }
+ dset_id = H5Dcreate2(file_id, data->dset_name, data->mem_type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if (dset_id < 0) {
+ SPLITTER_TEST_FAULT("can't create dataset\n");
+ }
+ if (H5Dwrite(dset_id, data->mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data->buf) < 0) {
+ SPLITTER_TEST_FAULT("can't write data to dataset\n");
+ }
+
+ /* Close everything */
+ if (H5Dclose(dset_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close dset\n");
+ }
+ if (H5Sclose(space_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close space\n");
+ }
+ if (H5Pclose(fapl_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close fapl\n");
+ }
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file\n");
+ }
+
+ /* Verify that the R/W and W/O files are identical */
+ if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
+ }
+
+ /* Verify existence of logfile iff appropriate */
+ logfile = fopen(vfd_config.log_file_path, "r");
+ if ( (TRUE == provide_logfile_path && NULL == logfile) ||
+ (FALSE == provide_logfile_path && NULL != logfile) )
+ {
+ SPLITTER_TEST_FAULT("no logfile when one was expected\n");
+ }
+
+done:
+ if (ret_value < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Dclose(dset_id);
+ (void)H5Sclose(space_id);
+ (void)H5Pclose(fapl_id_out);
+ (void)H5Pclose(fapl_id_cpy);
+ (void)H5Pclose(fapl_id);
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ }
+ if (logfile != NULL) {
+ fclose(logfile);
+ }
+ return ret_value;
+
+} /* end run_splitter_test() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: driver_is_splitter_compatible
+ *
+ * Purpose: Determine whether the driver set in the FAPL ID is compatible
+ * with the Splitter VFD -- specificially, Write-Only channel.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description: Attempts to put the given FAPL ID as the W/O channel.
+ * Uses driver's own mechanisms to generate error, and catches
+ * error.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+driver_is_splitter_compatible(hid_t fapl_id)
+{
+ H5FD_splitter_vfd_config_t vfd_config;
+ hid_t split_fapl_id = H5I_INVALID_HID;
+ herr_t ret = SUCCEED;
+ int ret_value = 0;
+
+ split_fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5I_INVALID_HID == split_fapl_id) {
+ FAIL_PUTS_ERROR("Can't create contained FAPL");
+ }
+ vfd_config.magic = H5FD_SPLITTER_MAGIC;
+ vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config.ignore_wo_errs = FALSE;
+ vfd_config.rw_fapl_id = H5P_DEFAULT;
+ vfd_config.wo_fapl_id = fapl_id;
+ HDstrncpy(vfd_config.wo_path, "nonesuch", H5FD_SPLITTER_PATH_MAX);
+ *vfd_config.log_file_path = '\0';
+
+ H5E_BEGIN_TRY {
+ ret = H5Pset_fapl_splitter(split_fapl_id, &vfd_config);
+ } H5E_END_TRY;
+ if (SUCCEED == ret) {
+ ret_value = -1;
+ }
+
+ if (H5Pclose(split_fapl_id) < 0) {
+ FAIL_PUTS_ERROR("Can't close contained FAPL")
+ }
+ split_fapl_id = H5I_INVALID_HID;
+
+ return ret_value;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(split_fapl_id);
+ } H5E_END_TRY;
+ return -1;
+} /* end driver_is_splitter_compatible() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: splitter_RO_test
+ *
+ * Purpose: Verify Splitter VFD with the Read-Only access flag.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description: Attempt read-only opening of files with different
+ * permutations of files already existing on-disk.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+splitter_RO_test(
+ const struct splitter_dataset_def *data,
+ hid_t child_fapl_id)
+{
+ char filename_rw[H5FD_SPLITTER_PATH_MAX + 1];
+ H5FD_splitter_vfd_config_t vfd_config;
+ hid_t fapl_id = H5I_INVALID_HID;
+ int ret_value = 0;
+ hid_t file_id = H5I_INVALID_HID;
+
+ vfd_config.magic = H5FD_SPLITTER_MAGIC;
+ vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config.ignore_wo_errs = FALSE;
+ vfd_config.rw_fapl_id = child_fapl_id;
+ vfd_config.wo_fapl_id = child_fapl_id;
+
+ if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) {
+ SPLITTER_TEST_FAULT("can't prepare splitter file paths\n");
+ }
+
+ /* Create a new fapl to use the SPLITTER file driver */
+ fapl_id = H5Pcreate(H5P_FILE_ACCESS);
+ if (H5I_INVALID_HID == fapl_id) {
+ SPLITTER_TEST_FAULT("can't create FAPL ID\n");
+ }
+ if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) {
+ SPLITTER_TEST_FAULT("can't set splitter FAPL\n");
+ }
+ if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) {
+ SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n");
+ }
+
+ /* Attempt R/O open when both files are nonexistent
+ * Should fail.
+ */
+
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ } H5E_END_TRY;
+ if (file_id >= 0) {
+ SPLITTER_TEST_FAULT("R/O open on nonexistent files unexpectedly successful\n");
+ }
+
+ /* Attempt R/O open when only W/O file exists
+ * Should fail.
+ */
+
+ if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) {
+ SPLITTER_TEST_FAULT("can't write W/O file\n");
+ }
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ } H5E_END_TRY;
+ if (file_id >= 0) {
+ SPLITTER_TEST_FAULT("R/O open with extant W/O file unexpectedly successful\n");
+ }
+ HDremove(vfd_config.wo_path);
+
+ /* Attempt R/O open when only R/W file exists
+ * Should fail.
+ */
+
+ if (splitter_create_single_file_at(filename_rw, vfd_config.rw_fapl_id, data) < 0) {
+ SPLITTER_TEST_FAULT("can't create R/W file\n");
+ }
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ } H5E_END_TRY;
+ if (file_id >= 0) {
+ SPLITTER_TEST_FAULT("R/O open with extant R/W file unexpectedly successful\n");
+ }
+
+ /* Attempt R/O open when both R/W and W/O files exist
+ */
+
+ if (splitter_create_single_file_at(vfd_config.wo_path, vfd_config.wo_fapl_id, data) < 0) {
+ SPLITTER_TEST_FAULT("can't create W/O file\n");
+ }
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDONLY, fapl_id);
+ if (file_id < 0) {
+ SPLITTER_TEST_FAULT("R/O open on two extant files failed\n");
+ }
+ if (splitter_compare_expected_data(file_id, data) < 0) {
+ SPLITTER_TEST_FAULT("data mismatch in R/W file\n");
+ }
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file(s)\n");
+ }
+ file_id = H5I_INVALID_HID;
+
+ /* Cleanup
+ */
+
+ if (H5Pclose(fapl_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close FAPL ID\n");
+ }
+ fapl_id = H5I_INVALID_HID;
+
+done:
+ if (ret_value < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ } /* end if error */
+ return ret_value;
+} /* end splitter_RO_test() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: splitter_prepare_file_paths
+ *
+ * Purpose: Get file paths ready for use by the Splitter VFD tests.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description:
+ * Use h5_fixname to adjust the splitter-relevant file paths
+ * from those given in FILENAMES.
+ *
+ * REMOVES EXISTING FILES AT THE PATH LOCATIONS PRIOR TO RETURN.
+ *
+ * The relevant file paths will be set in filename_rw_out and
+ * inside the config structure (wo_path, log_file_path).
+ *
+ * `filename_rw_out` must be at least H5FD_SPLITTER_PATH_MAX+1
+ * characters long.
+ *
+ * `vfd_config` must have its child FAPL IDs preset.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+splitter_prepare_file_paths(H5FD_splitter_vfd_config_t *vfd_config, char *filename_rw_out)
+{
+ int ret_value = 0;
+
+ if (vfd_config == NULL || vfd_config->magic != H5FD_SPLITTER_MAGIC) {
+ SPLITTER_TEST_FAULT("invalid splitter config pointer\n");
+ }
+ if (filename_rw_out == NULL) {
+ SPLITTER_TEST_FAULT("NULL filename_rw pointer\n");
+ }
+
+ /* TODO: sanity-check fapl IDs? */
+
+ /* Build the r/w file, w/o file, and the log file paths.
+ * Output is stored in the associated string pointers.
+ */
+ h5_fixname(FILENAME[11], vfd_config->rw_fapl_id, filename_rw_out, H5FD_SPLITTER_PATH_MAX);
+ h5_fixname(FILENAME[12], vfd_config->wo_fapl_id, vfd_config->wo_path, H5FD_SPLITTER_PATH_MAX);
+ h5_fixname_no_suffix(FILENAME[13], vfd_config->wo_fapl_id, vfd_config->log_file_path, H5FD_SPLITTER_PATH_MAX);
+
+ /* Delete any existing files on disk.
+ */
+ HDremove(filename_rw_out);
+ HDremove(vfd_config->wo_path);
+ HDremove(vfd_config->log_file_path);
+
+done:
+ return ret_value;
+} /* end splitter_prepare_file_paths() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: splitter_crate_single_file_at
+ *
+ * Purpose: Create a file, optionally w/ dataset.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description:
+ * Create a file at the given location with the given FAPL,
+ * and write data as defined in `data` in a pre-determined location in the file.
+ *
+ * If the dataset definition pointer is NULL, no data is written
+ * to the file.
+ *
+ * Will always overwrite an existing file with the given name/path.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+splitter_create_single_file_at(
+ const char *filename,
+ hid_t fapl_id,
+ const struct splitter_dataset_def *data)
+{
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ if (filename == NULL || *filename == '\0') {
+ SPLITTER_TEST_FAULT("filename is invalid\n");
+ }
+ /* TODO: sanity-check fapl id? */
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (file_id < 0) {
+ SPLITTER_TEST_FAULT("can't create file\n");
+ }
+
+ if (data) {
+ /* TODO: sanity-check data, if it exists? */
+ space_id = H5Screate_simple(data->n_dims, data->dims, NULL);
+ if (space_id < 0) {
+ SPLITTER_TEST_FAULT("can't create dataspace\n");
+ }
+
+ dset_id = H5Dcreate2(
+ file_id,
+ data->dset_name,
+ data->mem_type_id,
+ space_id,
+ H5P_DEFAULT,
+ H5P_DEFAULT,
+ H5P_DEFAULT);
+ if (dset_id < 0) {
+ SPLITTER_TEST_FAULT("can't create dataset\n");
+ }
+
+ if (H5Dwrite(dset_id, data->mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data->buf) < 0) {
+ SPLITTER_TEST_FAULT("can't write data to dataset\n");
+ }
+
+ if (H5Dclose(dset_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close dset\n");
+ }
+ if (H5Sclose(space_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close space\n");
+ }
+ } /* end if data definition is provided */
+
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file\n");
+ }
+
+done:
+ if (ret_value < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Dclose(dset_id);
+ (void)H5Sclose(space_id);
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ } /* end if error */
+ return ret_value;
+} /* end splitter_create_single_file_at() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: splitter_compare_expected_data
+ *
+ * Purpose: Compare data within a predermined dataset.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description: Read data from the file at a predetermined location, and
+ * compare its contents byte-for-byte with that expected in
+ * the `data` definition structure.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+splitter_compare_expected_data(hid_t file_id,
+ const struct splitter_dataset_def *data)
+{
+ hid_t dset_id = H5I_INVALID_HID;
+ int buf[SPLITTER_SIZE][SPLITTER_SIZE];
+ int expected[SPLITTER_SIZE][SPLITTER_SIZE];
+ size_t i = 0;
+ size_t j = 0;
+ int ret_value = 0;
+
+ if (sizeof((void *)buf) != sizeof(data->buf)) {
+ SPLITTER_TEST_FAULT("invariant size of expected data does not match that received!\n");
+ }
+ HDmemcpy(expected, data->buf, sizeof(expected));
+
+ dset_id = H5Dopen2(file_id, data->dset_name, H5P_DEFAULT);
+ if (dset_id < 0) {
+ SPLITTER_TEST_FAULT("can't open dataset\n");
+ }
+
+ if (H5Dread(dset_id, data->mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)buf) < 0) {
+ SPLITTER_TEST_FAULT("can't read dataset\n");
+ }
+
+ for (i=0; i < SPLITTER_SIZE; i++) {
+ for (j=0; j < SPLITTER_SIZE; j++) {
+ if (buf[i][j] != expected[i][j]) {
+ SPLITTER_TEST_FAULT("mismatch in expected data\n");
+ }
+ }
+ }
+
+ if (H5Dclose(dset_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close dataset\n");
+ }
+
+done:
+ if (ret_value < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Dclose(dset_id);
+ } H5E_END_TRY;
+ }
+ return ret_value;
+} /* end splitter_compare_expected_data() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: splitter_tentative_open_test()
+ *
+ * Purpose: Verifies Splitter behavior with "tentative" H5F_open.
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description:
+ * H5F_open() has a two-stage opening process when given a
+ * Read/Write access flag -- first it performs a "tentative
+ * open", where it checks to see whether files already exist
+ * on the system, done in such a way as to not "alter its state"
+ * (i.e., truncate).
+ * This can cause problems with the Splitter VFD, as the
+ * file on the R/W channel might exist already, but that on the
+ * W/O channel will not, and vice-versa.
+ *
+ * This test exists to verify that in any event, files will be
+ * created as required.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+splitter_tentative_open_test(hid_t child_fapl_id)
+{
+ char filename_rw[H5FD_SPLITTER_PATH_MAX + 1];
+ H5FD_splitter_vfd_config_t vfd_config;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t file_id = H5I_INVALID_HID;
+ int buf[SPLITTER_SIZE][SPLITTER_SIZE]; /* for comparison */
+ hsize_t dims[2] = { SPLITTER_SIZE, SPLITTER_SIZE }; /* for comparison */
+ int i = 0; /* for comparison */
+ int j = 0; /* for comparison */
+ struct splitter_dataset_def data; /* for comparison */
+ int ret_value = 0;
+
+ /* pre-fill data buffer to write */
+ for (i=0; i < SPLITTER_SIZE; i++) {
+ for (j=0; j < SPLITTER_SIZE; j++) {
+ buf[i][j] = i*100+j;
+ }
+ }
+
+ /* Dataset info */
+ data.buf = (void *)buf;
+ data.mem_type_id = H5T_NATIVE_INT;
+ data.dims = dims;
+ data.n_dims = 2;
+ data.dset_name = SPLITTER_DATASET_NAME;
+
+ vfd_config.magic = H5FD_SPLITTER_MAGIC;
+ vfd_config.version = H5FD_CURR_SPLITTER_VFD_CONFIG_VERSION;
+ vfd_config.ignore_wo_errs = FALSE;
+ vfd_config.rw_fapl_id = child_fapl_id;
+ vfd_config.wo_fapl_id = child_fapl_id;
+
+ if (splitter_prepare_file_paths(&vfd_config, filename_rw) < 0) {
+ SPLITTER_TEST_FAULT("can't prepare splitter file paths\n");
+ }
+
+ /* Create a new fapl to use the SPLITTER file driver */
+ if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("can't create FAPL ID\n");
+ }
+ if (H5Pset_fapl_splitter(fapl_id, &vfd_config) < 0) {
+ SPLITTER_TEST_FAULT("can't set splitter FAPL\n");
+ }
+ if (H5Pget_driver(fapl_id) != H5FD_SPLITTER) {
+ SPLITTER_TEST_FAULT("set FAPL not SPLITTER\n");
+ }
+
+ /* H5Fopen() with RDWR access.
+ * Neither file exist already
+ * Should fail.
+ */
+
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ } H5E_END_TRY;
+ if (file_id != H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("open with both nonexistent files unexpectedly succeeded\n");
+ }
+ if (file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file unexpectedly created\n");
+ }
+ if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file unexpectedly created\n");
+ }
+
+ /* H5Fopen() with RDWR access.
+ * W/O file exists already.
+ * Should fail.
+ */
+
+ if (splitter_create_single_file_at(vfd_config.wo_path, child_fapl_id, &data) < 0) {
+ SPLITTER_TEST_FAULT("can't write W/O file\n");
+ }
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ } H5E_END_TRY;
+ if (file_id != H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("open with nonexistent R/W file unexpectedly succeeded\n");
+ }
+ if (file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file unexpectedly created\n");
+ }
+ if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
+ }
+ HDremove(vfd_config.wo_path);
+ if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("failed to remove W/O file\n");
+ }
+
+ /* H5Fopen() with RDWR access.
+ * R/W file exists already.
+ * Should fail.
+ */
+
+ if (splitter_create_single_file_at(filename_rw, child_fapl_id, &data) < 0) {
+ SPLITTER_TEST_FAULT("can't write R/W file\n");
+ }
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ } H5E_END_TRY;
+ if (file_id != H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("open with nonexistent W/O unexpectedly succeeded\n");
+ }
+ if (!file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappeared\n");
+ }
+ if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file unexpectedly created\n");
+ }
+
+ /* H5Fopen() with RDWR access.
+ * Both files already exist.
+ */
+
+ if (splitter_create_single_file_at(vfd_config.wo_path, child_fapl_id, &data) < 0) {
+ SPLITTER_TEST_FAULT("can't write W/O file\n");
+ }
+ file_id = H5Fopen(filename_rw, H5F_ACC_RDWR, fapl_id);
+ if (file_id == H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("file-open failed with both present\n");
+ }
+ /* Open successful; close file then inspect presence again */
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file ID\n");
+ }
+ if (!file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ }
+ if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
+ }
+ if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
+ }
+
+ /* H5Fcreate() with TRUNC access.
+ * Both files already exist.
+ */
+
+ file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (file_id == H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("file-open failed with both present\n");
+ }
+ /* Open successful; close file then inspect presence again */
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file ID\n");
+ }
+ if (!file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ }
+ if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
+ }
+ if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
+ }
+
+ /* H5Fcreate() with TRUNC access.
+ * R/W already exists.
+ */
+
+ HDremove(filename_rw);
+ HDremove(vfd_config.wo_path);
+ if (splitter_create_single_file_at(filename_rw, child_fapl_id, &data) < 0) {
+ SPLITTER_TEST_FAULT("can't write R/W file\n");
+ }
+
+ if (file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("failed to remove W/O file\n");
+ }
+ file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (file_id == H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("file-open failed with both present\n");
+ }
+ /* Open successful; close file then inspect presence again */
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file ID\n");
+ }
+ if (!file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ }
+ if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
+ }
+ if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
+ }
+
+ /* H5Fcreate() with TRUNC access.
+ * W/O already exists.
+ */
+
+ HDremove(filename_rw);
+ HDremove(vfd_config.wo_path);
+ if (splitter_create_single_file_at(vfd_config.wo_path, child_fapl_id, &data) < 0) {
+ SPLITTER_TEST_FAULT("can't write R/W file\n");
+ }
+
+ if (file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("failed to remove R/W file\n");
+ }
+ file_id = H5Fcreate(filename_rw, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id);
+ if (file_id == H5I_INVALID_HID) {
+ SPLITTER_TEST_FAULT("file-open failed with both present\n");
+ }
+ /* Open successful; close file then inspect presence again */
+ if (H5Fclose(file_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close file ID\n");
+ }
+ if (!file_exists(filename_rw, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("R/W file mysteriously disappared\n");
+ }
+ if (!file_exists(vfd_config.wo_path, child_fapl_id)) {
+ SPLITTER_TEST_FAULT("W/O file mysteriously disappeared\n");
+ }
+ if (h5_compare_file_bytes(filename_rw, vfd_config.wo_path) < 0) {
+ SPLITTER_TEST_FAULT("files are not byte-for-byte equivalent\n");
+ }
+
+ /* H5Fcreate with both files absent is tested elsewhere */
+
+ /* Cleanup
+ */
+
+ if (H5Pclose(fapl_id) < 0) {
+ SPLITTER_TEST_FAULT("can't close splitter FAPL ID\n");
+ }
+
+done:
+ if (ret_value < 0) {
+ H5E_BEGIN_TRY {
+ (void)H5Pclose(fapl_id);
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ } /* end if error */
+ return ret_value;
+} /* end splitter_tentative_open_test() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: file_exists()
+ *
+ * Purpose: Determine whether a file exists on-system
+ *
+ * Return: Non-zero (1) if it exists (H5Fopen successful),
+ * zero (0) if absent (cannot be opened).
+ *
+ * Description: Attempt H5Fopen with the given FAPL ID and RDONLY access flag.
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+file_exists(const char *filename, hid_t fapl_id)
+{
+ hid_t file_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ H5E_BEGIN_TRY {
+ file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id);
+ } H5E_END_TRY;
+ if (file_id != H5I_INVALID_HID) {
+ ret_value = 1;
+ if (H5Fclose(file_id) < 0) {
+ FAIL_PUTS_ERROR("can't close file ID\n");
+ }
+ }
+
+ return ret_value;
+
+error:
+ H5E_BEGIN_TRY {
+ (void)H5Fclose(file_id);
+ } H5E_END_TRY;
+ return ret_value;
+} /* end file_exists() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_splitter
+ *
+ * Purpose: Tests the Splitter VFD
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Description:
+ * This test function uses the Splitter VFD to produce a r/w
+ * file and a w/o file. It will verify that the two files
+ * are identical.
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_splitter(void)
+{
+ int buf[SPLITTER_SIZE][SPLITTER_SIZE];
+ hsize_t dims[2] = { SPLITTER_SIZE, SPLITTER_SIZE };
+ hid_t child_fapl_id = H5I_INVALID_HID;
+ int i = 0;
+ int j = 0;
+ struct splitter_dataset_def data;
+
+ TESTING("SPLITTER file driver");
+
+ /* pre-fill data buffer to write */
+ for (i=0; i < SPLITTER_SIZE; i++) {
+ for (j=0; j < SPLITTER_SIZE; j++) {
+ buf[i][j] = i*100+j;
+ }
+ }
+
+ /* Dataset info */
+ data.buf = (void *)buf;
+ data.mem_type_id = H5T_NATIVE_INT;
+ data.dims = dims;
+ data.n_dims = 2;
+ data.dset_name = SPLITTER_DATASET_NAME;
+
+ /* Stand-in for manual FAPL creation
+ * Enables verification with arbitrary VFDs via `make check-vfd`
+ */
+ child_fapl_id = h5_fileaccess();
+ if (child_fapl_id < 0) {
+ TEST_ERROR;
+ }
+
+ if (!driver_is_splitter_compatible(child_fapl_id)) {
+ SKIPPED();
+ HDprintf(" given driver is not Splitter W/O compatible.\n");
+ return 0;
+ }
+
+ /* Test Read-Only access, including when a file on the W/O channel
+ * does not exist.
+ */
+ if (splitter_RO_test(&data, child_fapl_id) < 0) {
+ TEST_ERROR;
+ }
+
+ /* Test opening of files when the W/O channel does not exist.
+ */
+ if (splitter_tentative_open_test(child_fapl_id) < 0) {
+ TEST_ERROR;
+ }
+
+
+ /* Test file creation, utilizing different child FAPLs (default vs.
+ * specified), logfile, and Write Channel error ignoring behavior.
+ */
+ for (i=0; i < 4; i++) {
+ hbool_t ignore_wo_errors = (i & 1) ? TRUE : FALSE;
+ hbool_t provide_logfile_path = (i & 2) ? TRUE : FALSE;
+ hid_t child_fapl_ids[2] = { H5P_DEFAULT, H5P_DEFAULT };
+
+ /* Test child driver definition/default combination */
+ for (j=0; j < 4; j++) {
+
+ child_fapl_ids[0] = (j & 1) ? child_fapl_id : H5P_DEFAULT;
+ child_fapl_ids[1] = (j & 2) ? child_fapl_id : H5P_DEFAULT;
+
+ if (run_splitter_test(&data, ignore_wo_errors, provide_logfile_path, child_fapl_ids) < 0) {
+ TEST_ERROR;
+ }
+
+ } /* end for child fapl definition/pairing */
+
+ } /* end for behavior-flag loops */
+
+/* TODO: SWMR open? */
+/* Concurrent opens with both drivers using the Splitter */
+
+
+ if (H5Pclose(child_fapl_id) == FAIL) {
+ TEST_ERROR;
+ }
+
+ PASSED();
+ return 0;
+
+error:
+ if (child_fapl_id != H5I_INVALID_HID) {
+ (void)H5Pclose(child_fapl_id);
+ }
+ return -1;
+} /* end test_splitter() */
+
+#undef SPLITTER_TEST_FAULT
+
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -1897,9 +3277,6 @@ error:
* Return: Success: 0
* Failure: 1
*
- * Programmer: Raymond Lu
- * Tuesday, Sept 24, 2002
- *
*-------------------------------------------------------------------------
*/
int
@@ -1916,11 +3293,14 @@ main(void)
nerrors += test_direct() < 0 ? 1 : 0;
nerrors += test_family() < 0 ? 1 : 0;
nerrors += test_family_compat() < 0 ? 1 : 0;
+ nerrors += test_family_member_fapl() < 0 ? 1 : 0;
nerrors += test_multi() < 0 ? 1 : 0;
nerrors += test_multi_compat() < 0 ? 1 : 0;
nerrors += test_log() < 0 ? 1 : 0;
nerrors += test_stdio() < 0 ? 1 : 0;
nerrors += test_windows() < 0 ? 1 : 0;
+ nerrors += test_ros3() < 0 ? 1 : 0;
+ nerrors += test_splitter() < 0 ? 1 : 0;
if(nerrors) {
HDprintf("***** %d Virtual File Driver TEST%s FAILED! *****\n",
diff --git a/test/vol.c b/test/vol.c
new file mode 100644
index 0000000..0f8af4f
--- /dev/null
+++ b/test/vol.c
@@ -0,0 +1,1172 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Tests the virtual object layer (H5VL)
+ *
+ * This is a minimal test to ensure VOL usage (setting a VOL, etc.)
+ * works as expected. Actual VOL functionality is tested using
+ * other mechanisms.
+ */
+
+#include "h5test.h"
+
+/* Filename */
+const char *FILENAME[] = {
+ "native_vol_test",
+ NULL
+};
+
+#define NATIVE_VOL_TEST_GROUP_NAME "test_group"
+#define NATIVE_VOL_TEST_DATASET_NAME "test_dataset"
+#define NATIVE_VOL_TEST_ATTRIBUTE_NAME "test_dataset"
+#define NATIVE_VOL_TEST_HARD_LINK_NAME "test_hard_link"
+#define NATIVE_VOL_TEST_SOFT_LINK_NAME "test_soft_link"
+#define NATIVE_VOL_TEST_MOVE_LINK_NAME "test_move_link"
+#define NATIVE_VOL_TEST_COPY_LINK_NAME "test_copy_link"
+#define NATIVE_VOL_TEST_DATATYPE_NAME "test_datatype"
+
+#define N_ELEMENTS 10
+
+#define FAKE_VOL_NAME "fake"
+#define FAKE_VOL_VALUE ((H5VL_class_value_t)501)
+
+/* A VOL class struct that describes a VOL class with no
+ * functionality.
+ */
+static const H5VL_class_t fake_vol_g = {
+ 0, /* version */
+ FAKE_VOL_VALUE, /* value */
+ FAKE_VOL_NAME, /* name */
+ 0, /* capability flags */
+ NULL, /* initialize */
+ NULL, /* terminate */
+ { /* info_cls */
+ (size_t)0, /* size */
+ NULL, /* copy */
+ NULL, /* compare */
+ NULL, /* free */
+ NULL, /* to_str */
+ NULL, /* from_str */
+ },
+ { /* wrap_cls */
+ NULL, /* get_object */
+ NULL, /* get_wrap_ctx */
+ NULL, /* wrap_object */
+ NULL, /* unwrap_object */
+ NULL, /* free_wrap_ctx */
+ },
+ { /* attribute_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* dataset_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* read */
+ NULL, /* write */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* datatype_cls */
+ NULL, /* commit */
+ NULL, /* open */
+ NULL, /* get_size */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* file_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* group_cls */
+ NULL, /* create */
+ NULL, /* open */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* close */
+ },
+ { /* link_cls */
+ NULL, /* create */
+ NULL, /* copy */
+ NULL, /* move */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* object_cls */
+ NULL, /* open */
+ NULL, /* copy */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* introspect_cls */
+ NULL, /* get_conn_cls */
+ NULL, /* opt_query */
+ },
+ { /* request_cls */
+ NULL, /* wait */
+ NULL, /* notify */
+ NULL, /* cancel */
+ NULL, /* specific */
+ NULL, /* optional */
+ NULL /* free */
+ },
+ { /* blob_cls */
+ NULL, /* put */
+ NULL, /* get */
+ NULL, /* specific */
+ NULL /* optional */
+ },
+ { /* token_cls */
+ NULL, /* cmp */
+ NULL, /* to_str */
+ NULL /* from_str */
+ },
+ NULL /* optional */
+};
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_vol_registration()
+ *
+ * Purpose: Tests if we can load, register, and close a simple
+ * VOL connector.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_vol_registration(void)
+{
+ hid_t native_id = H5I_INVALID_HID;
+ hid_t lapl_id = H5I_INVALID_HID;
+ hid_t vipl_id = H5I_INVALID_HID;
+ herr_t ret = SUCCEED;
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+ hid_t vol_id2 = H5I_INVALID_HID;
+
+ TESTING("VOL registration");
+
+ /* The test/fake VOL connector should not be registered at the start of the test */
+ if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0)
+ TEST_ERROR;
+ if (is_registered > 0)
+ FAIL_PUTS_ERROR("VOL connector is inappropriately registered");
+ if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0)
+ TEST_ERROR;
+ if (is_registered > 0)
+ FAIL_PUTS_ERROR("VOL connector is inappropriately registered");
+
+ /* Test registering a connector with an incorrect property list (SHOULD FAIL) */
+ if ((lapl_id = H5Pcreate(H5P_LINK_ACCESS)) < 0)
+ TEST_ERROR;
+ H5E_BEGIN_TRY {
+ vol_id = H5VLregister_connector(&fake_vol_g, lapl_id);
+ } H5E_END_TRY;
+ if (H5I_INVALID_HID != vol_id)
+ FAIL_PUTS_ERROR("should not be able to register a connector with an incorrect property list");
+ if (H5Pclose(lapl_id) < 0)
+ TEST_ERROR;
+
+ /* Load a VOL interface
+ * The vipl_id does nothing without a VOL that needs it, but we do need to
+ * test creating a property list of that class and passing it along as a
+ * smoke check.
+ */
+ if ((vipl_id = H5Pcreate(H5P_VOL_INITIALIZE)) < 0)
+ TEST_ERROR;
+ if ((vol_id = H5VLregister_connector(&fake_vol_g, vipl_id)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(vipl_id) < 0)
+ TEST_ERROR;
+
+ /* The test/fake VOL connector should be registered now */
+ if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("VOL connector is un-registered");
+ if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("VOL connector is un-registered");
+
+ /* Re-register a VOL connector */
+ if ((vol_id2 = H5VLregister_connector(&fake_vol_g, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* The test/fake VOL connector should still be registered now */
+ if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("VOL connector is un-registered");
+ if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("VOL connector is un-registered");
+
+ /* Unregister the second test/fake VOL ID */
+ if (H5VLunregister_connector(vol_id2) < 0)
+ TEST_ERROR;
+
+ /* The test/fake VOL connector should still be registered now */
+ if ((is_registered = H5VLis_connector_registered_by_name(FAKE_VOL_NAME)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("VOL connector is un-registered");
+ if ((is_registered = H5VLis_connector_registered_by_value(FAKE_VOL_VALUE)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("VOL connector is un-registered");
+
+ /* Unregister the original test/fake VOL ID */
+ if (H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* Try to unregister the native VOL connector (should fail) */
+ if (H5I_INVALID_HID == (native_id = H5VLget_connector_id_by_name(H5VL_NATIVE_NAME)))
+ TEST_ERROR;
+ H5E_BEGIN_TRY {
+ ret = H5VLunregister_connector(native_id);
+ } H5E_END_TRY;
+ if (FAIL != ret)
+ FAIL_PUTS_ERROR("should not be able to unregister the native VOL connector");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ H5Pclose(lapl_id);
+ H5Pclose(vipl_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_vol_registration() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_native_vol_init()
+ *
+ * Purpose: Tests if the native VOL connector gets initialized.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_native_vol_init(void)
+{
+ htri_t is_registered;
+
+ TESTING("Native VOL connector initialization");
+
+ /* The native VOL connector should always be registered */
+ if ((is_registered = H5VLis_connector_registered_by_name(H5VL_NATIVE_NAME)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ if ((is_registered = H5VLis_connector_registered_by_value(H5VL_NATIVE_VALUE)) < 0)
+ TEST_ERROR;
+ if (0 == is_registered)
+ FAIL_PUTS_ERROR("native VOL connector is un-registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ return FAIL;
+
+} /* end test_native_vol_init() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_file_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL file operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_file_operation(const char *env_h5_drvr)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fid_reopen = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t fapl_id2 = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID;
+
+ char filename[1024];
+ ssize_t obj_count;
+ hid_t obj_id_list[1];
+ hsize_t file_size;
+ unsigned intent;
+ void *os_file_handle = NULL;
+ H5F_info2_t finfo;
+ char name[32];
+
+ TESTING("Basic VOL file operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ /* Set the file close degree to a non-default value, to make the H5Pequal
+ * work out. This is kinda odd, but the library's current behavior with
+ * a default value is to return the value chosen (H5F_CLOSE_SEMI) instead
+ * of the default value (H5F_CLOSE_DEFAULT) from the property and then
+ * the H5Pequal doesn't detect that the property lists are the same. Since
+ * this is the documented behavior for file close degree for many years,
+ * I'm not fighting it, just getting the testing to verify that the VOL
+ * connector property is returned correctly. -QAK, 2018/11/17
+ */
+ if(H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI) < 0)
+ TEST_ERROR;
+ if(H5Pset_metadata_read_attempts(fapl_id, 9) < 0)
+ TEST_ERROR
+
+ /* H5Fcreate */
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_obj_count */
+ if ((obj_count = H5Fget_obj_count(fid, H5F_OBJ_FILE)) < 0)
+ TEST_ERROR;
+ if ((obj_count = H5Fget_obj_count(fid, H5F_OBJ_ALL)) < 0)
+ TEST_ERROR;
+ if ((obj_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET)) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_obj_ids */
+ if ((obj_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, 2, obj_id_list)) < 0)
+ TEST_ERROR;
+ if ((obj_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET, 2, obj_id_list)) < 0)
+ TEST_ERROR;
+
+ /* Can't compare VFD properties for split / multi / family VFDs */
+ if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) {
+ /* H5Fget_access_plist */
+ if ((fapl_id2 = H5Fget_access_plist(fid)) < 0)
+ TEST_ERROR;
+ if (H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if (H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+ } /* end if */
+
+ /* H5Fget_create_plist */
+ if ((fcpl_id = H5Fget_create_plist(fid)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(fcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_filesize */
+ if (H5Fget_filesize(fid, &file_size) < 0)
+ TEST_ERROR;
+
+ /* Can't retrieve VFD handle for split / multi / family VFDs */
+ if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) {
+ /* H5Fget_vfd_handle */
+ if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0)
+ TEST_ERROR;
+ } /* end if */
+
+ /* H5Fget_intent */
+ if (H5Fget_intent(fid, &intent) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_info2 */
+ if (H5Fget_info2(fid, &finfo) < 0)
+ TEST_ERROR;
+
+ /* H5Fget_name */
+ if (H5Fget_name(fid, name, 32) < 0)
+ TEST_ERROR;
+
+ /* H5Fclear_elink_file_cache */
+ if (H5Fclear_elink_file_cache(fid) < 0)
+ TEST_ERROR;
+
+ /* H5Fflush */
+ if (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ TEST_ERROR;
+
+ /* H5Fclose */
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ /* H5Fis_accessible */
+ if (H5Fis_accessible(filename, fapl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Fopen */
+ if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* Can't compare VFD properties for split / multi / family VFDs */
+ if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) {
+ /* H5Fget_access_plist */
+ if((fapl_id2 = H5Fget_access_plist(fid)) < 0)
+ TEST_ERROR;
+ if(H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if(H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+ } /* end if */
+
+ if ((fid_reopen = H5Freopen(fid)) < 0)
+ TEST_ERROR;
+
+ /* Can't compare VFD properties for split / multi / family VFDs */
+ if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) {
+ /* H5Fget_access_plist */
+ if((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0)
+ TEST_ERROR;
+ if(H5Pequal(fapl_id, fapl_id2) != TRUE)
+ TEST_ERROR;
+ if(H5Pclose(fapl_id2) < 0)
+ TEST_ERROR;
+ } /* end if */
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid_reopen) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Fclose(fid_reopen);
+ H5Pclose(fapl_id);
+ H5Pclose(fapl_id2);
+ H5Pclose(fcpl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_file_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_group_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL group operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_group_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t gid_a = H5I_INVALID_HID;
+ hid_t gcpl_id = H5I_INVALID_HID;
+ char filename[1024];
+ H5G_info_t info;
+
+ TESTING("Basic VOL group operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+
+ /* H5Gcreate */
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_create_plist */
+ if ((gcpl_id = H5Gget_create_plist(gid)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(gcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_info */
+ if (H5Gget_info(gid, &info) < 0)
+ TEST_ERROR;
+ if (H5Gget_info(fid, &info) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_info_by_name */
+ if (H5Gget_info_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, &info, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Gget_info_by_idx */
+ if (H5Gget_info_by_idx(fid, "/", H5_INDEX_NAME, H5_ITER_NATIVE, 0, &info, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Gflush */
+ if (H5Gflush(gid) < 0)
+ TEST_ERROR;
+
+ /* H5Gclose */
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ /* H5Gopen */
+ if ((gid = H5Gopen2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Gcreate_anon */
+ if ((gid_a = H5Gcreate_anon(fid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Grefresh */
+ if (H5Grefresh(gid) < 0)
+ TEST_ERROR;
+
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid_a) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Gclose(gid);
+ H5Pclose(fapl_id);
+ H5Pclose(gcpl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_group_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_dataset_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL dataset operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_dataset_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t dcpl_id = H5I_INVALID_HID;
+ hid_t dapl_id = H5I_INVALID_HID;
+ hid_t did = H5I_INVALID_HID;
+ hid_t did_a = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+
+ char filename[1024];
+
+ hsize_t curr_dims = 0;
+ hsize_t max_dims = H5S_UNLIMITED;
+
+ hsize_t storage_size;
+ haddr_t offset;
+ H5D_space_status_t status;
+
+ int in_buf[N_ELEMENTS];
+ int out_buf[N_ELEMENTS];
+
+ int i;
+
+ TESTING("Basic VOL dataset operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ for (i = 0; i < N_ELEMENTS; i++) {
+ in_buf[i] = i;
+ out_buf[i] = 0;
+ }
+
+ /* H5Dcreate */
+ curr_dims = 0;
+ if ((sid = H5Screate_simple(1, &curr_dims, &max_dims)) < 0)
+ TEST_ERROR;
+ curr_dims = N_ELEMENTS;
+ if ((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ TEST_ERROR;
+ if (H5Pset_chunk(dcpl_id, 1, &curr_dims) < 0)
+ TEST_ERROR;
+ if ((did = H5Dcreate2(fid, NATIVE_VOL_TEST_DATASET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Dcreate_anon */
+ if ((did_a = H5Dcreate_anon(fid, H5T_NATIVE_INT, sid, dcpl_id, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Dset_extent */
+ curr_dims = N_ELEMENTS;
+ if (H5Dset_extent(did, &curr_dims) < 0)
+ TEST_ERROR;
+
+ /* H5Dflush */
+ if (H5Dflush(did) < 0)
+ TEST_ERROR;
+
+ /* H5Dwrite */
+ if (H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, in_buf) < 0)
+ TEST_ERROR;
+
+ /* H5Drefresh */
+ if (H5Drefresh(did) < 0)
+ TEST_ERROR;
+
+ /* H5Dclose */
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if (H5Dclose(did_a) < 0)
+ TEST_ERROR;
+
+ /* H5Dopen */
+ if ((did = H5Dopen2(fid, NATIVE_VOL_TEST_DATASET_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_space */
+ if ((sid = H5Dget_space(did)) < 0)
+ TEST_ERROR;
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_space_status */
+ if (H5Dget_space_status(did, &status) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_type */
+ if ((tid = H5Dget_type(did)) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Tcopy (when used w/ a dataset, it gets an H5VL struct */
+ if ((tid = H5Tcopy(did)) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_create_plist */
+ if ((dcpl_id = H5Dget_create_plist(did)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dcpl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_access_plist */
+ if ((dapl_id = H5Dget_access_plist(did)) < 0)
+ TEST_ERROR;
+ if (H5Pclose(dapl_id) < 0)
+ TEST_ERROR;
+
+ /* H5Dget_storage_size */
+ /* XXX: This is a terrible API call that can't truly indicate failure */
+ if (0 == (storage_size = H5Dget_storage_size(did)))
+ TEST_ERROR;
+
+ /* H5Dget_offset */
+ /* XXX: Another bad API call that can't flag error values. Also, this
+ * returns HADDR_UNDEF for chunked datasets, which is bizarre.
+ */
+ if (HADDR_UNDEF != (offset = H5Dget_offset(did)))
+ TEST_ERROR;
+
+ /* H5Dread */
+ if (H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, out_buf) < 0)
+ TEST_ERROR;
+
+ for (i = 0; i < N_ELEMENTS; i++)
+ if (in_buf[i] != out_buf[i])
+ TEST_ERROR;
+
+ if (H5Dclose(did) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Dclose(did);
+ H5Dclose(did_a);
+ H5Sclose(sid);
+ H5Tclose(tid);
+ H5Pclose(fapl_id);
+ H5Pclose(dapl_id);
+ H5Pclose(dcpl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_dataset_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_attribute_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL attribute operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_attribute_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t aid = H5I_INVALID_HID;
+ hid_t aid_name = H5I_INVALID_HID;
+ hid_t sid = H5I_INVALID_HID;
+
+ char filename[1024];
+
+ hsize_t dims = 1;
+
+ int data_in = 42;
+ int data_out = 0;
+
+ TESTING("Basic VOL attribute operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ dims = 1;
+ if ((sid = H5Screate_simple(1, &dims, &dims)) < 0)
+ TEST_ERROR;
+
+ /* H5Acreate */
+ if ((aid = H5Acreate2(fid, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Awrite */
+ if (H5Awrite(aid, H5T_NATIVE_INT, &data_in) < 0)
+ TEST_ERROR;
+
+ /* H5Aread */
+ if (H5Aread(aid, H5T_NATIVE_INT, &data_out) < 0)
+ TEST_ERROR;
+ if (data_in != data_out)
+ TEST_ERROR;
+
+ /* H5Aclose */
+ if (H5Aclose(aid) < 0)
+ TEST_ERROR;
+
+ /* H5Aopen */
+ if ((aid = H5Aopen(fid, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if (H5Aclose(aid) < 0)
+ TEST_ERROR;
+
+ /* H5Adelete */
+ if (H5Adelete(fid, NATIVE_VOL_TEST_ATTRIBUTE_NAME) < 0)
+ TEST_ERROR;
+
+ /* H5Acreate_by_name */
+ if ((aid_name = H5Acreate_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ /* H5Aclose */
+ if (H5Aclose(aid_name) < 0)
+ TEST_ERROR;
+
+ /* H5Adelete_by_name */
+ if (H5Adelete_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, NATIVE_VOL_TEST_ATTRIBUTE_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ if (H5Sclose(sid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Pclose(fapl_id);
+ H5Gclose(gid);
+ H5Sclose(sid);
+ H5Aclose(aid);
+ H5Aclose(aid_name);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_attribute_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_object_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL object operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_object_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t oid = H5I_INVALID_HID;
+
+ char filename[1024];
+ H5O_info2_t object_info;
+
+ TESTING("Basic VOL object operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Oget_info */
+ if (H5Oget_info3(fid, &object_info, H5O_INFO_ALL) < 0)
+ TEST_ERROR;
+
+ /* H5Oget_info_by_name */
+ if (H5Oget_info_by_name3(fid, NATIVE_VOL_TEST_GROUP_NAME, &object_info, H5O_INFO_ALL, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Oexists_by_name */
+ if (H5Oexists_by_name(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT) != TRUE)
+ TEST_ERROR;
+
+ /* H5Oopen/close */
+ if ((oid = H5Oopen(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ if (H5Oclose(oid) < 0)
+ TEST_ERROR;
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Pclose(fapl_id);
+ H5Gclose(gid);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_object_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_link_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL link operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_link_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ char filename[1024];
+
+ TESTING("Basic VOL link operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Lcreate_hard */
+ if (H5Lcreate_hard(fid, "/", gid, NATIVE_VOL_TEST_HARD_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lcreate_soft (to itself) */
+ if (H5Lcreate_soft("/", fid, NATIVE_VOL_TEST_SOFT_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lexists */
+ if (H5Lexists(gid, NATIVE_VOL_TEST_HARD_LINK_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+ if (H5Lexists(fid, NATIVE_VOL_TEST_SOFT_LINK_NAME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lcopy */
+ if (H5Lcopy(gid, NATIVE_VOL_TEST_HARD_LINK_NAME, fid, NATIVE_VOL_TEST_COPY_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Lmove */
+ if (H5Lmove(fid, NATIVE_VOL_TEST_COPY_LINK_NAME, gid, NATIVE_VOL_TEST_MOVE_LINK_NAME, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+ if (H5Gclose(gid) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Fclose(fid);
+ H5Fclose(gid);
+ H5Pclose(fapl_id);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_link_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_basic_datatype_operation()
+ *
+ * Purpose: Uses the native VOL connector to test basic VOL datatype operations
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_basic_datatype_operation(void)
+{
+ hid_t fid = H5I_INVALID_HID;
+ hid_t fapl_id = H5I_INVALID_HID;
+ hid_t tid = H5I_INVALID_HID;
+ hid_t tid_anon = H5I_INVALID_HID;
+ hid_t tcpl_id = H5I_INVALID_HID;
+ char filename[1024];
+
+ TESTING("Basic VOL datatype operations");
+
+ /* Retrieve the file access property for testing */
+ fapl_id = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename);
+
+ if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0)
+ TEST_ERROR;
+ if ((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR;
+
+ /* H5Tcommit */
+ if (H5Tcommit2(fid, NATIVE_VOL_TEST_DATATYPE_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ /* H5Tflush */
+ if (H5Tflush(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Trefresh */
+ if (H5Trefresh(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Tclose */
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+
+ /* H5Topen */
+ if ((tid = H5Topen2(fid, NATIVE_VOL_TEST_DATATYPE_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* H5Tget_create_plist */
+ if ((tcpl_id = H5Tget_create_plist(tid)) < 0)
+ TEST_ERROR;
+
+ /* H5Tcommit_anon */
+ if ((tid_anon = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR;
+ if (H5Tcommit_anon(fid, tid_anon, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+
+ if (H5Pclose(tcpl_id) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid) < 0)
+ TEST_ERROR;
+ if (H5Tclose(tid_anon) < 0)
+ TEST_ERROR;
+ if (H5Fclose(fid) < 0)
+ TEST_ERROR;
+
+ h5_delete_test_file(FILENAME[0], fapl_id);
+
+ /* H5Pclose */
+ if (H5Pclose(fapl_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(tcpl_id);
+ H5Fclose(fid);
+ H5Pclose(fapl_id);
+ H5Tclose(tid);
+ H5Tclose(tid_anon);
+ } H5E_END_TRY;
+
+ return FAIL;
+
+} /* end test_basic_datatype_operation() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests the virtual object layer interface (H5VL)
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ const char *env_h5_drvr; /* File driver value from environment */
+ int nerrors = 0;
+
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if(env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
+
+ h5_reset();
+
+ HDputs("Testing basic Virtual Object Layer (VOL) functionality.");
+
+ nerrors += test_vol_registration() < 0 ? 1 : 0;
+ nerrors += test_native_vol_init() < 0 ? 1 : 0;
+ nerrors += test_basic_file_operation(env_h5_drvr) < 0 ? 1 : 0;
+ nerrors += test_basic_group_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_dataset_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_attribute_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_object_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_link_operation() < 0 ? 1 : 0;
+ nerrors += test_basic_datatype_operation() < 0 ? 1 : 0;
+
+ if (nerrors) {
+ HDprintf("***** %d Virtual Object Layer TEST%s FAILED! *****\n",
+ nerrors, nerrors > 1 ? "S" : "");
+ HDexit(EXIT_FAILURE);
+ }
+
+ HDputs("All Virtual Object Layer (VOL) tests passed.");
+
+ HDexit(EXIT_SUCCESS);
+
+} /* end main() */
+
diff --git a/test/vol_plugin.c b/test/vol_plugin.c
new file mode 100644
index 0000000..565c847
--- /dev/null
+++ b/test/vol_plugin.c
@@ -0,0 +1,352 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: Tests basic VOL plugin operations (registration, etc.).
+ * Uses the null VOL connector (built with the testing code)
+ * which is loaded as a dynamic plugin.
+ *
+ * TO DO: Adapt the null VOL connector to do something interesting with
+ * the property list.
+ */
+
+#include "h5test.h"
+
+#include "null_vol_connector.h"
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_registration_by_value()
+ *
+ * Purpose: Tests if we can load, register, and close a VOL
+ * connector by value.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_registration_by_value(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+
+ TESTING("VOL registration by value");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by value */
+ if((vol_id = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_registration_by_value() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_registration_by_name()
+ *
+ * Purpose: Tests if we can load, register, and close a VOL
+ * connector by name.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_registration_by_name(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+
+ TESTING("VOL registration by name");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by name */
+ if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_registration_by_name() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_multiple_registration()
+ *
+ * Purpose: Tests if we can register a VOL connector multiple times.
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+#define N_REGISTRATIONS 10
+static herr_t
+test_multiple_registration(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_ids[N_REGISTRATIONS];
+ int i;
+
+ TESTING("registering a VOL connector multiple times");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector multiple times */
+ for(i = 0; i < N_REGISTRATIONS; i++) {
+ if((vol_ids[i] = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ }
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ for(i = 0; i < N_REGISTRATIONS; i++) {
+ if(H5VLunregister_connector(vol_ids[i]) < 0)
+ TEST_ERROR;
+ /* Also test close on some of the IDs. This call currently works
+ * identically to unregister.
+ */
+ i++;
+ if(H5VLclose(vol_ids[i]) < 0)
+ TEST_ERROR;
+ }
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Repeat testing with the _by_value routines */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector multiple times */
+ for(i = 0; i < N_REGISTRATIONS; i++) {
+ if((vol_ids[i] = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+ }
+
+ /* The connector should be registered now */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(FALSE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector was not registered");
+
+ /* Unregister the connector */
+ for(i = 0; i < N_REGISTRATIONS; i++) {
+ if(H5VLunregister_connector(vol_ids[i]) < 0)
+ TEST_ERROR;
+ /* Also test close on some of the IDs. This call currently works
+ * identically to unregister.
+ */
+ i++;
+ if(H5VLclose(vol_ids[i]) < 0)
+ TEST_ERROR;
+ }
+
+ /* The connector should not be registered now */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ for(i = 0; i < N_REGISTRATIONS; i++)
+ H5VLunregister_connector(vol_ids[i]);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_multiple_registration() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_getters()
+ *
+ * Purpose: Tests H5VL getters
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_getters(void)
+{
+ htri_t is_registered = FAIL;
+ hid_t vol_id = H5I_INVALID_HID;
+ hid_t vol_id_out = H5I_INVALID_HID;
+
+ TESTING("VOL getters");
+
+ /* The null VOL connector should not be registered at the start of the test */
+ if((is_registered = H5VLis_connector_registered_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by name */
+ if((vol_id = H5VLregister_connector_by_name(NULL_VOL_CONNECTOR_NAME, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Get the connector's ID by name */
+ if((vol_id_out = H5VLget_connector_id_by_name(NULL_VOL_CONNECTOR_NAME)) < 0)
+ TEST_ERROR;
+ if(vol_id != vol_id_out)
+ FAIL_PUTS_ERROR("VOL connector IDs don't match");
+ if(H5VLclose(vol_id_out) < 0)
+ TEST_ERROR;
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ /* Repeat testing with the _by_value routines */
+ if((is_registered = H5VLis_connector_registered_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(TRUE == is_registered)
+ FAIL_PUTS_ERROR("NULL VOL connector is inappropriately registered");
+
+ /* Register the connector by value */
+ if((vol_id = H5VLregister_connector_by_value(NULL_VOL_CONNECTOR_VALUE, H5P_DEFAULT)) < 0)
+ TEST_ERROR;
+
+ /* Get the connector's ID by value */
+ if((vol_id_out = H5VLget_connector_id_by_value(NULL_VOL_CONNECTOR_VALUE)) < 0)
+ TEST_ERROR;
+ if(vol_id != vol_id_out)
+ FAIL_PUTS_ERROR("VOL connector IDs don't match");
+ if(H5VLclose(vol_id_out) < 0)
+ TEST_ERROR;
+
+ /* Unregister the connector */
+ if(H5VLunregister_connector(vol_id) < 0)
+ TEST_ERROR;
+
+ PASSED();
+ return SUCCEED;
+
+error:
+ H5E_BEGIN_TRY {
+ H5VLclose(vol_id_out);
+ H5VLunregister_connector(vol_id);
+ } H5E_END_TRY;
+ return FAIL;
+
+} /* end test_getters() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: Tests VOL connector plugin operations
+ *
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ int nerrors = 0;
+
+ h5_reset();
+
+ HDputs("Testing VOL connector plugin functionality.");
+
+ nerrors += test_registration_by_name() < 0 ? 1 : 0;
+ nerrors += test_registration_by_value() < 0 ? 1 : 0;
+ nerrors += test_multiple_registration() < 0 ? 1 : 0;
+ nerrors += test_getters() < 0 ? 1 : 0;
+
+ if(nerrors) {
+ HDprintf("***** %d VOL connector plugin TEST%s FAILED! *****\n",
+ nerrors, nerrors > 1 ? "S" : "");
+ HDexit(EXIT_FAILURE);
+ }
+
+ HDputs("All VOL connector plugin tests passed.");
+
+ HDexit(EXIT_SUCCESS);
+
+} /* end main() */
+